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

learn more… | top users | synonyms

1
vote
0answers
189 views

How does QGIS execute Python plugins?

I am trying to run a python script from within a python plugin. The script runs a CGIHTTPServer in a separate thread. It works as expected when executed from the command line and i can issue requests ...
1
vote
0answers
45 views

Is it possible to script ISIS Mapper?

Does anyone have any experience of scripting or batch processing with ISIS Mapper? I am working on a large modelling and mapping project that will require the processing of significant numbers of 1d ...
1
vote
0answers
147 views

zonal statistics in Python crashes

I have a python script that works (it's worked for several other projects in the past and it worked for my current project initially). But whenever I run it, Python crashes sporadically. It would go ...
1
vote
0answers
75 views

How to get the geometry of a polyline to a specific precision?

In python, I use point = geom.asPolyline() but it looks like I am not getting any precision just whole numbers? How can I get the geometry and a certain precision?
1
vote
0answers
58 views

QGIS Loaded Plugin Access

Fellow Users, Can you plz tell me how I can programmatically (or from the console) access the loaded plugin list? I tried: QgsProviderRegistry.pluginList() but got: TypeError: ...
1
vote
0answers
277 views

Why won't this PostGIS query display in QGIS

I am having trouble rendering the following PostGIS query in qgis1.803. SELECT s.musym, st_intersection(s.the_geom,f.the_geom) as geo, nextval('"soilsplittersequence"'::regclass) as k From ...
1
vote
0answers
50 views

How to call a method when self.iface.actionSelectRectangle().trigger() is released?

In my QGIS python plugin I use "self.iface.actionSelectRectangle().trigger()" to select features. I also have a button which changes the attributes of the selected features. Is there a way instead ...
1
vote
0answers
192 views

Hack to change data source of a layer file in ArcGIS 9.3.1 with python?

I'm looking for a way to change the source of my layer file using python. Actually I want to do this because I need to re-use a XSL template which is defined under the tap HTML popup of the layer ...
1
vote
0answers
110 views

How can I draw an ellipse filling the dataframe with ArcPy?

I need to modify one of my template scripts to draw a circle from the centre of the (inset) data frame to the edge of the data frame. This will then be used to clip the data frame to shape. I'm using ...
1
vote
0answers
460 views

Looping multiple feature classes in python for ArcGIS 10

I currently have a large list of feature datasets and dbf tables in a geodatabase. I would like to join each shapefile with its matching DBF file using the "Make Query Table" tool and then "Copy ...
1
vote
0answers
163 views

Reclassify ESRI raster using variables from a SQL Server table (connecting with pyodbc)

I am trying to reclass a raster file (representing vegetation and land cover types) using values stored in a SQL Server Express table. I have a set of ~400 species records in the table, with each row ...
1
vote
0answers
132 views

produce images with shapefiles and OpenStreetMap

I have a python file http://pastebin.com/jzwE6c6P which iterates over the features of a shapefile and renders a simple image by zooming to the bounding box of each feature. What I need is ...
1
vote
0answers
409 views

Python batch text replace crashes some ArcGIS10 MXD on reopen

In an attempt to teach myself some Python, I am writing a script that will loop through a netwrok directory for all MXDs and when found, replace layout text elements with dynamic text element ...
1
vote
0answers
189 views

Geographic limit to overlay analysis in geoprocessing service

Function: I've created a geoprocessing service that serves a toolbox containing a custom python tool. This python tool selects a polygon and buffers it by 1 mile. This buffer is then used to ...
1
vote
0answers
424 views

Variable stored as NoneType in Python with updateCursor

SOLVED: although the field was not nullable (no null values), a glitch created one in the heading field, so the variable was stored as a null value and thus the NoneType. I am using updateCursor to ...
1
vote
0answers
376 views

Scipy: Convert RGB TIFF to grayscale TIFF and output it on Matplotlib

I want to manipulate RGB bands in a TIFF file and output the grayscale map on matplotlib. So far I have this code, but I couldn't get it on grayscale: import scipy as N import gdal import sys import ...
1
vote
0answers
352 views

how to create shape file table from text file in QGis python

I have a text file with all field information how can create new polygon shape file table with the text file.. text file having following content.. NAME LAYER GM_TYPE KML_FOLDER ID PERIMETER ...
1
vote
0answers
111 views

refactoring an XSLT processor with minor changes

having an extremely large xml-file - which is derived from the field of geo informatics. i got it from a German subsite or the OpenStreetMap-Project: the Geograpical-Engineering-site that deilvers a ...
1
vote
0answers
133 views

Polygon symmetry detection

I was wondering if there was any way to create main axis (axis of symmetry) lines for polygons. I have polygons that represents buildings. I will want to find main axes (axis of symmetry) for those ...
1
vote
0answers
551 views

Python script for running ArcGIS10 Area Solar Radiation tool

I am trying to run the Area Solar Radiation tool using a Python script, because I want to run it on several DEMs at once. I am using a server with Windows 7, ArcGIS 10 and PyScripter. I am a beginner ...
1
vote
0answers
437 views

Large point to Polygon by buffer-join-buffer-dissolve issues

I have a few large datasets (about 10 million points) which I am buffering, then joining, dowgrading and finally buffering and dissolving. This is all in a model which works fine with sample smaller ...
1
vote
0answers
182 views

ArcGIS 10.0 - How to have GP Service make rest calls instead of Silverlight client?

I have a Silverlight client that densifies a user drawn polyline. The returned vertices from the polyline are then sent to esri elevation sample server for each vertex to find an elevation value. ...
1
vote
0answers
301 views

How do you convert a bounding box into the canvas CRS?

I need to convert the pixel coordinates of a bounding box to the same CRS being used by an existing layer. Here's the relevant code so far: # First, get the layer-coords version of the bounding box: ...
1
vote
0answers
116 views

Is Django's LayerMapping capable of putting a static value into all features?

I'm using GeoDjango's LayerMapping utility to try and import a set of features. The catch is that aside from the attributes in the source layer, I want all the destination features to have the same ...
1
vote
0answers
391 views

Access Geoprocessing results in Flex Viewer (Enhanced) Search Widget

I have Robert Scheitlin's Enhanced Search Widget up and running successfully with my MapService using ArcGIS Server and Flex Viewer 2.3. I also have a geoprocessing service that returns a point layer ...
1
vote
0answers
103 views

Copied points not intersecting the original points

I'm using an arcpy search cursor to access a Oracle database. I have a simple Python class that I copy the returned row objects into, which gives me more flexiblity than the cursor. The problem is ...
1
vote
0answers
213 views

arcgis server 10, vb.net, non pooled service, web adf

i am running arcgis server 10. i created a A.MXD file, then started arcgis server and successfully added non-pooled service using A.MXD. i also installed visual web developer 2010 express and created ...
1
vote
0answers
209 views

Validate Python Fme

i have a problem with my script for convert GDB to Excel. if s=='xls': reader=FMEReader("GEODATABASE_FILE") reader.open(param_filename_gdb) writerXls= FMEWriter("XLS_ADO") ...
1
vote
0answers
269 views

getting the correct location data with user input

I have some code others have provided, which I modified in order to run a Python script in a toolbox in ArcMap which accepts user input for a starting point, distance, and angle to create a shapefile ...
0
votes
0answers
7 views

USGS Earthquake GPS Metadata: Buffer Zones & Python

I'm making a python web crawler that gets USGS earthquake GPS data, and I'm wondering how I should process the latitude longitude pairs to see if it falls within a specified radius of a specified GPS ...
0
votes
0answers
8 views

custom toolbar combobox: issues with adding functionality

I've added a combo box to my custom toolbar in QGIS (based on this thread QGIS - Add a combobox to a toolbar), but there are two things I'd like to achieve that can't get working: first, dynamically ...
0
votes
0answers
19 views

Conducting geographically weighted regression on a raster

I have a relatively big raster file on which I want to conduct geographically weighted regression. Size of raster ~ 2 GB and number of rows is around 100,000 One way might be to convert from raster ...
0
votes
0answers
13 views

Error while running OSGeo4W setup

i'm not sure if i got a problem with osgeo4w or with python. but i get an error message if i run setup: C:\>setup C:\>Exception in thread Thread-5: Traceback (most recent call last): File ...
0
votes
0answers
12 views

QgsMarkerSymbolLayerV2 not rendering

For the life of me I cannot get a custom vector layer symbol to render. Following is the code I am using, as fas as I can tell renderPoint is never called. Is there something I am missing here. The ...
0
votes
0answers
11 views

ogr: confusing results from `SetSpatialFilter()`

My layer is derived from a data source like this: l_131 = bounds.ExecuteSQL("select * from 'nam_l' where 'ND_5'= 131 ") feat = l_131.GetNextFeature() feat.GetFeatureCount() >>> 200 It is a ...
0
votes
0answers
21 views

Help with scripts for processing raster files with the raster calculator in QGIS

I am trying to process some raster files using python scripts in Qgis 2.20, and I have been having trouble finding any documentation on using raster calculator in scripts being run in the processing ...
0
votes
0answers
20 views

Add existing QGIS plugin button to custom toolbar

Is it possible to add an existing plugin's button to a custom toolbar? I've succeeded in adding core actions such as shown below, but am wondering if it would be possible to integrate another plugin ...
0
votes
0answers
29 views

Have I created a valid Spatialite database?

I didn't manage to find the better way to populate the exisiting Spatialite database with new computed data than just creating new columns and filling them in the Python script. You can see that the ...
0
votes
0answers
20 views

Mapnik: GeoTIFF flipped (mirrored vertically)

I generated a GeoTiff using the QGIS HeatMap plugin and want to render it on top of some OSM data. The problem is that the raster gets rendered upside-down in the output. Can someone point me in the ...
0
votes
0answers
22 views

How to add the attributes of selected features to my new layer in pyqgis

I am trying to create a layer from the selected points coordinates. I am drawing a circle to the coordinate of selected points. I also need to add initial attributes of my selected features to my new ...
0
votes
0answers
16 views

Min value (OD Cost Matrix)

I have an attribute table with columns that I have gained from running an OD Cost Matrix. In one column named "Total Minutes" I will select the lowest value (the shortest route). Then I will create a ...
0
votes
0answers
9 views

In QGIS Process Modeller, is it possible to automatically run a function on several layers without listing all combinations?

Trying to develop a Model which includes finding any intersections between layers and then merging them all into a single layer. I have 12 layers in total, it's not really efficient to list all the ...
0
votes
0answers
22 views

How to calculate the area of an ellipse on the earth's surface using Python?

I have a dataset consisting of GPS coordinates. I use a clustering algorithm to generate a two dimensional Gaussian for me. The Gaussian takes the shape of an ellipse if visualized on the map. ...
0
votes
0answers
32 views

Problem reducing the width of the attributes fields of a shapefile using python

I have a shapefile with rather long attribute widths (which is resulting in a rather large file). I am trying to trim it in python, here is my code: layer = qgis.utils.iface.activeLayer() ...
0
votes
0answers
50 views

How to convert .shp file to zip file with mapnik?

I am creating android application for campus indoor map. I research so much think.I decide use osmdroid. I write here what I have done 1) I draw indoor map with JOSM. 2) I convert file.osm file to ...
0
votes
0answers
17 views

Does a road connect one grid cell to an adjacent grid cell?

So here is the problem I am working on. I have an OpenStreetMap roadmap which I overlaid with a 2-D cartesian grid. So for a given grid square, I want to find out if a road segment continues from the ...
0
votes
0answers
24 views

Check if Openlayer Layer is empty, caused by nonexistence of internet connection?

I use Openlayer Google street map as a base-map in my QGIS plugin projects. i want to check programatically if the layer is loaded or is empty and decide if i load my offline base-map instead of ...
0
votes
0answers
44 views

Intersecting Polygons

I have 10 shape files containing polygon features. I would like to produce a single polygon layer containing portions of the input polygons where no fewer than two of the aforementioned feature ...
0
votes
0answers
16 views

Using iface.showAttributeTable() on QgsVectorLayer retrieved by getObject()

I'm unsure if i'm properly using the processing.getObject() function. I'm creating a python processing script for QGIS 2.0 and 2.2, but can't seem to get an attribute table to open programmatically. ...
0
votes
0answers
43 views

Issue blocking QGIS feature form dialog with Python

I'm not sure where I'm going wrong with this python logic for a custom form in QGIS 2.0.1. There are a few things required by the validation function: that index of combo boxes aren't 0 (first index ...