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

learn more… | top users | synonyms

1
vote
1answer
50 views

How to use in_field_map parameter of CreateCompositeAddressLocator_geocoding?

I would like to know if anyone who has worked with the CreateCompositeAddressLocator_geocoding method knows how the "in_field_map" parameter is formed?
1
vote
1answer
164 views

Dissolving stream orders using Python rather than VB script?

I've been trying to dissolve streams, using orders programatically and I came across this VB script. The reason is that if I use ArcGIS dissolve, it merges the confluence of the same orders. I would ...
1
vote
1answer
65 views

Styling map elements based on their properties

I am currently generating tiles based on OSM data using Mapnik and Python and am quite happy using the XML styling but I am at a loss as to how to vary the styling on an element by element basis. I ...
1
vote
1answer
153 views

calculating terrain elevation line

I found too many hits on the web to even see the right direction to go. I have to provide a small proxy server serving requests for a line of terrain elevation data between two coordinates. It is a ...
1
vote
1answer
565 views

Slow tiles generation for leaflet js

I am currently trying to use leaflet to display images (jpeg or png) instead of maps, I have followed the instructions on this blog post to create the tiles using gdal2tiles.py here is the code we ...
1
vote
1answer
971 views

Data Driven Pages and exporting PDF using Python

I am able to zoom into map_index shapefile rows for a group of mxd documents in layoutview and export zoomed record as a PDF document at the same time. I tried to combine below codes to make the ...
1
vote
1answer
177 views

How to programatically replace ArcGIS Online image with new imagery in mxd's?

I have many mxds that previously used ArcGIS Online Bing imagery. I want to replace those with newly purchased imagery. I know I need to use the arcpy.mapping.MapDocument module to do this though not ...
1
vote
2answers
769 views

How to add field attribute values from line features to polygon features they pass through using Python?

I have a set of polygons and I want to add a field with the name of the streets (from another feature class of streets) that are within each polygon. Using Select Features by Location, I select ...
1
vote
1answer
86 views

sa.fill creates NoData raster in standalone script ArcMap 10.0

I am trying to put together a geoprocessing workflow in Python, and I've hit a stumbling block with sa.fill. When run as a standalone script, the tool produces a raster composed entirely of NoData ...
1
vote
3answers
290 views

Can one edit xls, and convert xls to csv - with a portable python or Perl module? [closed]

I am on a network and computer where nothing can be installed. On this computer i run portable apps through a USB, however I need also to to edit xls, and save as csv. Since i cannot install anything ...
1
vote
1answer
218 views

Any advice to help troubleshoot failing ArcGIS Server (10.0 sp5) Geoprocesses?

There are a few geoprocesses on a recently restored ArcGIS Server that are behaving strangely. If we turn on 'show messages' and try to run the process from the rest interface, the process will report ...
1
vote
1answer
147 views

How to add a custom SymbolLayerV2 to a Vectorlayer in QGIS

I'm trying to add a symbolLayer with a line-decoration (line-arrow) to a vectorlayer of linestrings. what i am trying at the moment is to create a new layer and set it's QgsLineSymbol with a list of ...
1
vote
1answer
199 views

python multiprocessing error in QGis (Windows)

I have this error when I try to use Manager() from python multiprocessing library. (Just start QGIS open Python console and execute the two following lines) >>> import multiprocessing ...
1
vote
1answer
302 views

Why do glob.glob and gdal_translate not work for me?

I have a little problem with my python script. I wrote it to convert MODIS data from .hdf into .tif. It will convert all files in a folder using a loop. I do not know which command I must enter to ...
1
vote
1answer
204 views

arcgis python window VS pywin32

I have problems while using the ZonalHistogram function in Python. It seems to give strange results, while, with the same code run in arcgis' python window everything works fine. I am trying to study ...
1
vote
2answers
208 views

What is the difference between Geoprocessing Map object vs. MapDocument object in Python

I have the following code: mxd["C1"] = arcpy.mapping.MapDocument(os.path.join(fRoot, filename)) mxd["C2"] = [arcpy.mapping.MapDocument(os.path.join(fRoot, filename))] C1 creates a geoprocessing Map ...
1
vote
1answer
1k views

Why can't I install python-qgis on Ubuntu 12?

I am with ubuntu 12 and Qgis 1.8. I have installed QGIS and grass plugin but I can't install python plugin. How to install python plugin with dependeny in Ubuntu? ~$ sudo apt-get install python-qgis ...
1
vote
1answer
446 views

How do I find out if a given lat lon is in a KML Linear ring using shapely?

I'm a GIS n00b. I have some LinearRings in a KML file that give the areas for a bunch of different regions. And then I (will) have some lat lons that I want to test to see if they're in any of the ...
1
vote
1answer
522 views

Python script for GRASS - executing from PHP

I wrote the following python script: #!/usr/bin/env python import os import sys gisbase = os.environ['GISBASE'] = "/usr/lib/grass64" gisdbase=os.path.join("PATH") location=LOCATION NAME ...
1
vote
1answer
222 views

Arcobjects in Python, inherit from Abstract Class

As for question, I am trying to adjust Grid Map labels via Arcobjects with Python. For now I do have: from comtypes.client import CreateObject, GetModule import arcpy def CType(obj, interface): ...
1
vote
2answers
459 views

Script to extract UTM Zone using Range and Meridian information

Hi Everyone, I am looking for a phython or php script that will accept the Range and Meridian values of a location and use it to identify the UTM zone. I have a table that comprises of Easting, ...
1
vote
1answer
634 views

Write spatial operations to PostGIS from QGIS or ArcGIS

I need to write my spatial operations to a (new) postgis layer (as the data is to large for a shp file). Can this be done in the QGIS browser or from ArcGIS without SDE? When you go (for example) --> ...
1
vote
1answer
435 views

How to get a signal when the geometry to a line in QGIS is changed

I am working on a plugin in QGIS and want to get a signal when the geometry to a feature(in this case a polyline) in my layer is changed. For example if I use the node tool to drag one of the nodes. ...
1
vote
1answer
136 views

Does Arcmap 10 support the create of textElements using python?

From what I can tell python cannot create new textElements nor GraphicElements. Yet, 10.1 seems to support the ability to at least create a clone, of a existing GraphicElements, but not create one ...
1
vote
1answer
74 views

Is there a way to access ps.map in python?

i am wondering whether its possible using python interface to load layers and edit them in Print/Cartographic Composer without displaying, and finally export to PDF? something that can be done via ...
1
vote
2answers
884 views

How to access vector coordinates in GRASS GIS from python?

Is there a way to iterate over lines and their vertices using python? I'm new to GRASS GIS, and it looks like there are ways to read raster (for numpy), but I don't see a direct way to access ...
1
vote
1answer
1k views

How can I create a custom form to display the attributes of the selected object?

I have already appealed to the selected objects, and found a way how to put them in a MsgBox. But I need to output was in the form
1
vote
1answer
92 views

How do I retrieve an arc ascii grid file from NED 1/3 second data using python and OWSLib

I have my bounds, and have been able to connect to the server http://imselev.cr.usgs.gov:80/wmsconnector/com.esri.wms.Esrimap/USGS_EDC_Elev_NED_3? in python. What I don't know how to do is send a ...
1
vote
1answer
140 views

Button that allows project search and zooms to site once executed

I am trying to create a button that will execute a Python script. I have limited Python experience. What we are trying to accomplish is to recreate these steps: Query on project Site and Radius ...
1
vote
1answer
2k views

Exporting .jpg files from data driven pages in Arcmap

I have generated about 90 maps through data driven pages(ArcGIS 10.0). I now want to export them as .jpg files in either landscape or portrait format. I tried python but it is not working, it worked ...
1
vote
2answers
804 views

ArcGIS problem accessing fields attribute table

I encounter a strange problem. I have a simple shape file to which I added some fields and then populated them. Now I wanna access those fields from a script to run some buffer operations. I wanna ...
1
vote
1answer
811 views

ArcGIS Python Script Tool Validation: Control Overwrite Behavior

I'm creating a script tool to read the USGS earthquake GeoRSS feeds. It works fine as a script with hardcoded values. The script also works fine as a tool for creating a new feature class for a given ...
1
vote
1answer
2k views

UnboundLocalError: local variable 'x' referenced before assignment

I am trying to execute this code, import osgeo.ogr def findPoints(geometry, results): for i in range(geometry.GetPointCount()): x,y,z = geometry.GetPoint(i) if results['north'] == ...
1
vote
1answer
449 views

ImportError: cannot import name QgsVectorFieldSymbolLayer

I am using QGIS 1.7.4., downloaded April 2012, but receive an import error loading the class QgsVectorFieldSymbolLayer. As i understand this class has been added in the Python bindings on 2011-11-15. ...
1
vote
1answer
208 views

Python27 in Quantum GIS is missing SQL drivers in PyQT4

I am developing a QGIS plugin and need to create a table view in my GUI that I have been designing with QT Designer. I have PyQT4 installed but I have noticed that I have 2 Python directories. I have ...
1
vote
1answer
91 views

Other than the methods stated on the Desktop 10 Sharing Tools section, are there any other ways to distribute custom toolscripts?

Essentially I want to be able to distribute a custom script and it seems that I cannot create a .tbx file, so I looked into the other methods, but they are all only for Python modules it seems. What I ...
1
vote
1answer
204 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
129 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
194 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
868 views

Radius of Curvature Python/Arc, how access x,y coordinates

I have a polyline in ArcMap 10 and I am able to script the length of the line in Python using this bit of code: #Calculate Radius of Curvature #try: # Import system modules import sys, string, os, ...
1
vote
1answer
432 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
255 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
510 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
285 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
528 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
301 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
679 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
416 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
784 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 ...