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

learn more… | top users | synonyms

3
votes
0answers
495 views

How to convert length in Decimal degrees to meters programmatically?

I'm new to qgis and I want to find the length of some roads in a map. So I used the following code, from shapely.wkb import loads def getLength(): layer = ...
3
votes
0answers
388 views

How to use Python's subprocess module in a for loop ArcGIS?

I am new to scripting with ArcGIS. Although this might be an easy thing for those that know Python well, I haven't figured out how to use the subprocess module in a script. I actually think I'm ...
3
votes
0answers
88 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
129 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
216 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
84 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
525 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
83 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
161 views

PyQGIS: How to color raster layer with existing colorBrewerMap

With pyqgis I have added multiple new raster layers to the legendinterface(). Because i like the ColorBrewer style i want to color some of them with the "Spectral" gradient. How can I do this in ...
3
votes
0answers
200 views

python equivalent of spatstat's spatial point process functions

Is there a free python package (i.e. PySAL?) that implements the standard summary statistics for spatial point processes, e.g. the F, G, J, and K functions? I'm happy to use R (i.e. spatstat) if ...
3
votes
0answers
176 views

Calculate size of area where data values exceed certain limit

I am using Python and Basemap to plot sea ice concentration within the Arctic region. I need to calculate the total area (square meters) where the sea ice concentration exceeds a certain limit (e.g. ...
3
votes
0answers
256 views

Accessing existing instance of qgis from stand-alone python script

For my own data analysis pipeline, I am running a split screen setup with iPython notebooks on one side, generating variables from source data, pushing them to a csv file which qgis then reads/joins ...
3
votes
0answers
212 views

Generate tiles using GPU

I was wondering if anyone has tried already to utilise the GPU in tile generation? I have a quite big dataset so tile generation takes a while (especially on high zoom levels) even on a quite high ...
3
votes
0answers
697 views

Is there a way to execute FME transformers from a PythonCaller script in an FME workspace?

I have a very large and complex Python/arcpy script that does lots of custom calculations, and I am trying to port it to an FME environemnt. The script runs beautifully under ArcGIS. The problem in ...
3
votes
0answers
190 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
261 views

python.multiprocessing and “FATAL ERROR (INFADI) MISSING DIRECTORY”

I have a question which is closely related to this old question here: python.multiprocessing and "FATAL ERROR (INFADI) MISSING DIRECTORY" I have also looked at this, which seems to relate ...
3
votes
0answers
501 views

Buffering a Raster with GDAL and Numpy

I am using GDAL to convert a raster dataset into a numpy.array and then using numpy to buffer the data in the raster. For example, I need to know all the regions within 100ft of a school point ...
3
votes
0answers
248 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
388 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
538 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
533 views

ogr.GetDriverByName('FileGDB') returns None

I installed: gdal-110-1600-x64-core.msi GDAL-1.10.0.win-amd64-py2.7.msi gdal-110-1600-x64-filegdb.msi from www.gisinternals.com I can open my gdb on the command line: C:\data>ogrinfo ...
3
votes
0answers
543 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
142 views

traversing KML files with ogr python

i'm new to OGR processing and KML format so be gentle: i've got a series of KML files all containing multiple regions partitioning a larger area in each. i also have a series of geocoded points for ...
3
votes
0answers
488 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
245 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
80 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 ...
3
votes
0answers
689 views

Add CAD Drawing Dataset into ArcMap using Python

I am trying to add an CAD Drawing Dataset into ArcMap using Python. Question is how to add a Auto-CAD .dwg file to ArcMap using Python Normally comes in as CAD file within a Group layer with: ...
3
votes
0answers
223 views

Setting border-style to 'no pen' using QgsGraduatedSymbolRendererV2

I am developing a QGIS plugin that, after a series of inputs, will produce a thematic map using the QgsGraduatedSymbolRendererV2. Because the polygon are very small, the boarders make it such that ...
3
votes
0answers
144 views

How to change the QGIS help dialog?

I am working with python plugins for QGIS. I am done with my one of my .py file using python 2.5 and pyqt4. It is just help file for QGIS, which i changed. I wanted to incorporate the same in QGIS. I ...
2
votes
0answers
83 views

How to generate surfaces of different heights from LIDAR points

I am seeking a way to generate surfaces (polygons in a 3D space) of different heights from LIDAR point clouds, whose spacing is 4 points per square meter. The typical application is like roofs, which ...
2
votes
0answers
41 views

How to convert Shapefile to KML in Python

My goal is to extract certain shapes from a shapefile, and render the chosen shapes in a KML file. From searching gis.stackexchange, I was able to piece together the necessary components, and the ...
2
votes
0answers
49 views

Image stacking with Python/Gdal

I am trying to accomplish some image stacking task in python. I am not proficient in Python and was hoping I can get some guidance to get started. So I have large number of landsat images. Landsat ...
2
votes
0answers
35 views

Rasterizing Shapefile, using other shapefile as Mask

I have a shapefile (ShapeY) of European extend and want to rasterize each time only a certain area of the shape (ShapeX) (i have the shapes indicating the prevailing extend) with python and QGis. ...
2
votes
0answers
29 views

Non-zero error with ImportFromEPSG() in GDAL/OSR/Python

I'm currently getting an error when testing ImportFromEPSG() on my GDAL. import osr testSR = osr.SpatialReference() testSR.ImportFromEPSG(4326) #this returns value of 6 print ...
2
votes
0answers
24 views

Reading raster attribute table using gdal in python

Is there a GDAL function that can read in a raster attribute table? Something functionally similar to this function in pygeoprocessing: ...
2
votes
0answers
40 views

How to use ST_VoronojDiagram for points that are almost aligned?

I am trying to use the spatialite ST_VoronojDiagram function on a table containing four 4 points that are almost aligned: (1.01 2.02, 2.02 3.03, 10.01 10.02, 11.01 11.02). I wrote the following script ...
2
votes
0answers
32 views

QGIS Function Editor/ Python question

I'm currently using the layer_property(layerName,'source') to produce a list of copyright statements for the Print Composer by putting that in an if() statement. However, that isn't very flexible as ...
2
votes
0answers
51 views

Deployment of optical fiber QGIS Python

The subject that I’m working on is the deployment of optical fiber . I have a shapefile which represents a country containing homes. And I have another shapefile representing an infrastructure plan of ...
2
votes
0answers
25 views

Writing 3 channels to 8-bit TIF in Python using gdal

I have some Python code to write 3 channels to file. Here, channels is an array of 3 numpy 2D-arrays (RGB), outfile is the filename, and rows and cols are the image dimensions. def ...
2
votes
0answers
56 views

Use QGIS API on standalone python program without install the entire application

I developed a standalone python program that makes use of QGIS API to create .qml files from sld files. This is a small program of about 15 lines of code that imports the following modules and uses ...
2
votes
0answers
21 views

Open QGIS project files in exclusive mode / alert if project file already in use

I have QGIS-Project-Files saved to a network drive and was wondering if it is possible to warn users that a project file is already opened by an other user to prevent concurrent editing of the same ...
2
votes
0answers
35 views

How to use GDAL RasterizeLayer (python binding) -where flag

I am trying to use GDAL RasterizeLayer python binding, but I can not find a way to use the -where flag. The 'pure' GDAL command I am trying to run is: gdal_rasterize -b 1 -burn 0.00001 -where ...
2
votes
0answers
29 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. ...
2
votes
0answers
33 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
126 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
31 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 = ...
2
votes
0answers
35 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
133 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: ...
2
votes
0answers
51 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
82 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 ...