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

learn more… | top users | synonyms

2
votes
0answers
40 views

Converting large rasters to NumPy

I have a geodatabase that contains a large number of raster datasets - there are two rasters for each country in the world, and they are very large, in some cases up to 3GB per raster dataset. I ...
2
votes
0answers
61 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
18 views

Using Spyder IDE to develop python for Grass GIS, get 'ImportError: No module named grass.script'

I am trying to use Spyder IDE to develop a python script using python library from grass-6.4.3. I run the script below, and get 'ImportError: No module named grass.script' I am using python 2.7, ...
2
votes
0answers
36 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
38 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 ...
2
votes
0answers
37 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
51 views

GDAL with GEOS support, pandas and VTK using python on Windows?

So far I have been using OSGeo4W shell (or OSGEO install) as really convenient way to use python together with additional packages, namely gdal, shapely, numpy, scipy and matplotlib. I was happy till ...
2
votes
0answers
54 views

Gdal Python Problem : Black strips in geotiff

I am trying to use GDAL (2.0.0) Python API in Blender, but I am having some difficulties. I am trying to save geotiffs for : - a 2D numpy array storing 32bits floats - a 3 channels rgb numpy array ...
2
votes
0answers
36 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
63 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
37 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
52 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", ...
2
votes
0answers
79 views

How to create line segments between pairs of pixels in a raster?

I want to draw several lines between pixels (please see the image below) according to some criteria : First Criterion: The distance between 2 pixels is less than 2000m and greater than 500m ...
2
votes
0answers
51 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
57 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
189 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
54 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
99 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
48 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
41 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
37 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
46 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!. ...
2
votes
0answers
86 views

How to use the multiprocessing module on python to execute a spatial join?

I have several shapefiles of the entire Amazon rainforest each with millions of polygons (they are fairly detailed and take some time to draw on ArcMap). I need each of these shapefiles to be ...
2
votes
0answers
41 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
32 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 ...
2
votes
0answers
90 views

How to Bulk “Add Selected” Attributes to a Relationship Class ~ 40000 Records

I have 2 Feature Classes (FC's) and 1 Relationship class. FC1 and FC2 share a common field with almost 40,000 matching records. For each matching record (i.e. when the matching records from FC1 ...
2
votes
0answers
126 views

Updating attribute table from an Excel file using Python

I am kinda new to Python, please excuse for such a trivial questions. There is a shapefile (let's call it Materials.shp). I have an attribute table with different fields (for example, windows, doors, ...
2
votes
0answers
100 views

How to change the group icon in legend via Python in QGIS 2.6?

How to change the group icon in legend via Python in QGIS 2.6? At version 1.x I did it this way: self.legendTree = self.iface.mainWindow().findChild(QDockWidget,"Legend").findChild(QTreeWidget) ...
2
votes
0answers
45 views

Updating Cursor to Include Newly Created Features

I am using ArcMap 10.1 and python to create cursor that starts at the one and only row of a polyline shapefile, some code runs to create a new feature based on the position of the exisiting feature, ...
2
votes
0answers
103 views

Error when running Python script to replaceDataSource of multiple layers in multiple mxd's

I looked on all of your sites and did not find a solution to my problem. Almost all of our data has been copied to an SDE and now most of the layers in all of the mxd's need to be redirected to the ...
2
votes
0answers
23 views

Help getting a Mathematical Representation within a Layer's Attribute Table

I'v been playing around with Vector Coding and was wondering if there was any Plugins out there that might let me represent Vectors within a layer as it's Mathematic attributes in the Layer's ...
2
votes
0answers
68 views

Help with Python/GDAL documentation

The instructions from the url http://gdal.org/gdal_tutorial.html give the following example: dataset = gdal.Open( filename, GA_ReadOnly) with the following description: It's interpretation is ...
2
votes
0answers
227 views

Iteratively exporting from Table to .txt in Model Builder (ArcMap) not appending correctly

I am solving a location-allocation type of problem where I use a loop to go through several specifications of the problem. The model runs fine, and produces the vizualization outputs just as expected. ...
2
votes
0answers
61 views

Programmatically Harvest and Disapprove Metadata - GeoPortal Server

Is it possible to synchronize an existing metadata catalog in esri's GeoPortal Server? I have access to the server, and have a script to add an XML file to our web accessible folder. After this script ...
2
votes
0answers
35 views

QGIS Python install question

Apologies for the 101 question; however, in trying to ramp up on python/QGIS I've seen mentioned that python.exe is the key executable in a python install. I have both Python 2.6 and 2.7 installed on ...
2
votes
0answers
91 views

How to open a second window in QGIS plugin from a button inside the main window

If I already created a qgis plugin, and i need to create a button inside that plugin that opens a new window, how is that possible? Qt creator won't add a slot unless there are a header file. I looked ...
2
votes
0answers
133 views

How to convert a raster file (*.tif) into a composite geodataset by using Python in ArcGIS 10.2.1

I created geotiff rasters (approximately 6000 rasters) in .tif format by using Matlab Mapping Toolbox. When I examined the properties of the data, I realised that it is 64 bit double type. I need to ...
2
votes
0answers
178 views

Splitting Line.shp at Point.shp with Python/ogr

I'm trying to modify some ESRI Shapefiles using Python with gdal/ogr module. What I want to do is quite simple, but I didn't find any solution by now. I have two shapefiles: (1) Lines.shp and (2) ...
2
votes
0answers
406 views

Link QGIS to Anaconda Python Distribution: Spyder, iPython Notebook, pip, scikit-learn

I have Anaconda as my primary Python distro, and want to route Python related QGIS scripts through it. With Anaconda, I have Spyder, can easily install packages with pip, and can launch a iPython ...
2
votes
0answers
277 views

Matplotlib error when installing Molusce or lifemapper in QGIS Brighton

I am installing plugins via the QGIS desktop internal interface, and have had twice now messages associated with matplotlib. The first error was for something called lifemapper and now for MOLUSCE. ...
2
votes
0answers
92 views

How to add column to attribute table using field calculator with $length function?

I used the following code to add a separate column to the attribute table with the length of features. from PyQt4.QtCore import QVariant from qgis.core import QgsField, QgsExpression, QgsFeature ...
2
votes
0answers
234 views

Python script for dark object subtraction on Landsat 8 Imagery

Does anyone know of any python scripts that will allow me to conduct such a process? I am limited to open source software and have minor experience in Python.
2
votes
0answers
52 views

What is the issue with geopdf format?

I'd like to add the geopdf format as output of a library that I am working on. After have looking around, I have not been able to find a (c, c++, python) library that meet my license requirements ...
2
votes
0answers
108 views

Iterating between two layers using QGIS python

I will try and explain my situation as clearly as possible. I just created my first plugin that is being used to analyze between various layers and give back quantities to the user. Most of it is ...
2
votes
0answers
146 views

Nested conditional statement in ArcGIS on multiple rasters

I have a list of rasters in ArcGIS and I want to create a conditional (Con) nested statement based on all the rasters of the list. I want this to be reiterate through many lists (the number of rasters ...
2
votes
0answers
87 views

Developing workaround to arcpy.asShape truncating all values to 3 decimal points?

I've read a few questions\answers about converting a GeoJSON Shape into an ESRI Object. Unfortunately most of the answers pointed to decoding the dictionary's manually. Im a bit more lazy ^_^ The ...
2
votes
0answers
62 views

How to move feature using python console in qgis

i am building a qgis plugin that can create as much copies of a selected feature as i want and paste it to my required place.I have code to copy and paste feature select = ...
2
votes
0answers
143 views

Kartograph - AttributeError: _Shape instance has no attribute 'parts'

I am new to GIS and open source tools so bear with me. I am attempting to convert a shapefile to svg by running kartograph as a python module. My source file (provided by the local GIS ...
2
votes
0answers
83 views

Validating whether PDF file Uploaded as part of Geoprocessing Service of ArcGIS for Server?

I'm developing a Python Script that will be a Geoprocessing Service in ArcGIS Server. The Script has a Button for Users to OPTIONALLY Upload a PDF. If the PDF is Uploaded it gets inserted into the ...
2
votes
0answers
138 views

PyQGIS add WMS layer with CQL_FILTER

Dear PyQgis developers! I'd like to add a wms layer through my QGIS plugin with custom CQL_FILTER parameters. My problem is, that the CQL_FILTER parameters are not passed to the GeoServer (I can see ...