Hot answers tagged

4

I use psycopg2 and shapely to read PostGIS geometries into Python, like this: import psycopg2 from shapely import wkb conn = psycopg2.connect(...) curs = conn.cursor() curs.execute('SELECT geom FROM line_table WHERE gid=%s', (23,)) # one geometry geom = wkb.loads(curs.fetchone()[0], hex=True) geom.coords[:] # [(x1, y1), (x2, y2)] If you have ...


4

I think there's a couple of things going on here. Firstly you need to have a valid what3words API key and either define this as an environment variable called W3W_API_KEY or pass it as the "key" parameter. Secondly, what3words isn't defined as a module by the geocoder, it's the w3w method on the geocoder module that you'll need to invoke. Finally, ...


2

Assuming there is a common field between them all: Merge all the feature classes together into one feature class Dissolve the feature class based on the identifier field. This will result in a multi-point feature class with each entry comprised of multiple locations Run feature to point to collapse the multipoint to point


2

You should replace : myquery = PropertyIsEqualTo('csw:AnyText', 'été') with: myquery = PropertyIsEqualTo('csw:AnyText', u'été') The prefix indicates a unicode string : 3.1.3. Unicode Strings


2

The error occurrs because the plugin does not filter out Raster layers from the QGIS ToC and lists them in its own GUI. The plugin should only deal with Vector layers, since it acts on vector geometries. I've just sent a pull request to the plugin's author with code to fix this problem. If you don't want to wait until the author releases a new Simplipy ...


1

The options value is a list, not a dict, and the elements are key value pairs. Try: co = ["HEADER=" + header_path, "TRAILER=" + trailer_path] dxf_ds = dxf_driver.CreateDataSource(dxf_out_path, options=co) I can't say dictionaries don't work, buy I don't recall seeing them in my experience. The python bindings closely follow the standard GDAL API.


1

Fiona works with Python dictionaries (schema, features) and and more specifically Ordered Dictionaries shape = fiona.open("a_shapefile.shp") # schema of the shapefile shape.schema {'geometry': 'Point', 'properties': OrderedDict([(u'id', 'str:10')])} # keys of the dictionary shape.schema.keys() ['geometry', 'properties'] # first feature of the shapefile elem ...


1

I think the following parameters requires a minimum value of 1: JPEGCOMPRESSION ZLEVEL PREDICTOR The others can be set to 0 so you could try running the following which works for me: processing.runalg('gdalogr:cliprasterbymasklayer', inputlayer, maskshape, "", False, False, False, 0, 0, 1, 1, 1, False, 0, False, "", "outputraster")


1

The download for the 64 bit geoprocessing installation is not freely available. I found it in my.esri.com under My Organizations -> Downloads -> ArcGIS for Desktop 10.4 -> ArcGIS for Desktop Background Geoprocessing (64-bit).


1

Try using arcpy to back up your geodatabases. Example: workspace = r"workspace\file\path" arcpy.env.workspace = workspace print "Set Workspace" backup_location = r"new\folder\path" + "\\" + "workspace.gdb" print "Backing up workspace" arcpy.Copy_management(workspace, backup_location) print "Clearing Workspace cache" arcpy.env.workspace = "" ...



Only top voted, non community-wiki answers of a minimum length are eligible