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

learn more… | top users | synonyms

6
votes
0answers
279 views

Histogram Matching Python

I am trying to do histogram matching using Python to improve the mosaicking process of multiple overlapping rasters. I am basing my code on that found at: ...
5
votes
0answers
596 views

How to get rpy2 for QGIS on OSX?

I am a new QGIS user, have installed QGIS on a Mac running Snow Leopard OSX 10.6.8 following all the instructions. QGIS seems to work well for everything other than when I boot up I get the message ...
4
votes
0answers
980 views

gdal ImportError in python on Windows

Trying to import gdal for Python 2.7.3 on Windows XP: >>> import gdal Traceback (most recent call last): File "<stdin>", line 1, in <module> File ...
3
votes
0answers
36 views

How to create a python plugin in QGIS 2.4.0?

While I am learning to create a python plugin in QGIS 2.4.0, I have followed the proceedure expalined in ...
3
votes
0answers
23 views

Overriding the QGIS Feature Dialog

We are developing a QGIS plugin and would like to override the QGIS Feature Edit Form with our own Dialog. Have explored using setEditForm and setEditFormInit, but the init process appears to want to ...
3
votes
0answers
56 views

Problem with performance when loading PostGIS layer using pyQGIS

I'm having a question on loading a PostGIS layer into the project from my QGIS plugin. The code is like this: uri1 = qgis.core.QgsDataSourceURI() uri1.setConnection(str(host), str(port), ...
3
votes
0answers
74 views

How to compute (X,Y,Z) of a point from given attributes

Is there a way to compute the geodetic coordinates (Earth Centered) of a satellite S(x,y,z). The original problem is to compute the footprint of an antenna, given the following information: ...
3
votes
0answers
47 views

Create vector grid from canvas using script

I've modified "Hex grid from layer bounds" script to my need. Just added cellsizex and cellsizey. Changed the hexagonal - 3 to "1" to make it as a square grid. Is it possible to include an option to ...
3
votes
0answers
50 views

Performing buffering and intersection with script in PyQGIS

I wrote a script that performs the intersection of two layers: The first Layer -> layer1, represents the rivers The second Layer -> layer2, represents a set of circular dots distributed in a ...
3
votes
0answers
39 views

ArcPy: Initialize zero valued grid Raster and iteratively increment

I'm jumping right into ArcPy to help out a friend who needs to automate some ArcGIS work. The problem at hand can be reduced to the following pseudocode: accumulationRaster = SomeZeroedRaster for ...
3
votes
0answers
67 views

QGIS API - Print Composer Template produces empty map?

I have a print composer template which I'm trying to populate with different subset queries from a CSV-derived vector layer using the Python API. However, all the output PDFs contain everything except ...
3
votes
0answers
64 views

How to find the minimum number of inspection points?

I am working on a pipeline inspection project and there is a high liklihood that some inspection tool deployment/retrival station will need to be installed on the pipe network. the problem is ...
3
votes
0answers
56 views

Arcpy in Python Plugin for SPSS

Is it possible to run the arcpy module in the Python for SPSS plugin to run the search and update cursors?
3
votes
0answers
484 views

Reprojecting WGS 1984 Web Mercator (EPSG:3857) in Python with GDAL

I am reprojecting rasters in python using GDAL. I need to project several tiffs from geographic WGS 84 coordinates to WGS 1984 Web Mercator (Auxiliary Sphere), in order to use them later in Openlayers ...
3
votes
0answers
407 views

GDAL polygonize lines

I have a raster file containing roads (left image). I polygonize the raster file with GDAL (see the script below). In the end I like to have vector lines. However GDAL only gives me something like ...
3
votes
0answers
134 views

Handling non-spatial data for QGIS projects with Camelot

Most of my projects include data which is non-spatial or which is point data and can be managed by a regular relational database. Previously I found Manifold and ms-access were a good combination ...
3
votes
0answers
183 views

How to convert a raster (array) to a NetworkX graph and do a * search?

I want to use a slope-raster for a a_star path analysis in NetworkX. I am using Python for this project. My test raster looks like this First I read in the raster with GDAL input_raster = ...
3
votes
0answers
69 views

Is it possible to access individual pages within an existing pdf using arcpy.mapping?

I've used the arcpy.mapping module for some time now to create mapbooks and other pdf documents, using a combination of Data Driven Pages and Python. I would like to take an existing pdf and save each ...
3
votes
0answers
130 views

How to create a Typographic Map with Mapnik

So i am trying to make a typographic map using mapnik. I want the street names along a particular street not to overlap, but I want an intersection between two streets to over lap. Currently some ...
3
votes
0answers
209 views

Is there a Python WMS client (thin client analogue of OpenLayers)?

I'm making a geoportal based on (Geo)Django 1.5, PostgreSQL 9.1 + PostGIS 2.0, QGIS MapServer and OpenStreet Map or Google Maps WMS services for the base layer. It seems like there is no problem, but ...
3
votes
0answers
258 views

Configure Python with Geoserver

I am developing a WebGIS application with: Openlayers 2.12 PostgreSQL 9.2 with PostGIS 2.0 extension Geoserver 2.2.3 Apache 2.0 configured with Tomcat 7.0.35 PROBLEM One of the services of the ...
3
votes
0answers
289 views

Create easy Annotations from point features with python in ArcGIS 10.0

Because in ArcGIS 10.0 there is still no simple toolbox function to convert labels to Annotation, I try to go a substitude way with the callable Toolbox function [TiledLabelsToAnnotation][1] on a ...
3
votes
0answers
326 views

Extracting x,y,z values from a postgis linestring to python using ogr

I am trying to load a postgis linestring into python (using ST_DumpPoints) and extracting x,y,z coordinates, which is working but extremely slow..and if i mean slow, i really mean it (yes, it takes ...
3
votes
0answers
289 views

Importing matplotlib basemap and shapely

I'm not sure if this is the right place to ask this, but here we go. I have a python script that uses matplotlib's basemap and another part that uses shapely to do an intersection of 2 polygons. If ...
3
votes
0answers
549 views

Reset python add-in

I have a toolbar which enables a second and third combobox when a selection is made on the previous. I would like to add a button to 'reset' the toolbar. Basically reload the toolbar to it's original ...
3
votes
0answers
165 views

How to merge SeaWiFS and MODIS data or use other merged products?

I hope to produce a time-series for sea surface temperature (SST) and chlorophyll-a (Chl-a) for use in MaxEnt without the use of arcgis, preferring Python tools to others. I am new to satellite data ...
3
votes
0answers
714 views

How to create mask bands in GDAL and Python?

I have small program in Python that uses gdal and numpy to perform a logarithmic scale of some data into the RGB 0-255 range. Now this input data has a nodata value set to mask the valid values, and ...
3
votes
0answers
74 views

Adding points to represent non-chosen locations

I am looking for a way to set up a discrete choice model in ArcGIS for foraging behavior of individuals, in a grid of 15 locations. To do that I need a point for every possible choice they could have ...
2
votes
0answers
51 views

Identifying certain polygon from overlapping set

To clean up a large shapefile, I am looking for a way to do the following: I have the ID of many polygons which need getting rid of stored in a list. These polygons are villages and a second ...
2
votes
0answers
42 views

N Nearest Neighbours efficiently PostGIS/Python

The data is worldwide about a million points, lat/lons, with an id and an importance value (0.0 to 1.0), and it's limited to being on land. Ideally I need to cluster all 1 million points into 100,000 ...
2
votes
0answers
32 views

arcpy with multiprocessing throws “UnpickleableError: Cannot pickle <type 'geoprocessing Layer object'> objects”

I'm attempting to speed up a process which is currently running synchronously, by using the python multiprocessing module. I'm having trouble sending a feature layer to a function which is called by ...
2
votes
0answers
46 views

Run a large model by calling it in a python script?

I've created a rather large model containing a sub-model that calculates the volume of water basins(playas) in a relatively flat area of Texas. The volume is taken from one foot slices of each each ...
2
votes
0answers
18 views

Run an ERDAS Imagine pmdl (or bcf) via Python?

How (or is it) possible to run an Erdas Imagine .pmdl model from a Python script? I have successfully run .eml models but cannot get the syntax right for .pmdl Here is what the line I want to run ...
2
votes
0answers
36 views

Python and gdalwarp: change resolution of raster

I am new to GDAL and have been having some hard time figuring out how to change a raster's resolution and how to align it to another existing raster. I have come to the point where I have a raster ...
2
votes
0answers
49 views

Where is my Polygon?

I created this script to merge all of the polygons in a shapefile into a single polygon. I am using Python 2.7.5, Shapely 1.3.0, and Fiona 1.1.5. def merge(path_in, path_out): #Import Libraries ...
2
votes
0answers
37 views

Any solution to mosaic Modis MOD13Q1 using batch file?

I have a Modis MOD13Q1 product for Pakistan, four tiles cover my complete area and I have data consisting of 14 years, after every 16-day interval. I want to mosaic them using a batch file which ...
2
votes
0answers
30 views

Memory layer or QgsVectorFileWriter Error?

Currently this excerpt of code will not save to file (as it is supposed to). The memory layer is visable and editable. Yet even when manually saving the layer, any priorly added features ...
2
votes
0answers
39 views

(How) can I write string data to a raster with Python/GDAL?

In Python, I have a NumPy array of string values (categories of some variable) that I'd like to write to a raster file (.tif or .img) using GDAL. The impression I get is that it's not possible to ...
2
votes
0answers
30 views

Align & Sum Grids in Python

I have two grids. One, call it A, is 4320x2160 cells and spans the whole globe. The other, call it B is 8640x3432 and spans the circumference of the globe, but is clipped toward mid-latitudes. Both ...
2
votes
0answers
51 views

Saving/Loading QGIS style .qml and avoid specified symbology

Is it possible to save QGIS styles without the symbology style? This may seem like a strange question, but I am trying to automatically set the ValueMap widget under layer properties via a plugin for ...
2
votes
0answers
19 views

How to snap dangling nodes with prescribed angle?

I have got a streets shape file, to snap the dangling nodes in ARCGIS. But, I have to snap only some nodes(of feature) with a prescribed angle (green node in the image, and the angle marked in ...
2
votes
0answers
25 views

Polygon parcel division in python

Is there an open source tool or module in python that does parcel division of polygons like in ArcEditor?
2
votes
0answers
46 views

Why does python reads only the no data value from GeoTiff file?

I had a number of tiff files with a country's map. They had different rows, columns or different projections etc. I needed to make them with same projection, spatial resolution and same number of rows ...
2
votes
0answers
59 views

Create a simple WPS client

It looks like the only way to get flat files/data from a WPS service is to use a client. I'm looking to create a super-simple WPS client in Python 2.6 (or other language) without any dependencies on ...
2
votes
0answers
42 views

how to make a list of features constructing the dissolved feature?

I need to simplify my road network using the dissolve function to remove nodes not occurring on the intersections. the following code is doing that. arcpy.Dissolve_management(self.address_cor_layer2, ...
2
votes
0answers
58 views

How to detect turns of a route?

I'm doing a Python simulation of a vehicle, driving along a specified path. I generate dummy GPS readings, that fetch the current position of the vehicle, with some randomized error added. After a ...
2
votes
0answers
48 views

How to add nodes into graph

I'm new to qgis and in here I want to find a path between two selected points on the map(Roads-vector layer). The points are selected by the user, using mouse clicks. So here I used the astar ...
2
votes
0answers
280 views

Running x64 bit geoprocessing Python in Python IDLE 2.7.6 x64 error

I am trying to set the Python IDLE 2.7.6 x64 to run the arcpy module from ArcGIS x64 bit geoprocessing (10.2.2). I copied the file DTBGGP64.pth from C:\Python27\ArcGISx6410.2\Lib\site-packages to ...
2
votes
0answers
88 views

Convert a classification image to aggregated polygon in shapefile using gdal/python

My goal is convert a 2D numpy array to shapefile. The matrix results from a classification, so the numbers have a meaning. I solved my problem, but the solution is somehow involuted and complicated. ...
2
votes
0answers
63 views

Can't remove the little islands when creating a svg map with kartograph.py

I'm new to python and to kartograph. I'm using it to create a map of France, Italy, Portugal and Spain. But I don't want the little islands (mainly the French ones ), causing the generation of a big ...