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

learn more… | top users | synonyms

6
votes
1answer
418 views

How do I call external files in Python Geoprocessing Service?

I have created a Python script which calls an R script and then reads the output back into Python. I can run this tool in ArcGIS Desktop (10.2.1) and it works fine. When I publish as a geoprocessing ...
4
votes
1answer
64 views

SQL-query in arcpy - SELECT WHERE feature between two values

I need to select features between two values in python with arcpy. However, whenever I try to run the code below, it returns with error message "An invalid SQL statement was used". whereclause = ...
4
votes
1answer
345 views

QGis Zonal Statistics Plugin NoData included in Calculations

I have been trying to use the QGIS zonal statistics plugin. My raster has a nodata value of -99999 and all other values are positive. After computing the mean zonal statistics there are a number of ...
3
votes
1answer
31 views

QGIS using the heatmapplugin from the console

I have to make a lot of heatmaps from csv's. Therefore I'm making a python script to run in the console. So far I can load csv's and save them as shapefiles. To get to the heatmapplugin I'm using the ...
3
votes
1answer
63 views

No get more option in QGIS

I have recently installed QGIS and trying to work with it but I don't see this option "Get More" at all. As suggested by some previous source, I also checked whether I am behind a proxy but that isn't ...
3
votes
1answer
67 views

Is there a tool to track edits that were made?

Is there a tool/report that keeps track of what edits were made that I could run prior to or after reconciling my versions? This would help me to know if there are any changes I need to make to any ...
3
votes
1answer
252 views

How come “Zoom to Polygon” always puts me in the middle of Nebraska?

This is an issue related to this question I'd asked a few days ago. I've got that code working, to an extent. Every time, though, that I double click on one of the Polygons in the attribute table that ...
3
votes
1answer
170 views

draw lines with an angle inside a rectangle in python

I am trying to make a plugin for Qgis with python. I have the four corner coordinates for a rectangle. I want to give the user the inputs, line space and angle (0 -180 degrees). With these inputs, I ...
3
votes
1answer
228 views

How to clip a Oracle query layer directly in a Python script?

I have a query layer directly running from ORACLE database in a MXD. I want to clip this layer with a layer being created in another MXD in a Python based tool. My question is to do this clip ...
3
votes
1answer
893 views

Multiline VBScript Label Expressions in Arcpy

I am able to set simple label expressions, but when I try to set multiline expressions (which all VBScript expressions are) it does not get copied into the expression box properly. I have tried using ...
2
votes
1answer
56 views

Is it possible to render a large number of shapefiles to a pdf document using Python?

I'm extremely new to GIS, and recently made a map by loading a bunch of shapefiles into QGIS using a python script. However, it took 15 mins to scroll in or out on the image, and the pdf export ...
2
votes
1answer
37 views

GDAL Warp to clip a .tif: Works fine standalone, won't work in Python

I am trying to use the subprocess module to call gdal warp and clip a .tif using a shapefile. When I try the command in GDAL it works fine, but when I attempt to call it into a Python script it will ...
2
votes
1answer
129 views

calling gdal_merge.py into another python script running GDAL processes

Good Afternoon All, I am wanting to use gdal_merge.py to merge a series of .tif files prior to clipping the merged file to a shapefile boundary, but want to do so as part of another larger script ...
2
votes
1answer
79 views

PostgreSQL PL/Python Function for “IF” condition

I am using OSM data to run pgr_dijkstra() for weighted-path calculation. But after importing OSM data using osm2pgsql I populated some additional columns into my ways table. So now it has gid serial, ...
2
votes
1answer
68 views

Loading features attributes into numpy array

I am currently working on an add-on that relies on the user choosing fields of tables (that can be from shapefiles, csv or dbf) that are open in QGIS and then making computations with such data. ...
2
votes
1answer
76 views

ringer: help convert simple plugin to new QGIS 2.x

I have been trying to get this simple plug-in to work on QGIS 2.x. So far i got it to load, but it does nothing! all that it is supposed to do is place a polygon where a hole (ring) is. The code is ...
0
votes
0answers
127 views

How to use the QgsMapToolIdentify in PyQgis?

I'm trying to implement the QgsMapTollIdentify class in a stand alone app but I can not. I am a newbie in Pyqgis and would like to ask how do I implement this class in Python? Thanks! Completing, ...
0
votes
0answers
163 views

Error in Select Numeric type column in pyodbc with ArcCatalog

I created a python script that uses "pyodbc" plugin to connect a SQL Server database and write out data. It was imported in an ArcGIS 10.1 tool and run from there. try: arcpy.AddMessage('FLAG 0') ...
0
votes
0answers
298 views

GDAL/OGR to extract pixel values

I want to use GDAL/OGR to extract pixel values from a raster file. The extraction should be based on polygons, stored in a shapefile. My thought was to iterate over the features in the shapefile, ...
0
votes
0answers
240 views

How to integrate .NET application in QGIS using Python?

In our company we have developed a .NET application that's now integrated with 3 different GIS platforms. Now we would like to make it work with QGIS but we need some help on getting started. I've ...
0
votes
0answers
52 views

QGIS Gazetteer Plugin connection to internal database

A few posts on here mention that the Astun QGIS-Gazetteer-Plugin could be adapted to reference a PostGIS database. Has anyone done this adaptation and could share it? I want to use a gazetteer stored ...
0
votes
0answers
62 views

detect signal where delete polygon in qgis?

I am working with QGIS and i want when i delete a polygon and then i commit this action I detect the signal of this operation and use it in python script, I tryed this but dont work: def delete(): ...
0
votes
0answers
36 views

How to use na.Solve() on layers already created?

I am fairly new to arcpy and I am having troubles recreating the following set of instructions with a python script. Open the KeyChainTest.mxd Enable the Network Analyst extension. Click solve on ...
0
votes
0answers
212 views

Issues when importing line shapefiles into NetworkX

Note that although I am using Python Console from within QGIS for this, I don't think it's a QGIS issue. Below is the difference of how NetworkX is dealing with 2 line layers created by the same ...
0
votes
0answers
72 views

How to export png to file system with python?

I use python to make a plugin that contains shape file,color_bar,time_bar 3 items above now I want to export my result to a png image After I find the method to do it I find a similar way to ...
0
votes
0answers
188 views

SEXTANTE runalg and QgsVectorLayer issue

I'm trying to make a script for converting polygons to lines. But I'm having some issues while generating temporary layers. In this script, I iterate through all the features of the input layer to ...
0
votes
0answers
298 views

Create a polygon shapefile using point as boundary

Following have two problems: I am now have 4 point in a shapefile and I want to set the point's coordinate for boundary of a polygon The points are xmin, xmax, ymin, ymax that can just be a ...
0
votes
0answers
163 views

Dynamically generating data for map tiles from Python function

I'm brand-new to GIS and relatively new to web services. I've found a ton of great resources on the web, but I'm having trouble addressing one specific issue: One of the data layers on my planned map ...
0
votes
0answers
84 views

Sextante script for statistic info

I want to generate a script for getting statistic information window from selected feature. For example i have two layer building(polygon) and railway(linestring). By using this tools i got a window ...
0
votes
0answers
36 views

How to change value of an Line edit dynamically

I create a form in QT4 and compile with pyuic4. it create an form.py I want to modify the value of the line edit dynamiclly with code. I put this code in the form.py but never happen: ...
0
votes
0answers
222 views

python script to calculate and return values based on several conditions

I need to calculate and return the value "continuous" to those records in a polygon feature class with species records aggregated to a UTM grid considering the attributes are species name, grid code, ...
0
votes
0answers
49 views

How specify a corridor minwidth?

I’m trying to make a corridor between two substations with ArcGIS, a macro corridor and a micro corridor. I have two questions in this respect and would be grateful for your suggestions. a) How can ...
0
votes
0answers
72 views

Congressional Redistricting

I have a project coming up where I need to create new congressional district looking at only total population data. I am planning on using the census tract level of data, but I am having some ...
0
votes
0answers
545 views

Problem reading attribute with Python using osgeo.ogr

I am working thru "Python Geospatial Programming" and I have a problem in a program in Chapter 6 that I cannot seem to solve. The small program: import osgeo.ogr shapefile = ...
0
votes
0answers
90 views

Create Vertex and add empty attributes to it

How can I create a vertex(and then a point feature on the vertex) on a polyline and give it some empty attributes(create fields), move an existing vertex, delete vertex? I am in ArcGIS environment and ...
0
votes
0answers
206 views

mapnik error - fatal flex scanner internal error--end of buffer missed

I am using Mapnik 2.0.1rc0 on a Windows 7 with python 2.7 32bits inside a GeoDjango App. I often got this error: fatal flex scanner internal error--end of buffer missed that makes python to crash ...
0
votes
0answers
179 views

Help in GRASS/QGIS/Python

I have Idea about ArcGIS, and a bit of QGIS and zero programming knowledge, which I am trying for thesedays. I saw GRASS GIS and have started working with shapefiles, which are not being loaded... :( ...
0
votes
0answers
273 views

Select record from table attributes in QGIS and Python

Can anyone tell how I can access to the attribute table of a shp and select a record from a specific row and column using Python (with console or a script). I've been looking for in the qgis API, but ...
0
votes
0answers
59 views

Why don't libgrass.so.1.8.0 and libqgissqlantconnection.so.1.8.0 load?

I have compiled Qgis 1.8 at Ubuntu 12.10, but some phyton plugins does'nt work, like sextante. Trying to solve this problem, some files don't have been load. They are: libgrass.so.1.8.0 and ...
0
votes
0answers
274 views

How to use raw_input() in QGIS python console?

I'm hoping to use raw_input() inside a loop to prompt the user when s/he wants to continue running the script. However, I'm getting an error: Traceback (most recent call last): File ...
0
votes
0answers
169 views

using mapnik xml file to render tiles in python

Is it possible to use an xml file in python? without using the bindings for python for mapnik. basically i'm using django/geodjango, postgis and well i decided i'd try and design the map on tilemill ...
0
votes
0answers
592 views

Python package for Google Maps API v3?

I am looking for a Python package that can generate the JavaScript to display Google Maps API v3. I would like to integrate such package into a django website. I know pymaps exists but it's for ...
0
votes
0answers
121 views

How to access the rules of QgsRuleBasedRendererV2 using python?

I can't get access to the rules of rule-based renderer, python says there's no attribute "rootRule", though documentation says it should be (http://www.qgis.org/api/classQgsRuleBasedRendererV2.html) ...
0
votes
0answers
147 views

Can I do full SQL expressions through the “WHERE” clause in UpdateCursor?

Run as a standalone python script for a shapefile in a toolbox on ArcMap. For example: psql_url_pop = '''SELECT shapefile.NAME_# + shapefile.WIKI_URL FROM public.shapefile''' rows = ...
0
votes
0answers
101 views

How to create a pop up attribute table for each crash located on a roadway segment in arcmap

I am trying to create a simple user interface that displays information for each crash located on the routes. I also need to display a graph along with that. I am a beginner in Python with no prior ...
0
votes
0answers
154 views

How to build QGIS with Python on Redhat?

I'm attempting to run QGIS on Redhat 5 64 bit architecture. Version of Python is 2.4.3. Version of QGIS is 1.7.4 (wroclaw). When I run qgis, the splash screen appears, followed by a QMessageBox that ...
0
votes
0answers
161 views

Export Data Driven Pages extents to Kmz

Is it possible to export the extents of DDP to KMZ using arcpy - Map to KML (Conversion)? Alternatively can we export each extent of a single DDP extent to a new mxd and then run arcpy.MapToKML_3d on ...
0
votes
0answers
150 views

How to enable user to specify field mappings from a table joined to a feature class?

I have a feature class and a new table every few days. I need to have the table's attributes added to the feature class based on a join. What would be a good interface in ArcMap to let the user map ...
0
votes
0answers
259 views

Missing QGIS python plugin database connectors

I am working with python plugins for QGIS.I developed my plugin and inorder to incooperate the same into QGIS i copied the folder in C:\Documents and Settings\comp90\.qgis\python\plugins I opened ...
0
votes
0answers
100 views

Is there a better method to fix empty pixels after classification?

empty pixels occurs after classification - in arcmap you can use Generalization tools such as majority filter. However is there a script you could write to better fix it? for example - some of the ...