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

learn more… | top users | synonyms

1
vote
1answer
196 views

Index out of range error when cleaning up variables

I'm running a script that parses points from a flat database structure into individual feature classes with related tables. A search cursor runs through and stores each field's data in a variable ...
1
vote
1answer
380 views

How create bulk field aliases for several layers within the same feature using in arcgis-10.0 using python?

I have an arcmap with ~200 layers from the same sde feature class. After I finished adding all the layers it was brought to my attention that we need to add field alaises for the attribute table. ...
1
vote
1answer
124 views

How to select and update from multiple tables?

I have two feature classes which have common Valve ID #s. One table has multiple service connections with a unique number. I need to select all services linked to each valve and collect the ...
1
vote
1answer
182 views

GeoDjango 'NoneType' error when using 'distance' function

I have a site that's working on our staging server but after copying it to the live server I am getting the following error when trying to perform a distance() call (code cut down to minimum) ...
1
vote
1answer
1k views

Automate converting labels to annotation in ArcMap at multiple scales?

I need to be able to convert labels to Annotation feature classes at multiple scale levels for both address and street data. Similar in concept to generating tiled layers for a web service, I have 5 ...
1
vote
1answer
416 views

Copying and renaming files on SDE connection

I have a script that renames and copies files (feature classes) on an SDE connection. This script works just fine if the feature class name does not start with an 'S'. If the feature class name does ...
1
vote
1answer
235 views

Arcpy ChangePrivileges_management not working

I was trying to revoke access for a user using Python script, but it does not seem to work. I mean the script runs successfully without any error, but does not what it's intended to... Here're the ...
1
vote
1answer
479 views

Spatial Analyst Cell Statistics tool in Python gives inaccurate results

My question is similar to the Cell Statistics gives Wrong Answer question. In Python, I'm using the MINIMUM parameter to execute the cell statistics tool on several reclassified rasters ('0's and ...
1
vote
1answer
278 views

Problems with python postgis polygon

I have a problem with the examples in the book "Python Geospatial Development". I can't write to the PostgreSQL database polygons from TM_WORLD_BORDERS (Chapter 7, page 202 in book). Code: src_file = ...
1
vote
1answer
436 views

How to change the the style of a vector layer programmatically?

I want to change the style of the polygon contained in the vector layer. Is there any API available? (I can click the properties of the shapefile, then select the style and change the symbol ...
1
vote
1answer
275 views

ctypes: bridge in python for a dll

I have a dll and I'd like to call it in python. The dll needs of parameters. Do you know how to pass a radiobutton parameter and a checkbox parameter? thanks
1
vote
1answer
643 views

Hotlink vector/raster files to open in current workspace in ArcGIS 10 similar to Mapinfo

I want to add datasets to ArcMap and place them in a particular group layer by simply clicking on hotlinked polygons in a shape file. The same process is easy in MapInfo and I want to implement the ...
1
vote
2answers
402 views

Adjust Picture Marker Symbols with Python? (ArcGIS 10 SP1)

I am working toward a map cache, and therefore have about 12 versions of the same datasets to be shown at different scales. Invariably, the symbol sizes I have set on highway shields (for example) ...
1
vote
1answer
744 views

Convert old ArcGIS 9 VBA tool to new Python script tool for ArcGIS 10

I have an ArcGIS .mxd file with an imbedded VBA script that is executed from a tool bar button. I would like to convert this VBA script tool to a python script tool for use in ArcGIS 10. Is that ...
1
vote
1answer
307 views

FME Feature Type with Python

Here, the python for create a list of feature type but.... import sys from pyfme import * try: log=FMELogfile("shapeToTAB.log") log.log("Opening reader",FME_INFORM) ...
1
vote
1answer
257 views

How to get a composition name in Qgis python console?

In Qgis python console: I want to populate a list with compositions names, like in Composer Manager, but I can't figure out how to get the names (titles). So far: composerlist = ...
1
vote
1answer
340 views

Opening ArcCatalog to FGDB causes application to fall over

I have some python scripts I have written to create a lot of objects. I write these, in code, to a couple of FGDB's. If I happen to open ArcCatalog in one of these FGDB's, the application falls ...
1
vote
1answer
1k views

ImportError: 'No module named pyproj'

im running mac os X with native python 2.6.1 install . Later today installed GDAL complete pkg, and added the program to the shell path on the terminal with the folowing cmd : ~: echo "export ...
1
vote
1answer
100 views

CalculateDefaultGridIndex

Has anyone found that using CalculateDefaultGridIndex in arcGIS9.3 does not return the ';' delimited string suggested in the documentation?
1
vote
1answer
607 views

Run a python script every time the page is changed in Data Driven Pages? (ArcGIS 10)

I'm setting up a Data Driven Pages mapbook mxd for a series of parking locations. I have dynamic text that updates according to the current map sheet, but I also have text that needs to update using a ...
1
vote
0answers
26 views

Managing large number of catchments/watersheds

Does anyone know of an easy way to manage a large number (10,000's) of catchments/watersheds? I have defined a stream network and for each segment, I have a corresponding catchment (in a unique ...
1
vote
0answers
41 views

How do I smooth edges of polygons in QGIS?

Is there a built in function or plugin I can use to achieve smooth lines for my polygons instead of the blocky ones I have now?
1
vote
0answers
32 views

Decompress a LZW-compressed GeoTIFF

I have a LZW-compressed GeoTIFF file and would like to split it into several smaller regional files and change the format to png. I tried to do the spliting with gdal_translate -srcwin. I only get a ...
1
vote
0answers
31 views

How can a script tool share (dynamic) variables among different modules?

I'm running a python script from the toolbox window (as a script tool). I have a second python (tkinter) module that I use as an input interface. Now, I know that the script tool can call the ...
1
vote
1answer
23 views

PGRouting Layer plugin error in QGIS 2.2

I am trying to do some basic computations using the PGRouting plugin for QGIS, but I am getting this error all time: An error has occured while executing Python code: Traceback (most recent call ...
1
vote
0answers
19 views

PyScripter crashes at “import processing”

I set up PyScripter latest version, 2.7) to work with QGIS (2.2, OSGeo4W install) following http://chelahmy.blogspot.ca/2011/02/setting-up-pyscripter-for-quantum-gis.html. It generally works well. I'm ...
1
vote
0answers
38 views

using arcpy to query sde database in python

I have three variables: view_name, column_name, and column_content. column_name contains id, name, address, etc. column_content contains 123, John, 200 King st, etc. user specifies the column_name ...
1
vote
0answers
15 views

Can i use CreateMapSDDraft in the arcpy.mapping library to set the scale range on tiled services at 10.1?

I know that esri has exposed many properties to the acrpy lib for publishing services. I need to published a tiled/cached map service but i need to set the min/max scale when i do that. Can this be ...
1
vote
1answer
72 views

Python: Ray-trace a WGS84 point with heading and distance

One of my services defines geofences for a mobile app. The geofences consists of a lat/lon pair and radius in meters, in JSON, e.g.: { "geofenceId":"geofence_b39da38cff7be4b4693cbc31b2394bbb", ...
1
vote
0answers
33 views

QGIS Custom Form: “Other” category in combo box replaced by line edit

I am trying to create a custom form for QGIS with comboboxes containing an "other" category. I wonder how to provide a line edit to enter info replacing the "other" choice if chosen. Not sure if I can ...
1
vote
0answers
26 views

model to connect points with line and set the digitize direction according to height

I'm trying to develop a tool that connects a point layer (manholes) with lines (waste water pipes) and sets the line direction according to an height attribute acording to gravity(from high to low). ...
1
vote
1answer
37 views

QGIS 2.2.0.1 Valmiera, Windows 7 64 bit - copying out of GDALInfo-Window in QGIS not possible

When trying to copy information given out by GDALInfo with different kinds of raster data (DEM, normal georeferenced images etc.) through the interface of QGIS 2.2 by right-clicking and choosing copy ...
1
vote
0answers
59 views

Running python script outside of Arcmap's python console

My codes works fine in Arcmap's python windows. But when I try to run it in a command promt windows, It says that; ERROR 000837: The workspace is not the correct workspace type. But it works fine ...
1
vote
0answers
34 views

How to use GDAL on Heroku?

I have a geospatial python app that I want to use on Heroku. This is my requirements.txt file: Flask==0.10.1 Jinja2==2.7.2 MarkupSafe==0.19 Werkzeug==0.9.4 gunicorn==18.0 itsdangerous==0.23 ...
1
vote
0answers
49 views

Editing QGIS point layer: retrieve attributes of intersecting line layer

I'm creating a custom editing form using QGIS 2.0 and would like to modify the mouse event when creating a point. I've gotten a start by reading this thread: How to programatically check for a mouse ...
1
vote
1answer
29 views

GeoDjango Scale/Layers issue?

I've been having issues visualising data from a shapefile in GeoDjango using OpenStreetMaps. I believe it's some sort of a scale issue because of how it appears(as you can see in the screenshot of the ...
1
vote
0answers
22 views

Delayed moving average

I want to develop a plot of delayed moving average. The code for this in MATLAB is: nr_pontos = 36; coefs_filtro = ones(1, nr_pontos)/nr_pontos; data_dma = filter(coefs_filtro, 1, data); ...
1
vote
0answers
32 views

Plot data to make charts using vincent/python [closed]

I am trying to plot data using vincent. But couldn't extract the graph or see the desired results as shown in the website. https://github.com/wrobstory/vincent import vincent list_data = [10, 20, 30, ...
1
vote
0answers
75 views

Mac QGIS 2.2 error executing Python code

Newbie Using QGIS version 2.2 with Python 2.7.5 on OSx 10.9.2 Getting the following error. Any idea on how to resolve? I'm not sure if it has ramifications on the display of the Google data. An ...
1
vote
0answers
20 views

Changing the symbology of layer when converting from Layer to KML using Python

Is it possible to change the symbology of a layer file using Python? I have a script that creates a layer file and converts it to kml, but every time I run it the symbology color in the kml of the ...
1
vote
0answers
42 views

Batch Clip (Editing Session)

I'm trying to correct some topology errors in my geodatabase, now focusing on two feature classes: grass and buildings. They must not overlap. However, there are plenty of spaces where the grass was ...
1
vote
0answers
32 views

PyQGIS Dialog Plugin not resetting

I have written a PostGIS search plugin that works pretty well, except two things that I just cannot figure out a solution 1) When the dialog closes and then is reopened the previous query is still in ...
1
vote
0answers
43 views

How can I draw features on GeoTIFF in Python?

I have a set of data (coords + value) and want to turn it into a heatmap in GeoTIFF. Should I calculate pixels and set them as array, or there are shortcuts? This is what I do now: driver = ...
1
vote
0answers
15 views

Able to circumvent QgsCredentials script called from Pre-execution

I've got a stored project that, when opened is connecting to my PostgreSQL DB, and is loading several layers. All good. I'm using a script that is called from Pre-execution (Processing/Options and ...
1
vote
0answers
33 views

ArcGIS Geoprocessing Service fails on data loading

I have a Desktop Script tool that works fine when run on desktop, but does not work when the results are turned into a geoprocessing serice. Running ArcGIS 10.2 on Desktop and 10.2 on server. I have ...
1
vote
1answer
71 views

Load and display a layer using PYQGIS

I'm having a go at using pyqgis from within the QGIS python console to load a layer from SQL Server and display it. I feel like I'm part way there but I'm having a real issue getting the layer to ...
1
vote
0answers
68 views

How to use paths with non ASCII characters for subprocess calls with ArcGIS

I know that it is possible to create calls using unicode character encoding like \xf8 for non ASCII characters but how do I do it writing a path in a script just like: 'e:\gis\python_ø\notepad.exe' ...
1
vote
1answer
57 views

Gdalinfo and QuantumGIS does not recognize Spatial Reference even though Python does

I apply the following Spatial Reference to a file: spatialRef = osr.SpatialReference() spatialRef.ImportFromEPSG(3411) outraster.SetProjection(spatialRef.ExportToWkt() ) geotransform = ...
1
vote
0answers
30 views

How to replace accented strings in attribute tables using Python or VBA ArcGIS 10.2 [duplicate]

I need to replace accented words, into the Field Calculator, to the same non-accented ones. For example: María ---> Maria Need some help with this VB Code: Dim data as integer Dim contador Dim ...
1
vote
0answers
12 views

ArcGIS 000210 error copy to feature class [duplicate]

I have a script tool that: Creates a feature dataset within a file geodatabase Performs a Select by Attributes on a cadastral layer Copies the selected polygons into the feature dataset. The copied ...