Python is an open source interpreted programming language used in many GIS programs.

learn more… | top users | synonyms

2
votes
0answers
43 views

QGIS Override MapTool Python

My goal is to reuse the default edits tool of QGIS in a custom App. But I would like to modify some behavior with those tools. For instance, the MapTool beside the Edit Node Action. iface....
2
votes
0answers
40 views

How to run QGIS plugin from python script

I would like to access external QGIS plugins through a python script. I have been able to access the built in QGIS processing and vector toolbox, but have been unsuccessful with external plugins such ...
2
votes
0answers
229 views

Is it possible to query/download satellite images with Python?

I was wondering if there exists a Python library/API for downloading satellite images. Ideally, I would want to enter the latitude and longitude of a bounding box and get a high resolution image ...
2
votes
0answers
41 views

How can I change the labels in the console output in Google Earth Engine?

This is the second part of my edited two part question (first part here). So I used the following script: // define the var var Catchment = /* color: 98ff00 */geometry; var landcover = ee.Image('...
2
votes
0answers
36 views

Apply QChainage based on field value

I'm quite new to QGIS and found the great plugin QChainage. Simply put, it allows to create points along lines. There are different modes available. Create points every X meters or Divide the line i ...
2
votes
0answers
226 views

gdal/python: tif not recognised a supported file format

I'm trying to open a tif using gdal, read it as a array, do some math, and write it back as a tif. However, when I try to gdal.Open(tif) in python, I get the error: RuntimeError: /att/gpfsfs/...
2
votes
0answers
54 views

Show attribute table in the form (table of contents)

I am building a plugin in a new window with table of contents associated. I have some actions, for example, zoom to extent and others and I want also to show the attribute table. I search and find ...
2
votes
0answers
93 views

Setting extent with python in QGIS in new project

Situation: I am trying to write a simple python script for QGIS. The script aims to load one layer, zoom to given coordinates, and 'place a pin' there. The coordinates will change every time I run the ...
2
votes
0answers
71 views

Interpolating every X distance along line in shapely

If I have a shapely multiline object that contains many lines whose total length each is 50km (when traced from the origin), and I want to interpolate along the multiline every X meters (let's say ...
2
votes
0answers
78 views

Geopandas and Zonal Statistic error

I'm trying to use Geopandas and zonal statistic from rasterstats together. I run this code import geopandas as gpd from rasterstats import zonal_stats geodf = gpd.read_file("SHP/shape.shp") ...
2
votes
0answers
89 views

arcpy.AddIndex_management error for in_memory variable

I am trying to optimize a script that uses addJoin_management. To do this efficiently, I am attempting to add an attribute index on the join table. I am getting a generic error when i do this though. ...
2
votes
0answers
104 views

Altering legend labels in Matplotlib

I have a choropleth map which displays crime percentage change. It is plotted from a geodataframe and the choropleth intervals are determined in the background by Python. Unfortunately, the first ...
2
votes
0answers
100 views

arcgisscripting.ExecuteError: ERROR 001270: Consolidating the data failed

I am working on PuTTY and trying to create service definition file in server. My Python script is creating .sddraft but I am receiving 'Consolidating the data failed' error when I run stage service ...
2
votes
0answers
28 views

QGIS plugin window qt creator formatting ineffictive

I am developing a QGIS plugin. I have assigned the QGIS main window as the parent window of custom plugin using: QtGui.QDialog.__init__(self,iface.mainWindow()) But after doing so the problem ...
2
votes
0answers
206 views

NetCDF to Shapefile with Python and GDAL?

I need to save my outputs, which are netcdf files or panda python tables, to shapefiles. They cannot be rasters because the software I am loading them into accepts shapefiles only. I have googled ...
2
votes
0answers
86 views

Button to run Python Script on Custom Form Open QGIS

I'm very new to QGIS and Python (although years ago had some programming experience with C++), but have been muddling through with a fairly large project cataloging cemetery plots at the moment. I ...
2
votes
0answers
34 views

QGIS, add a layer (shapefile) to a running QGIS from an external application

I'm trying to load a shapefile as a new layer into a running QGIS application using python within a Windows command shell. The python is basically what is explained in this post: How to open a layer ...
2
votes
0answers
71 views

Regridding vector values

I'm trying to regrid and interpolate vector values from WAM model output. I got WAM model netCDF output in rotated grid, I need to interpolate it to another grid which is some variant of LAEA ...
2
votes
0answers
226 views

Combining custom QWidgets with ui file generated from QGIS plugin builder?

I am having a hard time figuring out how I can include several QWidgets (created in individual scripts) into the QT Designer ui file generated from a QGIS plugin builder. These are custom widgets I ...
2
votes
0answers
65 views

Finding start and end junctions of road from coordinate on road

I have a list of co-ordinates where traffic counts were carried out. I wish to associate these traffic counts to the link they are selected with. For that link I want to know the location of its two ...
2
votes
0answers
87 views

Some layers won't load when running application out of QGIS. “Item has already been added to this scene”?

I'm developing a basic application out of QGIS and am having trouble getting my code to generate all the layers I have set. Currently it only generates two of the four layers: "self.basemap_layer", ...
2
votes
0answers
64 views

How to display selected features in a map to exporte as PDF

I've already managed to select feature by ID in a layer and zoom to it using pyqgis. The canvas considered this changes but the map that I exported as PDF do not consider this changes, any idea to ...
2
votes
0answers
211 views

ArcMap Label Help - Label from X/Y Coordinate

Edited: This picture might help explain my question. Here I have a point at the line with an X/Y coordinate. It also has a leader line to it. This leader line has an X2/Y2 coordinate. Both of ...
2
votes
0answers
119 views

Multiprocessing in python qgis?

When i try to do mutliprocessing in python Qgis it doesn't work from multiprocessing import Process,Lock import multiprocessing def name1(l,i): print i if __name__=='__main__': lock=Lock() ...
2
votes
0answers
222 views

Can we create buffer analysis using python in qgis?

Can we create a buffer of distance 0.004 using python in qgis. I tried this link, but it isn't working for python in qgis 2.10.1-Pisa. The above is the diagram of buffer I am asking. It's located ...
2
votes
0answers
78 views

Creating new empty vector layer that has same set of atributes as another layer and then copying subset of features into it

I am new to both Python and QGIS. Here's a sample of my code: unique = layer.uniqueValues(index) attributes = layer..dataProvider().fields().toList() assistant_layer = QgsVectorLayer("Point", "...
2
votes
0answers
77 views

Multiple layer intersection

I am trying to find a way with qgis/python to get the intersection area of more than 2 layers. All the tools in Qgis take just the 2 input layers. ='( For example in the image below, I have 4 layers ...
2
votes
0answers
61 views

Can't import liblas into OSGeo4w Python on Windows machine

I installed the 32-bit version of OSGeo4w with the liblas-python packages on my Windows machine. When I try to import liblas into python, I get an error that no 'liblas' module can be found, even ...
2
votes
0answers
83 views

Cul-de-sac (curve) turns generation in flow for parallel lines using ArcGIS for Desktop?

I'm using ArcMap 10.2 and I need to generate a parallel lines within the polygon and connect them one to other with the curve, with the proper radius and return radius (the same as cul-de-sac tool ...
2
votes
0answers
84 views

QGIS QgsLayerTreeGroup signal “currentLayerChanged”?

In a pyqgis context, I use the "currentLayerChanged(QgsMapLayer *)" signal of the QgisInterface class to do something when the current layer is changed, but I need now to do the same when I select a ...
2
votes
0answers
105 views

QGIS python originalName() does not return actual original layer name

I am writing a Python QGIS Plugin, using QGIS version 2.6 as the basis for development. When loading data into the canvas programmatically, I am trying to maintain the spatialite table name as the ...
2
votes
0answers
150 views

Using Python to iterate through directory to create event layer and perform kernel Density for each file?

I am new to Python for ArcGIS, but have been using ArcGIS a while. I have a large directory of tables with point data. For each file of each folder I want to create a kernel density layer. I have ...
2
votes
0answers
139 views

Spatial join with multiple intersecting features

I have a polygon dataset representing pavement areas broken up by year of construction and a roads centerline dataset that contains values for remaining service life (RSL). I want to spatially join ...
2
votes
0answers
80 views

Create a sript for “point sampling tool” of QGIS

Is there any way to create a python script to the "point sampling tool" plugin from QGIS? I have a very large number of Netcdf files which I want extrat the values from pixels to a irregular points ...
2
votes
0answers
92 views

QGIS not interacting with iface from python class

So I'm working on something where i need to use threads from python console of QGIS. The following line of code adds layer successfully iface.addVectorLayer("D:\ArcGIS Misc\Atlas\points.shp", 'Points'...
2
votes
0answers
83 views

How to clip or erase a csv file with a non-rectangular shapefile?

I can clip a csv file with a ogr2ogr having 4 extents of a rectangular polygon. Is it possible to clip a csv file with a non rectangular shapefile?
2
votes
0answers
131 views

GDAL equivalent to ArcGIS Union?

I have a single shapefile full of overlapping polygons. The ArcGIS Union tool will generate individual, non-overlapping polygons with that geometry. Is there a way to do this with GDAL/OGR or another ...
2
votes
0answers
735 views

open-source code for the map matching algorithm

For map matching of the GPS data to the network data, there is a algorithm from Schussler, N. & Axhausen, K. (2009a). Is this algorithm released under open-source license ? Where can I find this ?...
2
votes
0answers
210 views

How to run Focal Stats on specific values in python

I'm a beginning programmer and am new to the site but it has helped me quite a bit so thank you! I'm trying to recreate a raster calculator operation using python scripts but am having a hard time ...
2
votes
0answers
140 views

How to use d.* from a python/bash script in GRASS GIS 7.0?

Do d.* commands from GRASS GIS 7.0 run from a python script? I'm trying with this code: import grass.script as grass grass.run_command('d.mon', start="wx3", resolution = '1') grass.run_command('d....
2
votes
0answers
226 views

How to access Landsat bucket from Amazon?

I tried to access amazon Landsat S3 bucket with the following python code import boto import boto.s3.connection from boto.s3.connection import S3Connection access_key = <userid> secret_key = &...
2
votes
0answers
59 views

Error inserting new column in ArcSDE table (ERROR 999999)

I am using a python script to populate a table with values I get from rasters files. I use arcpy.AddField_management to add a new column and arcpy.CalculateField_management to insert the values for ...
2
votes
0answers
53 views

Query out a specific date regardless of the time, using python

Problem: I have a feature class with an attribute table with a field called Edited_Date and its data in the field is as follows: 4/8/2015 10:00:00 PM. I want to select all records that are Edited_Date ...
2
votes
0answers
413 views

DBSCAN gives “AttributeError: NoneType has no attribute issparse”

I am running a Python script invoking the DBSCAN tool to cluster feature points. When I open ArcMap, load the feature layer, and run the script, it works the way I expect it to. But if I run it ...
2
votes
0answers
50 views

GDAL merge; Why add 0.1?

In the implementation of gdal_merge: https://svn.osgeo.org/gdal/trunk/gdal/swig/python/scripts/gdal_merge.py a value of 0.1 is added to the conversion from geo-referenced coordinates to pixel ...
2
votes
0answers
113 views

Not able to get the PostGIS Layer Viewer running in pgAdmin or command line

I've installed PostGIS Layer Viewer as a plugin for pgAdmin. I've downloaded postgis_viewer.py from the official repository on GitHub! and followed the install instructions described on Web site!. I'...
2
votes
0answers
786 views

Running Python outside of QGIS - (ImportError: No module named qgis.core)

I'm trying to run simple scripts on QGIS from outside the QGIS environment - as here How to run a simple python script for QGIS from outside (e.g. Sublime Text)? My code: import sys sys.path.append("...
2
votes
0answers
495 views

Speed up row-wise point in polygon with Geopandas

I have a geopandas GeoDataframe which contains some attributes and a geometry column which is filled with shapely Point(lon, lat) objects. Moreover, there is a GeoSeries which is equally indexed as ...
2
votes
0answers
115 views

Using ST_AsText() without session object

I am storing gps locations as feature in a restfull api. The locations are linked by foreign key to "place" objects in a flask/sqlalchemy/geoalchemy framework. I would like to print a user readable ...
2
votes
0answers
42 views

QGIS Python Script for RoadGraph plugin

I am looking to create a Python script that will take X,Y coordinates from one field in an attribute table, compare them to another set of X,Y coordinates in a different field, and populate a field ...