texts:
Alright, I'm going to start by using Google Earth terminology because that's where the original need for a solution came up.  I have multiple paths (54) that I want to merge into a single path.

Using QGIS I converted to .shp file, but it still maintained the 'feature subset'.  So next question - within QGIS does anyone know of any easy way to merge the features of a single shp file?


texts: Get Attributes from Shapefile in Geoserver as GeoJSON

texts:
I am working with QGIS and Geoserver.
I have created a shapefile with an attribute table containing 4 rows/features and around 15 columns/attributes.

I published this file to Geoserver as Shapefile as points under publish section. I can see the four points in OpenLayer preview but when I select GeoJson from the dropdown I don't get the attribute table data.

Instead this is what I get.

    {
  "type": "FeatureCollection",
  "totalFeatures": 4,
  "features": [
    {
      "type": "Feature",
      "id": "toilet_list_trial.1",
      "geometry": {
        "type": "Point",
        "coordinates": [
          72.840306,
          18.948056
        ]
      },
      "geometry_name": "the_geom",
      "properties": {}
    },
    {
      "type": "Feature",
      "id": "toilet_list_trial.2",
      "geometry": {
        "type": "Point",
        "coordinates": [
          72.834778,
          18.947611
        ]
      },
      "geometry_name": "the_geom",
      "properties": {}
    },
    {
      "type": "Feature",
      "id": "toilet_list_trial.3",
      "geometry": {
        "type": "Point",
        "coordinates": [
          72.834944,
          18.947861
        ]
      },
      "geometry_name": "the_geom",
      "properties": {}
    },
    {
      "type": "Feature",
      "id": "toilet_list_trial.4",
      "geometry": {
        "type": "Point",
        "coordinates": [
          72.835278,
          18.947306
        ]
      },
      "geometry_name": "the_geom",
      "properties": {}
    }
  ],
  "crs": {
    "type": "name",
    "properties": {
      "name": "urn:ogc:def:crs:EPSG::404000"
    }
  }
}

What am I missing here?


texts: Getting changed data in csv to show up in Google Earth Pro

texts: I have a CSV file that I imported into Google Earth Pro. G.E.P. took the long/lat and placed markers where they should be, and when I select the marker the rest of the data displays in a box. Is there a way to link the two so that when the csv data is changed the data that shows up in Google Earth automatically changes as well?


texts:
I'm trying to get a network in shape (pain, such unending pain) and have turned to Check Geometry to find errors but I repeatedly get told that "The test layer set contains a layer selected for a topology check". I have no idea what this means and I can't find it anywhere except in the python file for the tool interface.
The first file I tried didn't work so I simply exported it as a new file and then it worked but that trick is no longer working.
Does anybody know what this error actually means and how to get around it?


texts: Portal for ArcGIS license within ArcGIS Server

texts: I have arcGIS 10.3 and have 100 users portal for ArcGIS, I want to use the portal for ArcGIS but I don't know how. I installed Portal for ArcGIS and it still keep telling  the software is not licensed


texts: Creating circle-polygon of certain radius around points in QGIS

texts:
I have a point layer in QGIS in EPSG:4326 and want to create polygon-circles of 10m radius around each point. All of the points are located within a squarekilometer in northern Germany. How do I do this? Buffering generates circles which are ellipses and way too big.
I'm quite unexperienced with GIS and I honestly searched the old questions before I posted this.


texts: Using ArcPy to find Enhanced Metafile (EMF) graphics added to ArcMap layout?

texts:
Enhanced metafile graphics can be added to maps manually but how can you manipulate them with ArcPy when this code finds no elements?

mxd = arcpy.mapping.MapDocument("CURRENT")
#Report picture elements
if len(arcpy.mapping.ListLayoutElements(mxd, "PICTURE_ELEMENT")) > 0:
    for elm in arcpy.mapping.ListLayoutElements(mxd, "PICTURE_ELEMENT"):
        print elm.name
#Report graphic elements
if len(arcpy.mapping.ListLayoutElements(mxd, "GRAPHIC_ELEMENT")) > 0:
    for elm in arcpy.mapping.ListLayoutElements(mxd, "GRAPHIC_ELEMENT"):
        print elm.name


texts: Geometry offset function is not working correctly

texts:
I'm trying to add offset in polygon feature and I'm using Esri a GIS software in C#.
The issue that I'm facing is after I create a polygon and click on functionality for creating offset inside polygon I get,

A very large offset that cover more area than my polygon Geometry.
No Offset is drawn.

I use 2 feet offset but user can enter more or less.
Here's the snippet of code that I used,
 Geometry geom = webMapView.SketchEditor.Geometry;
 Geometry Geom = Esri.ArcGISRuntime.Geometry.GeometryEngine.Project(geom, new SpatialReference(4326));               geom = Geom;
 OffSetGeometry = GeometryEngine.Offset(geom, -distance, OffsetType.Round, 1, 1);

How can I solve this problem?


texts: Get Grass to work in Processing using QGIS 2.18.16 Ubuntu 16.04

texts:
Executing a GRASS command in QGIS 2.18.16 via Processing returns the error:

This algorithm cannot be run :-(
It seems that GRASS is not correctly installed and configured in your system. Please install it before running GRASS algorithms.

The solutions provided at Cannot run Grass algorithms in QGIS 2.18 on Ubuntu 16.04 do not work for the following reasons.

As a workaround, you may edit (as sudo) /usr/share/qgis/python/plugins/processing/algs/grass7/Grass7Utils.py line 251 to

    command = 'grass72 ' + Grass7Utils.grassMapsetFolder() \

I do not believe that line 251 is the correct location for this code.  This area of code is between line 242 and 264.

    @staticmethod
    def writeGrass7Window(filename):
      out = open(filename, 'w')
      out.write('proj:       0\n')
      out.write('zone:       0\n')
      out.write('north:      1\n')
      out.write('south:      0\n')
      out.write('east:       1\n')
      out.write('west:       0\n')
      out.write('cols:       1\n')
      out.write('rows:       1\n')
      out.write('e-w resol:  1\n')
      out.write('n-s resol:  1\n')
      out.write('top:        1\n')
      out.write('bottom:     0\n')
      out.write('cols3:      1\n')
      out.write('rows3:      1\n')
      out.write('depths:     1\n')
      out.write('e-w resol3: 1\n')
      out.write('n-s resol3: 1\n')
      out.write('t-b resol:  1\n')
    out.close()

I tried the second solution to add a soft link but that returned an error.

sudo ln -s /usr/bin/grass72/usr/bin/grass70
ln: failed to create symbolic link './grass70': File exists
I uninstalled GRASS, disconnected from the unstable ubuntu qgis repository and reinstalled GRASS but it reinstalls 7.2.  There is no version 7.0 available at GRASS for download.

How do I get GRASS to work within Processing using Ubuntu QGIS 2.18.16?


texts: Clipping multiple rasters based on their overlapping area ArcMap?

texts:
I have Landsat Collection 1 Surface Reflectance NDVI images.  I would like to do pixel based time-series analysis and I need all images to be in the same dimension corresponding to the same area. So I would like to clip all my raster images based on their overlapping area.

Is there a way to define the overlapping area of all images and clip regarding this overlapping area in ArcMap 10.3?


texts: Extract pixel values in raster stack using shp

texts:
I am using the following code to extract mean pixel values over an area represented by a polygon:

mean<-lapply(S2_stack, FUN=function (S2_stack) {data.frame(mean=extract(S2_stack, polygons2, fun=mean))})

Where:

> S2_stack
class      : RasterStack
dimensions : 1454, 1595, 2319130, 4  (nrow, ncol, ncell, nlayers)
resolution : 10, 10  (x, y)
extent     : 744490, 760440, 4773400, 4787940  (xmin, xmax, ymin, ymax)
crs        : +proj=utm +zone=32 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0
names      : Subset_S2_MSIL2A_20180511T100029_MCI, Subset_S2_MSIL2A_20180710T100029_MCI, Subset_S2_MSIL2A_20180906T101021_MCI, Subset_S2_MSIL2A_20181115T101251_MCI

and polygons2:

polygons2 <- readOGR('/path/Insitu_poly.shp')

with:

> class(polygons2)
[1] "SpatialPolygonsDataFrame"
attr(,"package")
[1] "sp"

When I try to run my code I am getting the following error:

 Error in (function (classes, fdef, mtable)  :
  unable to find an inherited method for function ?extract? for signature ?"numeric", "SpatialPolygonsDataFrame"?

Not sure why. It seems extract needs a SpatialPolygonsDataFrame and as far as I know, it should run

Any idea?


texts: Is there a decent open source map-editor?

texts:
I would like to have an open source map editor for drawing a city map? I don't want to use OpenStreetMap. It will be a custom map project.

I don't need an advanced GIS system, but a simple map-editor, where I can use my own custom symbols. It must support Transverse Mercator projection and be able to calculated distances between objects on the map.


texts: Copy and paste from Word into ArcGIS Online item description results in added syntax

texts:
Using ArcGIS Online
I am trying to copy and paste a summary description I've written in a Word document into the ArcGIS Online item description. For some reason, a long string of syntax gets added after I click save (I think this is the background code to the word document). Is there a way to prevent this from happening?  This is a sample of the syntax that is added:
.
.
.
.
.
       Normal 0     false false false  EN-US X-NONE X-NONE                                                                                /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-parent:""; mso-padding-alt:0mm 5.4pt 0mm 5.4pt; mso-para-margin-top:0mm; mso-para-margin-right:0mm; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0mm; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;}


texts:
Its been suggested that i ask this question again, but perhaps worded differently than how to Bulk load multiple shapefiles into PostGIS.

I'm new to postgis and sql but i want to use postgis as a slave (for the time being) to ArcSDE. Therefore what i'm after is some help in woking out how i might go about batch uploading ArcSDE data into PostGIS every night.

I can produce a python script to export ArcSDE data into SHP nightly, but i'm then not sure how to then batch upload the exported SHP files into PostGIS, overwriting those that already existed in postgis all as an automative task (batch file i guess).

My grand plan is to replace ArcSDE/ArcGIS in time with PostGIS, QGIS and GeoServer or MapServer.


texts: Transfer OpenLayers map from one pc to another

texts: I have a following question, I created a web application - I used geoserver to create an openlayers map. As a sever I was using apache tomcat. If i want to run this server on different machine, what files/settingd I would have to transfer!? I just installed everything on different machine, for map however I can see zoom buttons and stuff like that- but there is no map... Have anyone done it before? Many thanks!


texts: How to get sum of table column values into Python variable?

texts: Im creating a script to calculate some new fields in Arcgis10.1 using the arcpy library. I need to sum the total of a  table column in order to calculate a new field. I wanted to ask if it is possible to store all the values in an array so i can get the total sum and use the variable in the new field calculation?


texts: How to configure ArcGIS Server wms to show images in a popup?

texts:
I am using ArcGIS Online to host an online webapp showing a point layer. The point layer comes from an ArcGIS for Server 10.3.1 wms layer. In the attribute table is a field which has a URL pointing to an image which is accessable over the internet. At the moment arcgis online can show the attribute table of the wms including the path to the image as text. I obviously want the pop-up to show the image and not the path.

Is this possible with a wms layer through ArcGIS Online? I don´t seem to be able to configure the popups for wms layers.


texts:
I was looking for an equal area projection of Antarctica, but it seems that the Lambert Azimuthal Equal Area (https://epsg.io/3974 , also called 102020 by ESRI) is deprecated because it is not a "true" equal area projection.

Is there any "equal area" projection that I could use as a standard for the South Pole ? If not, what are the possible workarounds ?


texts: How to create a valid QgsVectorLayer from delimitedtext?

texts:
I am having trouble loading csv files into layers using QgsVectorLayer().

I know this looks like a repeat, but I have carefully read

Create a script to add delimited text layer in QGIS

and

http://hub.qgis.org/issues/7491

but still cannot get it work.

An example of my data file, test.csv:

Index,y,x
0,37.7646618,-122.4960858
1,37.777494,-122.416311
2,37.717707,-122.3997056
3,37.732284,-122.498118
4,37.749998,-122.392333

My code:

import os
import urllib

import pathlib
from qgis.core import QgsVectorLayer

local_path = 'C:\dev\FCMS_conflation\data\TMC_nodes.csv'
node_layer = 'test'

abspath = os.path.abspath(local_path)
params = {'delimiter': ',',
          'decimalPoint': '.',
          'xField': longitude,
          'yField': latitude}

uri = "%s?%s" %(pathlib.Path(abspath).as_uri(), urllib.unquote(urllib.urlencode(params)))

layer = QgsVectorLayer(uri, node_layer, "delimitedtext")

The formatted URI looks like:

[] uri
>>> 'file:///C:/dev/FCMS_conflation/data/TMC_nodes.csv?decimalPoint=.&delimiter=,&xField=longitude&yField=latitude'

I have tried many variations of the parameters, including the crs and type. But no matter what I try, I cannot create a valid layer.

[] layer.isValid()
>>> False

I have verified that I can add the file using the QGIS gui. I even tried using the uri provided by layer.metadata from within the Python plugin.

I am using QGIS 2.10.1 on Windows 7 64-bit machine.


texts: Openlayers - Many broken tiles with vmap WMS in EPSG:900913

texts:
I would like to use the vmap WNS (http://vmap0.tiles.osgeo.org/wms/vmap0) in an OpenLayers map. I encounter many broken tiles (pink) when using the srs: EPSG:90013 contrary to EPSG:4326 and that at every zoom level.

I would like to know what could be the cause(s), and if it's a problem on the server side or on the client side.

  map = new OpenLayers.Map('map',
            { projection: new OpenLayers.Projection("EPSG:900913") });

  openL = new OpenLayers.Layer.WMS( "OpenLayers WMS",
                "http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: ['basic','stateboundary','coastline_01'],
                                    srs: 'EPSG:900913',
                                  isBaseLayer: true
                                  });
  map.size = new OpenLayers.Size(1000,800);
  map.addLayer(openL);
  var bounds = new OpenLayers.Bounds.fromArray([-180.0, 90.0, 180.0, -90.0]);
  map.zoomToExtent(bounds.transform(source,dest));


texts: Creating a simulation of how people moving around a site

texts:
I am working on a project aiming to create a geographic simulation for how people interact around a site.

Situation: There are x people in an enclosed area (such as a zoo). There are y locations to visit (attractions).

Scenarios: I want to simulate how busy each location would get with the following decision-making approaches:

When no location set, person goes to the next closest unvisited location
When no location set, person goes to random unvisited location
When no location set, person goes to recommended location (from app, interactive sign, etc)

Outcome: I want to know what leads to the best overall situation. In my case, I want to reduce overcrowding.

Is there any open source software, approaches I should consider for modeling this? I would prefer to do this in Python, though am open to any other options.


texts: Converting from GraphicsContainer to Polygon Feature

texts:
I have a problem with ArcObjects trying to convert a graphics container filled with segments into a polygon to insert into a feature class. In order to make the jump from a graphics element to a polygon, I believe I have to go from a element to a segment collection that can be inserted into a feature class.

My routine can insert the segments, but the feature class creates a polygon that is missing segments from the beginning or end of the object chain.

This is code I have worked up so far:

public void FinalizeObject(IFeatureLayer layer, IGraphicsContainer graphicsContainer)
    {
        ISegmentCollection segmentCollection = new PolygonClass() as ISegmentCollection;
        IPolygon polygon = new PolygonClass();

        try
        {
            graphicsContainer.Reset();
            IElement element = graphicsContainer.Next();

            while (element != null)
            {
                IGeometry geometry = element.Geometry;
                ISegmentCollection tempClass = new PolygonClass() as ISegmentCollection;
                tempClass = geometry as ISegmentCollection;

                if (tempClass != null && tempClass.SegmentCount > 0)
                {
                    for (int x = 0; x < tempClass.SegmentCount; x++)
                    {
                        ISegment segment = tempClass.Segment[x];
                        segmentCollection.AddSegment(segment);
                        segmentCollection.SegmentsChanged();
                    }
                }
                element = graphicsContainer.Next();
            }

            IFeatureClass featureClass = layer.FeatureClass;
            IFeature feature = featureClass.CreateFeature();
            feature.Shape = (IPolygon)segmentCollection;
        }
        catch (NullReferenceException nre)
        {
            MessageBox.Show(nre.ToString());
        }
    }

What am I missing?


texts: R equivalent of ArcMap split by Attributes?

texts:
I have a shapefile of 50 polygons. I've read it into R. Now I want to use R to export 50 shapefiles, one for each polygon. This seems like an intuitive application of apply. But I'm having a devil of a time doing it.

I tried a for loop (like Splitting vector layer in R).

STNCODES <- unique(ptsbuf_400@data$STNCODE)
for (i in 1:length(STNCODES)) {
  tmp <- data[ptsbuf_400@data$STNCODE == STNCODES[i], ]
  writeOGR(tmp, dsn=getwd(), STNCODES[i], driver="ESRI Shapefile",
           overwrite_layer=TRUE)
}

I get the following error:

  Error in data[ptsbuf_400@data$STNCODE == STNCODES[i], ] :    object of
  type 'closure' is not subsettable

This seems to be the cause of the error, but I'm at a loss how to fix it:

  data[ptsbuf_400@data$STNCODE == STNCODES[i], ]

Amtrak station data here

Example using SF works--likely there is some difference between the spatial object generated by readOGR/writeOGR and read_sf and write_sf--the latter seems to be a vector, while the sp object is not?


texts: PyQGIS get the GetCapabilities-URL of a tile Layer

texts:
I want to extract the information for GetCapabilities-URL, GetMap-URL and GetFeatureInfoUrl, from a QGIS Tile Layer, using PyQGIS:

The only way I found yet, is:
for layer in QgsProject.instance().mapLayers().values():
    print(layer.htmlMetadata())

and then use a htmlparser. But I'm pretty sure there is a easier way and I couldn't find it.


texts: What's the difference between CRS 4326, CRS 4978, and CRS 4979?

texts:
CRS 4326, 4978, and 4979 are all based on WGS84.

4326 is called "geographic 2D"
4978 is called "geocentric"
4979 is called "geographic 3D"

What are the differences between these three?

And why are we using "geographic 2D" (i.e. CRS 4326) for the coordinates?


texts: Constrain dragging of a marker to a polyline in Leaflet?

texts:
Is there a way to constrain a marker so that when it is dragged, it moves along a given polyline in Leaflet JS?

In my page I have route that is presented as a Polyline and a Marker.  I want to be able to drag the marker along the line to be able to display information about that part of the route.

Looking at the documentation here, it is not clear how I would go about that:

https://leafletjs.com/reference-1.6.0.html#marker

Note, I am using leaflet by means of vue2leaflet, though a solution that works for standard leaflet JS would be okay.

The vue 'template':

      <l-map
        class="leaftlet-map"
        :zoom="map.zoom"
        :center="map.center"
        @update:zoom="zoomUpdated"
        @update:center="centerUpdated"
        @update:bounds="boundsUpdated"
      >
        <l-tile-layer :url="map.url" :attribution="map.attribution" />
        <l-marker
          v-if="positionMarker"
          :lat-lng="positionMarker.center"
          draggable
          @move="markerMoved"
        />
        <l-polyline
          v-if="polyline.latlngs && polyline.latlngs.length > 0"
          :lat-lngs="polyline.latlngs"
          :color="polyline.color"
        />
      </l-map>


texts: Problem with arcpy.ValidateFieldName and unicode characters?

texts:
I am having problems with the arcpy.ValidateFieldName function in combination with unicode characters. I want to add a field to a shape field. The field name is not allowed to be bigger than 10 bytes (or at least I think so), but ValidateFieldName cuts it off at 10 characters. Since a unicode character is not necessarily one byte big, this causes problems.

Consider these three examples:

#Path to an existing shape file.
file = r"C:\path\file.shp"

#This works. The name is cut after 10 characters to "abcdefghij"
name1 = arcpy.ValidateFieldName("abcdefghijklmnop", file)
print name1
arcpy.AddField_management(in_table = file, field_name = name1, field_type = "TEXT")

#This works. The name is unchanged (since it is less than 10 characters)
#ArcMap accepts it since it is not larger than 10 bytes.
name2 = arcpy.ValidateFieldName("äbcdefghi", file)
print name2
arcpy.AddField_management(in_table = file, field_name = name2, field_type = "TEXT")

#This does not work. The name is unchanged, since it is exactly 10 characters.
#ArcMap does not accept it since it is larger than 10 bytes (?).
name3 = arcpy.ValidateFieldName("äbcdefghij", file)
print name3
arcpy.AddField_management(in_table = file, field_name = name3, field_type = "TEXT")  #19

The third examples gives me this error:

  Runtime error  Traceback (most recent call last):   File "", line 1, in    File "C:\validate.py", line 19, in      arcpy.AddField_management(in_table = file, field_name = name3, field_type = "TEXT")   File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\management.py", line 3200, in AddField     raise e ExecuteError: ERROR 999999: Error executing function. The Field type is invalid or unsupported for the operation. Failed to execute (AddField).

Strangely enough, it still adds the field but with the name "äbcdefgh_1", even though the value of name3 is "äbcdefghij".

The documentation has this to say about ValidateFieldName:

  Takes a string (field name) and a workspace path and returns a valid field name based on name restrictions in the output geodatabase.

Would I be right to say that this is a bug, since the value returned in the third example is in fact not a valid field name?

Can I somehow make this work without errors? I need to be able to take the name of a field from user input and somehow make sure it get turned into a valid name.

Why is the error message complaining about the field type, even though "TEXT" should be an OK field type?

EDIT: This seems to be a bug with ArcMap. If I add the fields from ArcCatalog instead of with Python, I get a similar behavior.


texts:
I found an script on https://community.esri.com/blogs/dan_patterson/2016/09/01/distance-calculations-using-the-field-calculator but the script is giving the azimuth to the next Objectid point
and what I really need is to get the azimuth from the last Point (based on point_m) placed on azimute1 Field and the azimuth to the next point placed on azimute2 using two codes on field calculator to do so. A personal Geodatabase with the point shape and the reference path line can be found here:Help.mdb.

x0 = 0.0
y0 = 0.0
angle = 0.0
def angle_between(shape):
global x0
global y0
x = shape.centroid.X
y = shape.centroid.Y
if x0 == 0.0 and y0 == 0.0:
    x0 = x
    y0 = y
    return 0.0
radian = math.atan2((shape.centroid.Y - y0),(shape.centroid.X - x0))
angle = math.degrees(radian)
x0 = x
y0 = y
return angle
angle_between(!Shape!)


texts: Plotting an EIA shapefile in Google Maps with R?

texts:
I'm trying to plot a EIA shapefile onto Google Map. I have a code working with the map function but can't get it to work with the ggmap function.  Where am I going wrong?

Working code:

library(maps)
map("state")
shapLocation<- "C:/shapfile/shalegasbasin/"
pcontorta <- readShapePoly(paste(shapLocation,"US_ShaleBasins_EIA_May2011.shp",sep=""))
plot(pcontorta, add=TRUE,  col=adjustcolor("black", alpha.f = 0.6),  border=FALSE)

shapefile from: http://www.eia.gov/maps/layer_info-m.cfm

Changed code to:

map <-get_map(location = "united states",zoom = 4,  filename=outFiles)
ggmap(map)

WGS84 <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0")
shapLocation<- "C:/Users/jecrosbie/Documents/Oil Weekly/shapfile/shalegasbasin"
data.shape<-readOGR(shapLocation,, layer= "US_ShaleBasins_EIA_May2011")
data.shape<- spTransform(data.shape, CRS("+proj=longlat +datum=WGS84"))
data.shape<-fortify(data.shape)

map <- map + geom_polygon(aes(x=long, y=lat, group=group), fill='grey',     size=.2,color='green', data=data.shape, alpha=0)
map

output error:
.............
[68,] "#A7C8FD" "#A7C8FD" "#A2C4FC" "#A2C4FC" "#A2C4FC" "#A2C4FC" "#8CA488"
  [69,] "#A7C8FD" "#A7C8FD" "#A2C4FC" "#A2C4FC" "#A2C4FC" "#A2C4FC" "#8CA488"
.............


texts:
My project specifications are as below:
utilise geodetic and shift parameters between WGS84 and specified datum (ED50), local projection (UTM 31N, CM 3 East) and transformation (EPSG1613) for all positioning requirements....

I am being asked to convert some supplied grid coordinates into LAT / LONG.
Using some internet software I input the EASTINGS & NORTHINGS and confirm the projection as UTM Zone 31N(ED50), when transferring to geographic should my datum remain ED50 or do i need to use WGS84?


texts: Coordinate System shows up incorrect after converting a shapely object to a shapefile

texts:
I am trying to convert a simple point object created using shapely to a shapefile using fiona as instructed in this post. I pretty much followed line by line except that I changed the crs as I need it in another coordinate system.

The code I used:

##Creating the point

    o = Point(-75.478003, 40.603155)
    o

##Convert the point to shapefile using code from @Mike T :

    from shapely.geometry import mapping
    import fiona

    schema = {
        'geometry': 'Point',
        'properties': {'id': 'int'},
    }

    with fiona.open('L:\lvpcgis\BowenLiuTemporary\ExtendLinesToLayer\my_shp1.shp', 'w', 'ESRI Shapefile', schema,
    crs=bldg.crs) as c:

        c.write({
            'geometry': mapping(o),
            'properties': {'id': 1},
        })

The only thing I changed here is crs by specifying crs = bldg.crs

bldg. crs
{'proj': 'lcc',
 'lat_1': 39.93333333333333,
 'lat_2': 40.96666666666667,
 'lat_0': 39.33333333333334,
 'lon_0': -77.75,
 'x_0': 600000,
 'y_0': 0,
 'datum': 'NAD83',
 'units': 'us-ft',
 'no_defs': True}

After running the code, I get a point shapefile my_shp1. However, when I add it in ArcGIS to check its accuracy, it shows up at the wrong location with lon, lat of 84.6941252°W 39.1210089°N with a projected coordinate system of "Lambert Conformal Conic" and geographic coordinate system of EPSG:4269.

I realize I must have somehow the coordinate system somehow but I just don't know where.

And it'd be better if there is a better way to convert shapely object to a shapefile.


texts: Not allowed to load local resources ASP NET MVC

texts:
var wmts = L.tileLayer('E:/Mapnik/{z}/{x}/{y}.png', {
wmts: true,
    });
    wmts.addTo(map);

I am trying to load the map with asp.net mvc, but I get this error. (Not allowed to load local resources ) what could be my fault ?

I tried but it gives the same error


texts: Measuring volume using DSM instead of point clouds in Pix4D

texts:
I've go a point cloud generated in the Pix4D software from about 90 aerial images. I am trying to measure piles of coal and have found that using the volume measuring tool on the point cloud model generated can be quite inaccurate. This is because of issues such as multiple outlying points appearing above a coal pile, which then introduces artifacts like spikes. This then leads to inaccurate volume measurement of such piles.

Is it therefore possible to use the DSM (how do we obtain in from within Pix4D?) to measure volume instead, as it has the effect of smoothing out such spikes and creates a homogeneous surface?


texts: Error opening feature class of geodatabase in ArcGIS for Desktop?

texts:
I have a problem. Whenever I try to create, edit or delete feature classes in ArcGIS geodatabase it gives me an following error: "Error opening feature class." and "Could not add the specified data object to the map."

When I try to open it with QGIS (2.10.1) it is entirely ok and I can even export it as a shapefile and then open it in the ArcMap and it is ok aswell. I have been searching on the internet a lot but I haven't been able to find a solution to this problem anywhere.

I should probably add that it happens with EVERY geodatabase, even if I create a brand new one so I don't think its because the databases are corrupted; also I am using ArcGIS for Desktop Advanced with a school license (verisons 10.3.1 and 10.2.2).


texts: Where is QGIS installation path in Ubuntu

texts: I can't find the QGIS installation path in ubuntu 12.10


texts: How to convert a raster file to .asc without losing spatial reference in ArcMap10.5

texts:
I am trying to convert several raster files (some with continuous and some with categorical data) into .asc files.

I have used the "Raster to ASCII" tool, but when I click on properties of the newly created file the spatial reference is lost.
I tried to "define projection" and to add a spatial reference in ArcCatalog, but so far nothing worked.

What am I doing wrong?


texts:
I've downloaded a raster with temperature projections by the Hadley Center (CIMP5) from here. It comes as a NetCDF file that I loaded onto QGIS 3.2.1. I then overlayed a shapefile with the borders of Peru, and it seems like the two maps are plotted separately:

How should I proceed to plot both the raster (NetCDF) and the shapefile on top of each other as they should? When I first loaded the raster in QGIS I got a message saying the CRS was undefined, but I could not for the life of me find what the appropriate CRS is for these files in the website.

Following @Vince's suggestion, here are the extents of each of the two layers:


texts: How does changing the kernel density search radius affect the units expressed in the map legend?

texts:
I'm trying to understand how ArcGIS 10.1 handles kernel density values and how these values are reported in the legend.  For example, the following parameters were used for the KDEs in the attached figure:

Projection Info

Projection: UTM 17N
Linear Unit: M

KDE Tool Parameters

Output cell size: 0.01
Search Radius: 1m (left image) and 2m (right image)
Area Units: SQUARE_MAP_UNITS

I know cell size has no affect on the legend values.  Yet how does the search radius affect the legend values? For example, if the search radius = 1m, then the area = pi.  And if the search radius = 2, then the area = 4pi.  Does ArcGIS automatically scale this to the projection map units (e.g. 1 m^2)?  Specifically, what are the units displayed here?


texts: How do i get Street name (address) with pelias?

texts: I created a geocoding service using pelias. I add open street map data to Pelias and use it for addressing. When i search an address, the Pelias send me just point(poi) or Polygon features name but i want to get the address of the streets instead. How do i fetch the street names in pelias?


texts: How to copy data from one table to another using cursors?

texts:
I'm going to be as descriptive as possible.
I have a table (TA) with values which are null for some rows, filled out for others.
I have a table (TB) with the null values filled out.

Dec in TA is the shared value in TB (called Nulled in that table)

I can't do a table join because this would duplicate the amount of nulled columns in the first table.
The gist of what I want it to do is this: if CURR_TYPE (one of the columns) is null in TA, lookup its Dec value, go to TB, look for the same value under Nulled, copy TB's CURR_TYPE, and paste it onto TA's CURR_TYPE.

This is what I have so far, and I've tried variations on things I've found here, but I get lost with how to tell python to LOOKUP in another field, copy and

# Import arcpy module
import arcpy

# Local variables:
TA = "F:...\\TA"
TB = "F:...\\TB"
TLDisNull = arcpy.AddFieldDelimiters(TA, "SponsorOrganization") + " IS NULL"

#Update rows
with arcpy.da.UpdateCursor(TA, "CURR_TYPE", TLDisNull) as u_cursor:
        with arcpy.da.SearchCursor(TA, "Dec") as s_cursor1:
                for s_row in s_cursor1:
                        with arcpy.da.SearchCursor(TB, "Nulled") as s_cursor2:
                                for s_row in s_cursor2


texts: Coloring geojson/topojson tiled using geojson-vt by category

texts:
I am mapping polygon data that is tiled on the fly using geojson-vt and leaflet. It works great.

That said, I really need to be able to change the color of each polygon based on its category as stored in a data column (cat1, cat2, cat3, cat4). Right now I am able to define the color of the boarder (strokestyle) and fill (fillStyle), but only for the whole layer.

I have been able to create a fill color that is random using

ctx.fillStyle = 'hsl(' + 360 * Math.random() + ', 50%, 50%)';

How can I bring the category into the mix?

Is this possible, or do I have to utilize a different tiling solution if I want to display by category?


texts: GeoJSON, circlemarkers using Leaflet OverlappingMarkerSpiderfier plugin?

texts:
I am wondering if I can use the Leaflet OverlappingMarkerSpiderfier plugin with my circlemarkers.

I've loaded a GeoJSON file and added circlemarkers using;

var gj = L.geoJson(route, {
  pointToLayer: function (feature, latlng) {
    return L.circleMarker(latlng, geojsonMarkerOptions);
 },
 onEachFeature: onEachFeature,
 }).addTo(map);

I followed the OverlappingMarkerSpiderfier example but I cannot understand how to combine my circlemarkers with the plugin.

I am guessing that changing;

  pointToLayer: function (feature, latlng) {
    return L.circleMarker(latlng, geojsonMarkerOptions);

 }

to something like

oms.addMarker(marker);

(Leaflet OverlappingMarkerSpiderfier is a port of the original library for the Google Maps API)


texts: GEE ImageCollection.map() with multiple-input function

texts:
I have an Image Collection, I want to Calculate a Normalized difference and got this Function called ND
/////normalized Differense///////
function ND(Im,B1,B2){
var four = Im.select(B1)
var eight = Im.select(B2)
return eight.subtract(four).divide(four.add(eight)).copyProperties(Im);
}

this way I would call ND but miss the additional Arguments :
ImageCollection.map(ND)

this way I would get an error regarding the second argument of .map:
ImageCollection.map(ND,'B4','B8')

this way I will get "a is not a function":
ImageCollection.map((ND,'B4','B8'),)
ImageCollection.map([ND,'B4','B8'],)

I know there is a ".NormalizedDifference" Function, and I will use it. It's more of a general question
how do I map over an ImageCollection with a function that needs multiple inputs?


texts:
I know this is a newbie ArcPy question, but here is the deal:

While I'm inside ArcMap 10, the Python window gives me all output correctly, like this:

>>> arcpy.env.workspace = r"C:\uber.gdb"
>>> arcpy.ListDatasets("*","ALL")
[u'uberlandia_urbano', u'Idw_pop2006', u'Idw_pop2000']

But, if I open cmd window (Run > cmd) and type the exact same commands, it will give me an empty list as a result.

I'm pretty sure that the Python version used is the one tied up with arcgis, since I can import arcpy.

Any chance that arcpy does not work on the standard python console?


texts:
I need to merge 3 rasters into one, each raster is single banded and ranges from 0 to 1. The rasters overlap at some places. Below is how each raster looks like and how the output should look like using Raster Calculator or merged, however the result using syntax rastr1 * raster2* raster3 is that the output raster values ranges from 0 to 0 and the merge tools do not correct the output either.

I am using QGIS 3.8.


texts: Updating Field using similar Field w/ Update Cursor: Field does not populate

texts:
I'm pretty new to scripting with Python.

My code is intending to iterate through a list of feature classes within a GDB, creating the fields EF_Type and EF_Group, then calculating the field.  The values of 'EF_Group' will be dependent on the values of EF_Type (ex: the feature classes 'Local EOCs' and 'State EOCs' will both have the value of 'EOC' in the 'EF_Group' field.

I created an update cursor to iterate through the feature classes and update the values of 'EF_Group.'  The script runs without an error message, but  when I open the attribute tables within Pro, 'EF_Group' remains NULL.

Code:

    arcpy.AddField_management (fc, 'EF_Type', 'TEXT')

    EFType = arcpy.CalculateField_management(fc, 'EF_Type', '"' + name + '"') #Renames field EF_Type to the first 2 words pulled using the split format tool
    arcpy.AddField_management (fc, 'EF_Group', 'TEXT')

    fields= ['EF_Type', 'EF_Group']

    with arcpy.da.UpdateCursor(fc, fields) as cursor: #Update cursor will use 1st field (EF_Type) to build 2nd field (EF_Group)
        for row in cursor:
            if fields[0] == 'Local EOCs' or fields[0] == 'State EOCs':
                fields[1] = 'EOC'
                cursor.updateRow(row)
            elif fields[0] == 'Fire Stations':
                fields[1] = 'Fire'
                cursor.updateRow(row)
            elif fields[0] == 'Public Schools' or fields[0] == 'Private Schools' or fields[0] == 'DayCare Centers' or fields[0] == 'Colleges Universities':
                fields[1] = 'School'
                cursor.updateRow(row)
            elif fields[0] == 'UrgentCare Centers' or fields[0] == 'Nursing Homes' or fields[0] == 'Hospitals Intersect':
                fields[1] = 'Care'
                cursor.updateRow(row)
            elif fields[0] == 'LawEnforcement Locations':
                fields[1] = 'Law'
                cursor.updateRow(row)


texts: How to get a distinct pair of column values based on minimum of another (computed) column?

texts:
I have two tables with point geo data, one (sfc_obs) with weather stations (names), one (smos_grid) with satellite pixels (dggs), and I'm trying to find which dgg is closest to each name using ST_Distance(). I have no trouble getting the distances and sorting, but I'd like to get just the closest match for each name. I think I need to use a GROUP BY OR DISTINCT clause, but everything I've tried has resulted in errors (e.g. GROUP BY name -> "column smos_grid.dgg must appear in the GROUP BY clause...") or resulted in the whole table (below) spit back at me. I have a feeling that one of the related questions may have the answer, but I haven't been able yet to successfully adapt any of them to my situation. I want the distinct pair of name and dgg with the minimum distance. I could (and probably will, in the meantime) use another language to parse the current output, but I'd like to know what the real solution is.

Base query: SELECT sfc_obs.name AS name,smos_grid.dgg AS dgg, ST_Distance(sfc_obs.geom_utm, smos_grid.geom_utm) AS distance FROM sfc_obs,smos_grid ORDER BY name,distance;

Result:

      name       |  dgg   |     distance
-----------------+--------+------------------
 ALGONA          | 196466 | 7204.37098751625
 ALGONA          | 196465 | 8842.89089934474
 ALGONA          | 196978 |  11010.118792918
 ALGONA          | 195953 | 14495.8081360579
 ALGONA          | 196979 |  16646.802911716
 ALGONA          | 195952 | 20472.9039241652
 ALGONA          | 196977 |  21241.154673217
 ALGONA          | 195954 | 21880.6543096356
 ALGONA          | 196467 | 22540.4472393787
 ...
 ALGONA          | 212884 | 457182.275288169
 ALGONA          | 213907 | 463002.906164119
 ALGONA          | 213396 | 463254.000442818
 ALGONA          | 213908 | 469680.703686122
 ALGONA          | 213397 | 470914.550849778
 ALGONA          | 213909 | 476963.651054924
 Ames            | 202105 | 3626.03192856493
 Ames            | 201592 | 10236.1588500566
 Ames            | 201593 | 13579.2271071596
 Ames            | 202104 | 15430.7774139333
 Ames            | 202106 |  16638.577453568
 Ames            | 202618 | 17402.7790010433
 Ames            | 202617 | 18506.8761326297
 ...

Desired result:

      name       |  dgg   |     distance
 -----------------+--------+------------------
 ALGONA          | 196466 | 7204.37098751625
 Ames            | 202105 | 3626.03192856493
 ...


texts: Error while trying to replace a opened csv file with the newone in my plugin

texts:
My plugin does some basic geoprocessing functionalities and write the output as csv file. What i want is when i open some already writed output csv file in a writable mode and try to replace the same csv file for the newoutput, i got an error which is attached below. Code is also attached for reference.

def writeToFile(self, lsOfCities, filePath):
    fileCSV = open(filePath, "w")

    for i in lsOfCities:
        fileCSV.write(i)
        fileCSV.write(",")
        fileCSV.write("\n")
    QMessageBox.information(self.dlg, "Number of Cities Near", str(len(lsOfCities)) + " cities are written to "+filePath)
    fileCSV.close()
    self.dlg.close()

I want my plugin to show a warning message instead of below error.


texts: Contour Extraction from Scanned Raster Image in Qgis

texts:
I have a scanned raster image containing contours and rivers. I am trying to use qgis to extract these contour and river polylines for analysis. As a start I was thinking of the following process based on the properties of the file:
 - making image bitonal
 - sharpening of narrowing scanned lines
 - connecting broken lines
 - removing unwanted scanned text
 - converting remaining lines to contour lines

can someone assist me on how the above can be accomplished in Qgis?


texts: Data format for 'Create Space Time Cube From Defined Locations' in ArcGIS

texts:
I'm trying to figure out the way to structure data for Create Space Time Cube From Defined Locations tool in ArcGIS Pro 2.3 (docs). My raw data sits in text files and is handled in R. I'm working with monthly events in set of locations (that do not change. I've tried help and tutorials online but still fail to understand what the desired input data for this tool is.

Should that be a shape file / feature class with one row per location and columns of attributes representing time? Or does each location x time combination require separate row in dataset? In what format should I store my dates to be readable by Arc?


texts: Displaying a GeoServer Map from a Java Mobile Application

texts:
How can I display a Map generated by GeoServer from a Java Mobile Application?

I would like to display it inside a Java App instead of a android application. Is this possible?


texts: Local Maxima (or Pour Point) Pixel Value extract in Raster

texts:
I am doing watershed & pourpoint using python GDAL. I have calculated

Fill,
Flow-Direction &
Flow-Accumulation

using Python & GDAL.

The next is to get Pour Point in certain window Size. Please Guide me accordingly using python GDAL.


texts: Calculate area within Python script in ArcMap

texts:
I am trying to calculate the area of a polygon within my Python script. I create a new polygon from merging two together, and I'd like to add the area of the resulting polygon to a field in the output file. The polygon is stored in a regular shapefile, and is projected. Area preferably in map units.

I would have thought this to be a quite common and simple task, but despite a lot of Googleing I have been unable to find a working solutions so far.

I was planning on using arcpy.updateCursor to insert the value once it's calculated (there's only one feature in the FC at this stage), so easiest is if it can be returned as a variable. Any alternative solution that accomplishes the same task (getting the area value into correct field) will also work.

I have also tried the Field calculator from Python. Modified from the help pages I thought the following would work, but so far no luck.

arcpy.AddField_management(tempPgs, "Shape_area", 'DOUBLE')
exp = "float(!SHAPE.AREA!.split())"
arcpy.CalculateField_management(tempPgs, "Shape_area", exp)

Running ArcGIS Basic 10.1 SP1 with Python 2.7 on Windows 7.

Relevant parts of my current code looks like this:

#/.../
arcpy.Copy_management(inpgs, outpgs)
arcpy.AddField_management(outpgs, 'Shape_area', 'LONG')
fields = AM.FieldLst(outpgs)

#/.../

# Identify and search for shapes smaller than minimum area
where1 = '"' + 'Shape_Area' + '" < ' + str(msz)
polyrows = arcpy.SearchCursor(inpgs, where1)

for prow in polyrows:
    grd1 = prow.GridID   # GridID on the current polygon
    grd2 = nDD.get(grd1) # GridID on the polygon downstream

    # Update features
    if grd2
        geometry1 = prow.Shape
        geometry2 = geometryDictionary[grd2]

        # Update temporary features
        arcpy.Merge_management([geometry1, geometry2], tempMerged)
        arcpy.Dissolve_management(tempMerged, tempPgs)

        fds = AM.FieldLst(tempPgs)

        for field in fields[2:]:
            arcpy.AddField_management(tempPgs, field, 'DOUBLE')

        for fd in fds[2:]:
            arcpy.DeleteField_management(tempPgs, fd)

        exp = "float(!SHAPE.AREA!.split())"
        arcpy.CalculateField_management(tempPgs, "Shape_area", exp)

        # Append them to output FC
        try:
            arcpy.Append_management(tempPgs, outpgs, "TEST")
        except arcgisscripting.ExecuteError:
            arcpy.Append_management(tempPgs, outpgs, "NO_TEST")

    elif ...

    else ...


texts: How to execute gp.execute ArcSDE tool in C#

texts:
So I created an ArcGIS 10 toolbox in ArcSDE and added a tool to it.
There are enough examples out there on how to execute a tool.tbx that resides outside SDE or GeoDB.
But in C#, how do you use gp.execute on a tool that resides within ArcSDE?
thanks!


texts: Shapefiles added through GeoServer REST interface contains no features

texts:
I'm using a put request to create a datastore under a workspace, and automatically register the included feature type in a new layer.

The put request succeeds, and I can see the datastore points to a real location on the filesystem, but the datastore contains no features (even though it clearly does when imported into ArgGIS).

Has anyone run into this issue before?

tl;dr

$this->guzzleClient->request('PUT', 'workspaces/' . $preparedTypeTitleStr . '/datastores/' . $preparedResourceTitleStr . '/file.shp?configure=all&update=overwrite', [
    'headers' => ['Content-Type' => 'application/zip'],
    'body' => $shapefile_zip_body,
    'timeout' => 0
]);

This succeeds and the datastore is created and points to:

file:/opt/tomcat/webapps/ROOT/data/data/Map_resource_vector_based_Map_Layer/blablablablabla/

However a call to:

$workSpaceLayers = json_decode($this->guzzleClient->request('GET', 'workspaces/' . $preparedTypeTitleStr . '/datastores/' . $preparedResourceTitleStr . '/featuretypes.json', ['headers' => ['Accept' => 'application/json']])->getBody()->getContents());

returns an empty array for feature types.

I've done this before and the feature type(s) are registered automatically and made available as layers (which I can ultimately wrap into a layer group with some included styling information).

Can anyone tell me what's going wrong? Theres no errors being generated, the datastore is simply empty.


texts:
I installed gdal from source using steps from this answer https://gis.stackexchange.com/a/21739/60378 (ommiting first line sudo apt-get install build-essential python-all-dev as it did not work for me). Everything went without errors. When i try to import osego or gdal it gives me error: undefined symbol: GDALSetRasterUnitType

    >>> import gdal
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/GDAL-1.9.0-py2.7-linux-x86_64.egg/gdal.py", line 2, in <module>
    from osgeo.gdal import deprecation_warn
  File "/usr/lib64/python2.7/site-packages/GDAL-1.9.0-py2.7-linux-x86_64.egg/osgeo/__init__.py", line 21, in <module>
    _gdal = swig_import_helper()
  File "/usr/lib64/python2.7/site-packages/GDAL-1.9.0-py2.7-linux-x86_64.egg/osgeo/__init__.py", line 17, in swig_import_helper
    _mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: /usr/lib64/python2.7/site-packages/GDAL-1.9.0-py2.7-linux-x86_64.egg/osgeo/_gdal.so: undefined symbol: GDALSetRasterUnitType

Server is using fedora core 14, which I cannot upgrade right now. What could be wrong? Is there any simpler gdal installation method?


texts: Why do I get a NameError for QDomDocument when attempting to programmatically load a template in the QGIS Python console?

texts:
I'm trying to work through this answer in the QGIS (2.14) Python console to understand, ultimately, how to iterate over layers and print them with a template.

When I run the following code block.

I get a NameError that QDomDocument() is undefined.

myComposition = QgsComposition(myMapRenderer)
myFile = os.path.join(os.path.dirname(__file__), 'MMR_Template.qpt')
myTemplateFile = file(myFile, 'rt')
myTemplateContent = myTemplateFile.read()
myTemplateFile.close()
myDocument = QDomDocument()

Possibly related (can split into a separate question) I also get the warning DeprecationWarning: QgsComposition constructor is deprecated but can find nothing about this warning on Google.


texts:
I have a shape file and I want to add a layer which includes the track points (x coordinate , Y - coordinate for the attribute table). I need the tracks for identifying the buidlings and for calculations.

This is what it looks like.

And the following picture shows what I need, the red dots are the track points. I got them from OSM by adding tracks and track points out of a GPX. The other file wasn't a GPX and I couldn't select adding track points as I added this layer.


texts: When should I be calling a 'rectangular grid of pixels' a raster or an image?

texts:
Reading through GIS literature, it sometimes feels that authors use the two terms with a specific meaning in mind. I always treat the terms interchangeably. Am I wrong?

Read the first line in the link. See how it says an image service provides access to raster (and image), hinting at different meanings for the two terms.


texts: When I attempt to add XY Data to my map the lat and lon coordinates are projected in meters for example (-82, 34) becomes -82 meters and 34 meters. The GCS and Projection for both the new layer and the data frame are WGS 1984 Web Mercator (auxiliary sphere). Why is the new layer's XY Data displaying incorrectly?


texts:
I have 14,033 points representing the location of some weather stations across the 36 states in Nigeria. I want to use an ArcGIS Desktop sampling tool to implement a random selection of 200 points with minimum distance of 250 km between each point.

I don't seem to find an appropriate tool in ArcGIS Desktop to do that. I use ArcGIS version 10.5 and 10.6.


texts: How can the Planet Labs TMS be used with GDAL?

texts: How can Planet Labs' mosaic Tile Map Service (TMS) be used with GDAL like in the OpenLayers example? The API requires authentication and other specific settings.


texts: Showing images linked with corresponding KMZ in QGIS

texts:
I have the master KMZ with the images that are linked to its corresponding placemarks, I can see the images of KMZ in Google Earth, but while loading in QGIS, I can't see the images.
So, how can I see the images of individual KMZ in QGIS?


texts: How to find coordinates of opposite vertices in a boundingbox

texts:
I have two sets of coordinates (in WGS84) which describes a rectangle
ontop a map (openstreetmap). The coordinates in this box are the bottom-left vertice and the top-right vertice.

Coordinates:

                LATITUDE    LONGITUDE
bottom-left:    53.869605   9.3191648
top-right:      69.4197068  29.7990631

However I need to find out the correct coordinates on the opposite
vertices, top-left and bottom-right.
The naive approach I took initially (knowing nothing about this) was
to simply swap the lat,lon coordinates as one might do in a regular 2d plane.

To get this:

                LATITUDE    LONGITUDE
top-left:       69.4197068  9.3191648
bottom-right:   53.869605   29.7990631

This does not seem to work though, because the new box becomes a bit squashed compared to the original box, which I figured ought to be due to the curvature of the earth.

So how could I find out these two opposite vertices (top-left, bottom-right)? preferrably in python.

As per comment below here are the images showing whats going on:
If one looks closely you can see that the radar spheres are distorted.

top-left, bottom-right

bottom-left, top-right


texts: Connecting ComboBox and pushButton for QGIS plugin

texts:
I am creating a QGIS plugin.
I have added a combo box and a push button in the plugin.
The issue that I am facing is that I want the ComboBox to either allow selection of layers from the layers loaded on the project or when the user clicks the pushButton it should navigate to the directory and the ComboBox should be filled with the layer selected from the pushButton.
Both work individually, but I can't seem to get them working together.
I am a beginner in Python, so please let me know if there is anything very obvious that I have missed out on.
I am giving my code below. When I run it I get the error -

  TypeError: native Qt signal is not callable

def select_input_raster(self):
  filename, _filter = QFileDialog.getOpenFileName(
    self.dlg, "Select input raster ","", '*.tif')
  self.dlg.comboBox.currentTextChanged(filename)

def run(self):

    if self.first_start == True:
        self.first_start = False
        self.dlg = ComboBoxPushButtonDialog()
        self.dlg.pushButton.clicked.connect(self.select_input_raster)

    layerlist1 = ['<Select a raster layer>']
    layers1 = QgsProject.instance().mapLayers().values()
    for layer in layers1:
        if layer.type() == QgsMapLayer.RasterLayer:
            layerlist1.append(layer.name())

        #else layerlist1.append(select_input_raster())

    #Clear the contents of the comboBox from previous runs
    self.dlg.comboBox.clear()
    # Populate the comboBox with names of all the loaded raster layers
    self.dlg.comboBox.addItems(layerlist1)
    # show the dialog
    self.dlg.show()
    # Run the dialog event loop
    result = self.dlg.exec_()


texts:
I have points data,

e.g. p1,p5,p3,p6,p7 are the points of road-A, while p2,p4,p8,p9 are point of road-B. In database (PostgreSQL) points are in p1,p2,p3,p4,p5,p6,p7...

How can I make a route, by identifying every next point?

As points in database are not in order of route.


texts: I'm working on exporting a shapefile of contour lines as a DXF file so that  my colleague can use it in autoCAD. When they try to add the DXF file it doesn't keep the projection (NAD83 UTM zone 20) I assigned it when I exported it. I've tried using different projections and different methods to export the DXF (I've done the right click on the layer and "save-as" autoCAD, and I've done file > export as DXF). I'm using QGIS v 2.18.10 and I'm not sure which version of cad my colleague is using but I'm assuming it's a recent version.


texts: Add layer to existing geopackage not working in QGIS?

texts:
My organisation uses mainly ArcGIS and we have a need to share data with contractors. I recently introduced QGIS (because one of our application uses WKT to import geospatial data and QGIS makes the conversion of various formats to WKT very easy) so I started to look at the geopackage format and QGIS as a data sharing solution - we want to stop using shapefiles because of the column length limitations.

Using QGIS I can create a geopackage with a single layer using 'save as', read and edit the layer using QGIS, read it using ArcGIS however, if I try to add layers to the geopackage using DB Manager (as per How to add another layer to GeoPackage in QGIS?) I get an 'error 11 connection to database failed'. I definitely have a connection to the geopackage in DB Manager as I can preview the existing layer and run a query (i.e. select * from [layer]).

This seems to be a bug (https://hub.qgis.org/issues/14981) that is not scheduled to be fixed so I'm wondering if there are any other tools or plug-ins available so that we can add layers to a geopackage using QGIS?

I am using Windows 10, QGIS 2.14.9 and ArcGIS 10.4.

Note: While I can add a layer to the geopackage using OGR2OGR, I cannot get 'buy-in' from our contractors, who are field specialists not IT professionals, to use command line tools instead of a GIS.

Note 2: I have discounted using spatialite for now because QGIS does not handle spatialite data created with ArcGIS. (DB Manager results in an error: dbname='H:/Temp/SQLiteTesting/BaseData/ArcSpatialite/Aspatialite.sqlite' table="arccatTrees" sql= is an invalid layer - not loaded)


texts: Setting CRS automatically on Raster using QGIS?

texts:
I'm currently working with the Semi-Automatic Classification Plugin to help ID agricultural plots. However, when I attempt to set up the training I am given the error message.

  Error [61]: Projection error. Try to assign projection to raster
  /Users/User/Documents/University/Thesis/Map
  Layers/Rasters/orthophoto2015_1m.tif

The Raster is projected for EPSG 2039 ITM. Despite this, every time I load the Raster or save my work I am either asked to select a CRS, if one is not assigned as a default. I don't run into issues with training on rasters that have their own projection already.

In short, how do I set up a raster file so that it is automatically assigned a CRS without having to select one manually or have it set to that of the project?


texts: Add a column for the filename while batch loading many files in PostGIS

texts:
What would be the best way, with shp2pgsql, to add a column containing the name of the source file while loading many shapefiles in PostGIS?

raster2pgsql has a -F option for that.


texts: Calculating indices by Multiple polygons

texts:
Is there a way in QGIS to perform band math within each area defined by different polygons without clipping the rasters and performing calculations on each one?

I have a vector layer with several neighbourhoods and I would like to calculate a number of different indices for each area for several different image.

I am hoping for a tool like zonal statistics, but rather than getting things like min/max pixel values in each region I would like to calculate things like NDVI.


texts: Deleting variables from the Python Console in a programmatic way?

texts:
I often use the Python Console for running some lines of code and I also use some prints for checking the validity of the results.

If I run this sample code:

a = 2
b = 4
res = a + b
print res

it will print the value of the res variable in the Python Console. However, if I then close the script tab, the res variable is still there. This means that, if I type print res in the Python Console, it will still return the last stored value.

I know that I can type:

del res

from the Python Console for deleting it. In fact, if I then type print res, I get:

NameError: name 'res' is not defined

as expected, but this is useful only when dealing with one or two variables and if I remember the names of these variables.

After a few searches, I found these questions:

How to clear python console in QGIS?

Clearing Python Console in QGIS using Python Command

but their answers only explain how to clear the Python Console and not how to delete the variables.

Is there a programmatic way for deleting all the variables stored during the current QGIS session?


texts: Transform local polar coordinates to UTM

texts:
I have some field points disposed like the diagram below:

In this diagram, I know:

1) Point A UTM coordinates

2) Distance between A and B

3) Distance between B and C

4) AB azimuth

5) BC azimuth

I´d like to know how to calculate point C UTM coordinates, considering that points B and C can be located in any position in the cartesian plane.

The distances are below 100 meters.


texts: How to write SLD rules with data-defined symbol size and color?

texts:
I have shapefile with points. They are classified - Graduated colors. I made SLD file with ArcMap2SLDConverter. I have a task to manual edit SLD file to show symbol diameters relating to field Area.

I need to create one rule (for symbol COLOR) relating to one attributes ("Class" column), and second rule (for symbol SIZE) relating to other attributes ("Area" column) for the same geometry. So now I have points with rules for symbol colors, but I don't know how to edit my .sdl file to insert rules for symbol size considering they are related to other attribute than those rules for symbol colors.

I don't know how to have two rules relating to two different attribute columns for the same shapefile?

Can someone help me with that task?

Thank you.


texts: Is it possible to get full path for broken data source to repair broken data link?

texts:
This question links back to an old question of mine: Convert shapefiles in nested folder to geodatabase

I am attempting to find a permanent solution to fixing the broken maps, and in such a way that they can easily be fixed if the maps documents get broken again.

As stated previously, I have hundreds of map documents all with broken data sources. It is not feasible to use findAndReplaceWorkspacePaths because the data is in a multitude of nested folders, not kept in one folder or geodatabase.

To complicate things further, many of the shapefiles used have the same name, but are located in a different folders.

arcpy.mapping.ListBrokenDataSources returns a list of the names of the layers that have a broken data source in the map document, but only the name. Within the map document, if I click on the Source tab of the Layer Properties it shows the 'location' of where the data should be.

I have a copy of all the GIS data from the old computer, so ideally I would be able to do something like OldDataSource.replace ('n:/', 'c:/users/athom/oldGIScomputer/')

Is it possible to use python to get the full 'location' + 'name' of the data in a broken data source?

Does anyone have any suggestions?


texts:
I want the toolbox to prompt out a file select window so that user can select the file and get the path to be used in my Plugin.
Where do I start to code since I just have:
def run(self):
    """Run method that performs all the real work"""

    # Create the dialog with elements (after translation) and keep reference
    # Only create GUI ONCE in callback, so that it will only load when the plugin is started
    if self.first_start == True:
        self.first_start = False
        self.dlg = PalmCounterV2Dialog()

    # show the dialog
    self.dlg.show()
    # Run the dialog event loop
    result = self.dlg.exec_()
    # See if OK was pressed
    if result:
        # Do something useful here - delete the line containing pass and
        # substitute with your code.
        pass


texts: Opening the PyQGIS editor programmatically

texts:
I can open the console programmatically, using:

qgis.utils.iface.actionShowPythonDialog().trigger()

Is there a way to additionally open the console's editor (the window where you can enter multiple lines of code)?


texts: Using definition queries for scenario testing in ArcMap

texts:
I want to be able to run multiple scenarios in a typical ArcMap workflow. This will include making edits to feature classes, such as removing features, adding new features, or changing feature values in the attribute table.
Per scenario, I want to track these changes so that I can generate a report of what changes were made (what was added, removed, changed), as well as store those changes as a scenario (xml file?) that can be loaded in the future. This is where I think that definition queries can be used to some extent...
Is there a general setup for this type of workflow? The application that we have written in Python tests a single scenario and does not allow edits to the database. To test more than one scenario, a copy of the file geodatabase must be made before proceeding with further changes and re-testing the scenario outputs.
Edit:
This is how I imagine the scenarios will be represented...

Scenerio: Base
The user launches ArcMap and adds a feature from a prescribed file geodatabase.
|FID|NAME |TYPE      |
|  0|Metro|Commercial|

Here we have a feature with 1 object as the base scenario.

Scenerio: A
The user starts an editing session and adds an object.
|FID|NAME    |TYPE      |
|  0|Metro   |Commercial|
|  1|NoFrills|Commercial|

Scenario: A has two objects. The delta change between the Base Scenario and A is one object.

What I would like to be able to do is keep track of what was added, removed or changed in a Scenario so that I can "load" a scenario and assess the delta change between them.
Also, because I know what is contained in the Base Scenario, I can store the FID values that will form the basis of my definition query. Scenario A will have a different set of FID values for its definition query.


texts: How to create a searchbox in geoexolorer

texts:
Is there someone knowing how to create a searchbox in geoexplorer? On google there is very limited information about it. I work for a municipality and this would be the next step in developing our Webmap.

Help please!


texts: How to make a list of ESRI GRID rasters in Python

texts: Tipically, ESRI GRIDS are not defined by a file extension like for the .tif files, but they are stored in a info folder plus an extra folder corresponding to the name of the raster. Arcpy allows to return a list with the ListRasters function. What is the best way to do it in a python script?


texts: Deleting duplicated features with ArcPy?

texts:
I try to use this python code in order to delete duplicated feature which as the same xy coordinate of centroid (i created those fields with Calculated Geometry in the attribute table):

import arcpy
'''
first we create x center coordinate field (the same for y) in the attribute
table manually, then we will run this code.
'''
list1 = []
listToDeleteX = []
listToDeleteY = []
fc = r"G:\desktop\Project\lyr\polygon.shp"
# check the x coordinate
with arcpy.da.UpdateCursor(fc, "xCenter") as cursor:
    for row in cursor:
        list1.append(row)
        if list1.count(row)>1:
            listToDeleteX.append(row)

 # check the y coordinate
with arcpy.da.UpdateCursor(fc, "yCenter") as cursor:
    for row in cursor:
        list1.append(row)
        if list1.count(row)>1:
            listToDeleteY.append(row)

listToDeleteY.append(listToDeleteX)

in the end of the code i added the x list to the y list but i don't know how to delete the duplicated rows.

I work with arcGIS for Desktop so i don't have any extensions and i can't use the "arcpy.DeleteIdentical_management" tool.

This is the attribute table of the polygon layer:


texts: Is there any way to display a 3d building model as a layer under OpenLayers ? i have the building models drawn using Google sketchup , is that useful ?


texts: Using thematic layer for segmentation in eCognition?

texts: I have a thematic layer, i want to perform segmentation and classification only within the thematic layer,not in a whole image. how can i do it? I tried to segment the image after viewing the thematic layer in view setting and the thematic layer usage was enabled, but it was segmenting the whole image.


texts: Picking a value from another table in QGIS

texts:
I have two tables:
'TableA' has an auto incrementing "id"
'TableB' has a field that needs the "id" from 'TableA'
How do I default on update when a user updates 'TableB'? I need the maximum value from 'TableA'.
In SQL terms this would be:
select max(id) from tableA

How can I translate the above into QGIS language with the layer?


texts:
In MySQL Workbench 6.3 CE I created a table with some columns.
One of this columns is of data type 'BLOB' to insert an image.

Now i am looking for a way to export this table and import this table afterwards in Qgis to create a map of it.

If i am exporting the table to a 'CSV' file i lost my images...


texts:
I have a problem with QGIS digitizing advanced tool plugin.

I have a landcover-like shapefile. I have to perform some corrections on it, and I have to cut or split some polygons.

I want to insert some holes (that will be filled) in a polygon.
I found these instructions (http://docs.qgis.org/2.0/it/docs/training_manual/create_vector_data/topo_editing.html): "It allows you to take a hole out of a feature, as long as the hole is bounded on all side by the feature. For example, if you’ve digitized the outer boundaries of South Africa and you need to add a hole for Lesotho, you’d use this tool."
The problem is that I need to digitize a hole that is not completely bounded by a single polygon. (following the above example, I had to digitize Egypt from Africa shapefile. It is not completely included in Africa, but one of its side confines with the ocean).

How can I do that?


texts: How to access attributes from linked tables (QGIS 2.14.2 Essen)

texts:
I have one source shapefile like this:  It consist the geographical coordinates of weather stations:

And several attribute files, which contain the Temperature data of each date for several years

I managed to linked them through the ID (project properties/ Relations).

Now I want to access for example the Temperature from the weather station 3 at a specific date. With the attribute table I can see all the values, but I don't know how to query some values with the Field Calculator.
I can’t access the linked data.


texts: Parameters of the Muskingum-Cunge Model in HEC-HMS

texts:
I'm trying to simulate the flow of a river in HEC-HMS and for the routing model, I have chosen to use Muskingum-Cunge. In preparing the model, I used HEC-GeoHMS.

When I got to check the parameters for the routing method in HEC-HMS, it did not contain the necessary index flow, left and right roughness coefficients, and cross-section. How can the input for these be obtained?

I have the data necessary for the other required information, so they're not much of a problem. I already tried checking the steps I made in HEC-GeoHMS to find out what I forgot to do, but can't seem to find anything.


texts:
I'm trying to complete a Multi-Criteria Evaluation for an MSc assessment and am in the process of standardising my factor maps.  Unfortunately, my DEM layer (ASCII file) keeps changing from this:

To this:

The syntax used in Raster Calculator is: (“DEM” – 0) / (544 – 0) where DEM is the layer, 0 is the minimum values and 544 is the max value.

Has anyone come across this before? Does anyone know how to standardise it so the surface variation is still present?

I've done the same for Topographic Wetness Index but that's done ok (both layers are visualised the same)


texts: Help with error during raster conversion (translate>convert format)

texts:
A quick background.  I know very little of QGIS and have been simply using it as a way to convert .tif files.  The raster images I have are compressed using BigTiff compression that Autodesk does not like.  I have been successfully using the QGIS command Raster>Conversion>Translate(convert format).  The output file has a compression that Autodesk likes and life is good.  I simply select the input layer, the output file, and click ok.  I has worked great in the past.  The most recent time I have tried this on a few different files I get the following errors depending on the method.

If I select the input layer and only type a filename in the Output File box I get this "ERROR 4: Attempt to create new tiff file `flight1' failed: Permission denied".

If I select the input layer and then Browse to a location for the output file I get this "ERROR 1: MSGN driver has no creation capabilities."

Can anyone point me in the right direction.  I have been searching solutions for a while and cant quite figure it out.


texts: Aligning points or to changing/setting Y coordinate for all selected points using QGIS?

texts:
How to align points with QGIS like in CorelDraw. Align left, top etc?

I have some points and want to align them to top in one line.
I can change the Y coordinate of every point but it will take a lot of time.

Or is there a way to change the Y coordinate for selected points?

Any plugin?


texts: Using an image file as a placemark in qgis

texts:
I am making a map of sports clubs in London. I have each club's crest as image files (tiff) and want to make the placemark symbol using these images.

I know it's possible to upload images in the SVG format. The problem is I can't find a way of converting the tiff files to svg that gives satisfying results (crests are quite intricate at times).

Is there a way of adding tiff files (or png for that matter) as placemark symbols? Alternatively does anyone know of a satisfactory way of changing raster images to svg? Might there be an alternative way of doing this (an additional plugin maybe)?


texts: I have created an atlas for all countries in the world, and I would like to drop a pin to show the centre of the country (as attached). Is there a way to add these coordinates automatically such as in the picture below?


texts: How can I return z/x/y of all tiles with OpenLayers3 and export them as geojson or csv?

texts:
My custom tile layer:

var baseLayer = new ol.layer.Tile({
  source: new ol.source.XYZ({
    url: 'http://path/to/the/tiles/base/{z}/{x}/{-y}.png'
  })
})

How can I return z/x/y numbering for one tile (as an example) and for all tiles (as wanted result) with OpenLayers3 (it would be nice if I could get the result over console too, becuase I am trying to figure out how to use it) and export them as geojson or csv?


texts:
I have recently used Tilemill and I wish to implement it for dynamic tile rendering.As I've seen an CartoDB doing in cloud system,they can query & generate dynamic tile for request with UTFGrid.

Since we have no budgets available on project,we need to implement the same functionality on private server by generating tiles on the fly per requests including querying,choropleth mapping,also changing cartocss for changing default colors.So forth,we can adjust Tilemill for static maps.
Can I use Tilemill for same functionality ? If not,what are my options ?


texts: Copying ArcSDE datasets and features in Python give ERROR 000732?

texts:
I keep getting a kick back that says this:

  ERROR 000732: Input Features: Dataset 'Database
  Connections\Wyoming.sde\Supporting_MT_DBO_Geology' does not exist or
  is not supported Failed to execute (FeatureClassToGeodatabase).

# Import modules
import sys, string, os, datetime, arcpy

# Sets the start time
nowstart = datetime.datetime.now()

# Set location of SDE instance - in this case a special SDE connection just for this script
SDEname = r"C:\Users\user\AppData\Roaming\ESRI\Desktop10.1\ArcCatalog\Wyoming.sde"
SDEnameShort = r"'Database Connections\Wyoming.sde"

# Set up the log file
LogLoc = r"P:\Database_Backups\SDE\BackupLog_"
LgFile = LogLoc + nowstart.strftime("%Y_%m_%d_%H%M") + ".log"
logfile_out = open(LgFile, 'w')
# Write the start time to the log file
logfile_out.write("Backup process started on " + nowstart.strftime("%Y_%m_%d %H:%M") + "\n")

# Deletes temp timestamp
del nowstart

# Add the Conversion and Data Management Toolboxes to the geoprocessor

#Sets work environment to SDEname
arcpy.env.workspace = SDEname

#Sets environment to overwrite
arcpy.env.overwriteOutput = True

# Resets the start time
nowstart = datetime.datetime.now()

# Creates a variable for naming the backup GDB
YearMonthDayTime = nowstart.strftime("%Y_%m_%d_%H%M")

# Variables and parameters for setting up the backup GDB
outgdb = "PetroPAM_Backup_" + YearMonthDayTime + ".gdb"
outpath = r"P:\Database_Backups"
output = outpath + os.sep + outgdb
print output

#Create the backup GDB
arcpy.CreateFileGDB_management(outpath, outgdb)
print "Created BackupGDB"

# Find and export feature classes in datasets to a backup GDB
logfile_out.write("\nCreating Feature Dataset List...\n")
fc = arcpy.ListFeatureClasses()

dsList = arcpy.ListDatasets("*", "Feature")
print dsList
print "The Datasets"
for dsGEO in dsList:
    outDS = arcpy.ValidateTableName(dsGEO)
    arcpy.CreateFeatureDataset_management(output, outDS)
    fcListGEO = arcpy.ListFeatureClasses("*","",dsGEO)
    print fcListGEO
    print "Feature Classes in Dataset"
    for fcGEO in fcListGEO:
        print fcGEO
        print SDEnameShort + os.sep + outDS + os.sep + fcGEO
        arcpy.FeatureClassToGeodatabase_conversion(SDEnameShort + os.sep + outDS + os.sep + fcGEO, output + outDS)

Any ideas?  I'm using ArcMap 10.1


texts: Generating WMS service from file geodatabase and layer files using no ArcGIS software?

texts:
I'm just starting with GIS.

I'm using Leaflet to get a WMS layer. It works fine, but I want to know how can I serve the tiles from my own server. I have a .gdb file and several .lyr files.

What I want to achieve is generate an endpoint in my server like wms.example.com where I can get the WMS layer without consulting an external URL.


texts: I am using GDAL ogr2ogr to export to a file geodatabase from postgres. I keep receiving this error for some layers within my database. Any idea on what is causing this error?


texts: QGIS 2.14 Linux/Ubuntu GRASS algorithms - This algorithm cannot be run :-(

texts:
Does someone else have the problem that GRASS Tools don't work in QGIS 2.14 Toolbox ? Error: "This algorithm cannot be run :-("
GRASS7 is enabled in Toolbox options and installed (with QGIS-GRASS Plugin etc) - tested both repos (QGIS and Ubuntugis).


texts: Hiding or disabling Database Connections in Catalog window using ArcObjects?

texts:
I am working on a project that I must limit  some functionality of ArcMap based on user permissions.

Is there any way to do that ?

for example I want to disable the Database Connections in Catalog windows  by using c# in ArcObjects


texts:
I am using LeafletJs as mapping library for OpenStreetMaps. Is there any method map.Tilt() in Leaflet api like google provides

map = new google.maps.Map(document.getElementById('map-canvas'), {
    zoom: 18,
    center: new google.maps.LatLng(35.8313284, -82.7251666),
    mapTypeId: google.maps.MapTypeId.SATELLITE,
    heading: 90,
    tilt: 30
});

I need not SATELLITE view. Recently i am viewing markers like this. I need to show in 20/30 degree angled the map.


texts: Table field names mixed up in table view of ArcMap?

texts:
I'm having trouble figuring out why apparently a table from a file geodatabase isn't interpreted correctly. These are some of the fields as they should show up in the table view:

However, the table view doesn't show the right headers and also mixes up values:

In that image,

the column marked with "1" should be named "idia_r"
the column marked with "2" should be named "flow_r"
the column marked with "3" is fine.

When I join this table to a line feature class (also from a file geodatabase, but a different one), I get the same mixup in column names. Again, the property window shows the right attributes:

Why does this happen and how can I fix it?


texts:
I have a "notes" field in my CartoDB table, that I tried to populate with multi-line texts, but there doesn't seem to be a way to add line breaks. If I use
 I just end up with a literal
 in my info window.

Can I force a line break?


texts: Data Defined Override for Hex Colour - QGIS 3.4.1

texts: Under Properties > Labels > Background there is an inconsistency between the tooltip and how string colours are interpreted. See here:


texts: How do you Turn on the GRASS plugin in Quantum GIS?

texts: I downloaded and installed Quantum GIS 1.5.0 with GRASS using the OSGeo4W installer on my Windows XP machine.  Unfortunately, when I go to Plugins>Manage Plugins I cannot find the GRASS plugin.  When I browse to OSGeo4W\apps\qgis\plugins I can see grassplugin.dll, grassrasterprovider.dll and grassprovider.dll.  So, I would appreciate it if someone could tell me how to make QGIS recognize the GRASS install.


texts: Is there a way of viewing a photo has a point tag from Photo2shape in QGIS?

texts: Is there a way to view images (photos) that have location point from Photo2shape by clicking on the point in QGIS?


texts: How to set QField project with specific scales but not limiting the reach?

texts:
Oke so far I know how to create QField project with QField sync, I find it very easy, but I have to say it is quite unstable since it will close the app down after I try to zoom on the map on a specific scale. I suppose this is because my base map (which consist of a Ortho Photo of the entire area of the "community") is just to big for calculations.

To put points on a map this is actually not a problem since I just need to locate by GPS by standing next to object, and then putting the point in.

However I also want to use QFIELD to create "polygon" shapefiles on the field. And if zooming on a base map layer like this causes a crash, it will give problems.

We use the ortho photo in QGIS desktop to draw, on a scale around 1:150-1:250. The reason since the picture is most clearer then, because we want to make sure the error margin is a less as possible when drawing by hand. At that scale range the picture is as much clear as we can get it and NOT to much pixelated.

In QGIS desktop we just zoom out to a bigger scale and then just relocate, so our project view is NOT LIMITED to this scale range.

So how do I make sure that the QGIS field projects is only limited to a scale of 1:150-1:250 in terms of zoom, but not sacrificing the reach of the base map layer? This is because we can assume that we just can relocate by using the GPS.


texts: QGIS 3.16.3 uses Python 3.7.7 while I want it to use Python 3.9.1 already on my MacOS Big Sur

texts:
MacOS: Big Sur 11.1
QGIS: 3.16.3

KyngChaos said that QGIS 3.16 is using Python 3.9.X (strictly) and I installed this in my system, however the Python bundled with QGIS is 3.7.7. It is strange that the correct version is not bundled or supplied with QGIS itself.
I would like to know how I can change the Python from 3.7.7 to 3.9.1 in QGIS?


texts: z-index of geoJSONs and imageOverlays in Leaflet

texts:
There have been several Github issues raised regarding Leaflet z-indexing of layers, and I'm still not clear where things stand. I think my question is quite simple:

Is it possible to set any stacking order of a mixture of geoJSON and imageOverlay layers? If so, how, and can it be done in 0.7.7, or only in 1.0.0-beta?


texts: Is there a maximum size of a raster layer in PostGIS where regular blocking is supported?

texts:
I'm using raster2pgsql to load a 5m DTM of England into Postgis. I'm trying to add the regular blocking constraint, but when I try this, it fails with the error:

NOTICE:  Unable to create coverage raster. Cannot add coverage tile constraint: rt_raster_new: Dimensions requested exceed the maximum (65535 x 65535) permitted for a raster (XX000)

Which is generated after loading SQL generated by: raster2pgsql -s 27700 -t 50x50 -I -C -r -e -Y *.asc terrain (I've also tried including -P, 256x256 tiles and no tiling).

Googling for this, the only reference to this error I can find is the relevant source SQL source and (if I understand it correctly) I think it's trying to make a single raster image out of the hulls of all the tiles in my DTM layer.

Have I understood this correctly, and does this mean that there is a maximum total size of 65535 x 65535 for a PostGIS raster layer if you want to use regular blocking?


texts: How to use ST_Distance (Closest polygon to point)

texts:
Can I know how to interpret this SELECT statement for PostGIS? I am unsure where do I insert my own coordinates in this statement.

SELECT geom
FROM polys, points
WHERE points.gid=1 AND ST_DWithin(poly.geom, points.geom, 1000)
ORDER BY ST_Distance(a.geom, b.geom) LIMIT 1;


texts: Merge Natural Earth SQLite country polygons using ogr2ogr and ST_Union

texts:
I'm trying to create a map with the world continents (with a few modifications). As a source I use a sqlite file from Natural Earth. I already introduced my modification in the definition of the continents and now I would like to merge the countries of the same continent using the table "ne_110m_admin_0_countries" into a single shape and export the result to GeoJSON format.

I use the following command:

ogr2ogr -f GeoJSON -dialect sqlite -sql "select continent, st_union(geometry) as geom from ne_110m_admin_0_countries group by continent" continent.json natural_earch_vector.sqlite

I get no errors, but the result is a GeoJSON file containing:

  {
  "type": "FeatureCollection",
  "features": [
  { "type": "Feature", "properties": {"continent": "Africa", "geom": null}, "geometry": null },
  { "type": "Feature", "properties": {"continent": "Antarctica", "geom": null}, "geometry": null },
  { "type": "Feature", "properties": {"continent": "Asia", "geom": null}, "geometry": null },
  { "type": "Feature", "properties": {"continent": "Europe", "geom": null}, "geometry": null },
  { "type": "Feature", "properties": {"continent": "North America", "geom": null}, "geometry": null },
  { "type": "Feature", "properties": {"continent": "Oceania", "geom": null}, "geometry": null },
  { "type": "Feature", "properties": {"continent": "Seven seas", "geom": null}, "geometry": null },
  { "type": "Feature", "properties": {"continent": "South America", "geom": null}, "geometry": null },
  ]
  }

Am I missing something? what is wrong in my command? Why I get the geom column inside the properties and I have an additional geometry feature?

It doesn't seem to work also if I use another output format instead of GeoJSON.


texts: arcpy, CalculateField: 'geoprocessing sys.stdout object' object has no attribute 'flush'

texts:
Working with 10.2.2, 64bit geoprocessing arcpy installation. Getting this error from arcpy.CalculateField_management() command.

From Spyder IDE in an ipython console, I get the error:

[IPKernelApp] ERROR | Exception in message handler:
Traceback (most recent call last):
  File "C:\Users\Nick\appdata\local\enthought\canopy\user\lib\site-packages\IPython\kernel\zmq\ipkernel.py", line 245, in dispatch_shell
    handler(stream, idents, msg)
  File "C:\Users\Nick\appdata\local\enthought\canopy\user\lib\site-packages\IPython\kernel\zmq\ipkernel.py", line 400, in execute_request
    reply_content.update(shell._showtraceback(etype, evalue, tb_list))
  File "C:\Users\Nick\appdata\local\enthought\canopy\user\lib\site-packages\IPython\kernel\zmq\zmqshell.py", line 501, in _showtraceback
    sys.stdout.flush()
AttributeError: 'geoprocessing sys.stdout object' object has no attribute 'flush'

It doesn't seem to have anything to do with the specifics of the command, and I can execute most other arcpy commands without problem.

Suggestions?

Here's the code I was running to get up to this (although I've tried this with different targets and different expressions -- it just seems to be the command, not the specifics):

ap.CalculateField_management(in_table = thiessens, field = 'primarySiteID',
                             expression = "!SITEID!",
                             expression_type = 'PYTHON')

At this point I'm pretty sure it's an incompatibility with iPython that only appears in the context of some of the field-editing commands (since I use iPython all the time and usually without issue...)

Pretty sure it's iPython -- have the same issue with a different ipython install on a different computer, so I don't think it's Spyder or that specific installation.


texts: How can I add multiple series to a chart in ArcGIS Pro

texts:
I am using ArcGIS Pro version 2.5.0. I want to create multiple scatter plots, but where they are all graphed on the same figure. That is, I have three different cities where I want to plot the same variable (y-axis) against income (x-axis) in each of those cities and to have a per-city regression line.

The option to have multiple series in a single chart is available in ArcGIS (at least in version 10.7.1, the one I am using) under view-->graphs-->create graphs-->add-->new series. However, as far as I can tell this option is not available in ArcGIS Pro.

Is there any way for me to do this?


texts: Assigning z values vertices and retrieve with PyQGIS?

texts:
I have tried both GRASS v.drape and ThToolBox 2D->3D to attach raster z values to line vertices. I can't tell whether this worked or not since I don't seem to be able to extract the values using python. Perhaps I'm not doing it correctly in python.

layers = QgsProject.instance().mapLayersByName('Lines with Z')
layer = layers[0]

for f in layer.selectedFeatures():
    geom = f.geometry().asPolyline()
    first_vertex = QgsPoint(geom[0])
    print(first_vertex.x())
    print(first_vertex.z())

Returns:

551628.914954415

nan

Either z values are not being assigned or I'm not retrieving them correctly. What I am trying to do, which I have not found a tool for, is generate a 2D profile of lines with z on the x-axis and distance on the y-axis with each line starting at 0 and also extract min and max z values for each line along the way.


texts: How can I get a polygon of everything between two polygons in PostGIS?

texts:
I am trying to find all the neighborhoods located between two (or more) neighborhoods. The definition of between is obviously a bit fuzzy but for our purpose, I'd like to extract all neighborhoods that overlap with the shape connecting two disjoint shapes.

For this, I am trying to build a polygon merging two polygons and including everything in between the two. I am not very familiar with the terminology, so I hope the following picture helps understand better what I am trying to do.

I am using PostgreSQL with PostGIS extension.

Source polygons

Desired output polygon

How could I write a PostGIS query to get this? I tried the following but without success:

SELECT ST_MakePolygon(ST_ExteriorRing(ST_Union(shape)))
FROM (
    SELECT *, 1 as group_id
    FROM subquery
) a
GROUP BY group_id

where subquery is just a table with the selected neighborhoods. shape is a polygon.

Thanks a lot for your help!


texts: Add private plugin repository to QGIS 3.4

texts:
I want to add a repository to my QGIS 3.4 which is on a private server. The repository contains all files needed (plugin.xml and metadata.txt for example) and has the structure as described here:

Is it possible to set up a local QGIS Plugin repository?

To access the repository, a p12 certificate is needed which I am able to load into qgis. The issue is that in order to access the plugins.xml file and zip of the plugin on the private repository, we need to also enter a username and password, which I cannot specify in qgis.

I tried with putting the plugins.xml on a network drive, and am able to see that the status of the repository is set to "enabled". But when I try to download the plugin, I get the error:

  Plugin installation failed: Failed to unzip the plugin package. Probably it's broken or missing from the repository. You may also want to make sure that you have write permission to the plugin directory: C:/...\profiles\default/python/plugins

I am sure that I have permission to the directory, any idea how I can specify the user name and password in qgis in addition to the certificate as authentication method, so it can download the plugin zip file?


texts: Adding a QgsLayoutItemMapGrid to a QgsLayoutItemMap with PyQGIS 3

texts:
I'm trying to add a grid to a map but I don't get any results. My code:

def add_map_layout_item(self,
                        list_maplayers,
                        qgs_rectangle,
                        origin_x_mm,
                        origin_y_mm,
                        width_mm,
                        height_mm,
                        grid_interval):

    map = QgsLayoutItemMap(self.layout)
    map.updateBoundingRect()
    map.setRect(QRectF(origin_x_mm, origin_y_mm, width_mm, height_mm))
    map.setPos(origin_x_mm, origin_y_mm)
    map.setFrameEnabled(True)

    map.setLayers(list_maplayers)
    map.setKeepLayerSet(True)
    map.setExtent(qgs_rectangle)
    self.iface.mapCanvas().freeze(True)

    map.attemptMove(QgsLayoutPoint(origin_x_mm, origin_y_mm))
    map.attemptResize(QgsLayoutSize(width_mm, height_mm))
    map.zoomToExtent(qgs_rectangle)

    qgs_layout_item_map_grid = QgsLayoutItemMapGrid("New grid",
                                                        map)
    qgs_layout_item_map_grid.setAnnotationPrecision(0)
    qgs_layout_item_map_grid.setAnnotationFrameDistance(1)
    qgs_layout_item_map_grid.setAnnotationFontColor(QColor(0, 0, 0))
    qgs_layout_item_map_grid.setCrossLength(1.0)
    qgs_layout_item_map_grid.setIntervalX(grid_interval)
    qgs_layout_item_map_grid.setIntervalY(grid_interval)

    self.layout.addLayoutItem(map)

What am I missing?


texts: Automatically creating polygon/lines vector from WMTS Raster Building Footprint using QGIS?

texts:
I have a WMTS layer "EMAP15" http://wmts.nlsc.gov.tw/wmts  providing footprints as raster layer.

I am trying to create 3D LOD1 buildings in Sketchup, but I have to trace each building as vector lines which takes a lot of time (Showed in image purple lines.)

I tried SaveAs GeoTiff first, then use Polygon (Raster to Vector), which does not get clear result of lines or polygon I wanted.

Any ideas?


texts:
I'm trying to create a dot-density map with OpenLayers (OL) and GeoServer. I've a counties shapefile and I'm creating a vector layer in OL with county shapefile set as source for the vector layer. I need to show dots (based on data in our API) inside the county feature. According to this example, a coordinate is required to draw a point. I need to make sure that any coordinate I give is inside the county feature.

How can I get all the coordinates inside a feature from GeoServer?


texts: Buffer on line not rounded on both ends in ArcMap?

texts:
As you can see in the image, after using the 'Buffer' geoprocessing tool on ArcMap 10.2, the buffer is not symmetric in some cases, and is therefore flat on one end (as shown in the image). The Buffer setting I have used in the 'Buffer' settings is 'Rounded'.

The line layer I use to add buffer, is made by drawing lines between points using the 'Lines to Points' geoprocessing tool.

Thoughts?


texts:
I am trying to cache the world map to the Portal on premises. There would be two layers in the tiled map services: worldcountries and oceans.

To compare the cache size, I first define the scale range of the worldcountries layer as 1:591,657,528 ~ 1:2,257, and the oceans layer as 1:591,657,528 ~ 1:18,056 (Figure 1). Then I define both layers' scale range as 1:591,657,528 ~ 1:18,489,298 (Figure 2).

In the Service Editor, I set up the levels of detail from 0 to 18. To my surprise, both estimate total cache size is about 21 TB. Will the blank scales in the second scenario be cached to the Portal?

Figure 1 (worldcountries scale: 1:591,657,528 ~ 1:2,257)

Figure 2 (layers scale: 1:591,657,528 ~ 1:18,489,298)


texts: Extract all band values of a multiband raster to Polygons as separate columns

texts:
I am trying to extract the values of a multiband raster to a polygon in R.
ACVheatingdegreedayS <- stack("location/multibandraster.tif")
ACVheatingdegreedayS <- ACVheatingdegreedayS %>%
  projectRaster(ACVheatingdegreedayS, crs="EPSG:3035")

( zCVhdd1 <- CVheatingdegreedayS[[1]] )

I want to avoid that last line of code where I break the multiband into a single band. There are 70 bands, so creating separate rasters would be very time consuming.
Anyone know of a way to extract all bands of a multiband raster to a polygon?


texts: Reclassifying vectorlayer attribute-column using dictionary in PyQGIS

texts:
I am new to working in QGIS-python environment, and I am trying to create a QGIS-plugin, where i want to create a new attributetable-column on a vector-layer based on some choices done by a user. A reclassifier so to say
So using GeoPandas, I would have collected the translation information in a dictionary with old information on left side, and the new information on the right. like
dictionary = {
        'old_data1' : 'new_data1',
        'old_data2' : 'new_data2',
        'old_data3' : 'new_data3',
    }

and then used geopandas .map() to create a new column based on this dictionary:
vectorlayer = gpd.read_file('vectorlayer.shp')
vectorlayer['new_class'] = vectorlayer['old_class'].map(dictionary)

Which would then create a new column with translated values.
Is there any similar function in the PyQGIS toolbox to use for this maneuver?


texts: Which marker did the user click on (ArcGIs JS API)?

texts:
I've got a simple map with a set of 10 markers on it. When they are clicked an infoWindow appears however I would like to instead display the data in the infoWindow in a table. How do I find out which marker was clicked?

This is the code I'm using to determine which marker was clicked:

          // Find the identity of the marker that was clicked
          featureLayer.clearSelection();
          var selectQuery = new esri.tasks.Query();
          var tol = map.extent.getWidth()/map.width * 10;
          var x = evt.mapPoint.x;
          var y = evt.mapPoint.y;
          var queryExtent = new esri.geometry.Extent(x-tol,y-tol,x+tol,y+tol,evt.mapPoint.spatialReference);
          selectQuery.geometry = queryExtent;
          var t = featureLayer.selectFeatures(selectQuery,esri.layers.FeatureLayer.SELECTION_NEW);
          console.log(t.results[0][0][0].attributes);

This partially works, however when the map zooms out this code will sometimes the wrong marker information. I'm thinking that I can change the queryExtent variable to account for the zoom level of the map. Does anyone know if this would work?

Thank you for reading this question and hopefully someone more experienced than myself can help.