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

learn more… | top users | synonyms

18
votes
3answers
11k views

ArcPy and running Python scripts (with parameters) within another Python script

A common coding pattern used in AML was to run an AML (with parameters) inside another AML. An application that I'm currently developing would benefit from being able to run a Python script (with ...
4
votes
3answers
565 views

How can I have ArcGIS not automatically add raster clip output from Python window to the current map

I have a collection of rasters that I'm writing code to automate clipping based on a user defined shapefile. I am currently doing this in the Python window using the following as the main processing ...
7
votes
1answer
1k views

Help with PostGIS polygon geometry - non-closed rings

I've picked up a copy of the super-wicked book 'Python Geospatial Development' by Erik Westra (Amazon link), and I'm working through it. Currently, it's teaching me to load GSHHS coastline data from a ...
3
votes
1answer
150 views

Using ESRI Python's Geoprocessor Via mod_python

I am working on a number of geoprocessing services to be accessed solely by web clients. The traditional method of encapsulating this type of stuff in toolboxes and then publishing the toolbox just ...
3
votes
5answers
1k views

When a raster is clipped to a polygon with Python, why does it still take on the extent of the entire shapefile?

I am clipping a raster image to each polygon row in a shapefile in ArcMap 9.3 using the Clip tool (Data Management) in Python with Clipping Geometry set. While the clipped raster successfully depicts ...
3
votes
4answers
1k views

How to clip raster image by the extent of each row in a shapefile with ArcGIS 9.3

I'm using Python to clip a raster image by each row in a shapefile with ArcGIS 9.3. I am hoping to end up with one raster image for each polygon row, clipped to the extent of the polygon row. ...
10
votes
1answer
938 views

Is there a way to access QGIS plugins in Python?

Is there a way to access QGIS plugins in Python? I'd like to write a script to do some geoprocessing, and I'd like to use the clip, regular points and convex hull tools in fTools, as well as the Road ...
1
vote
1answer
815 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 ...
3
votes
1answer
376 views

Python metes and bounds automation in ArcMap

We are using the metes and bounds in old pipeline alignment sheets, when in an edit session in ArcMap, to plug in the "direction/length" values to generate the line segments. Does anyone have any ...
4
votes
3answers
720 views

Converting ESRI Web Client JSON to Standard Feature Class With Python Geoprocessor

Is there a function exposed by ESRI's python geoprocessor that converts the JSON format used in the various web clients to a valid feature class. Clearly, the function exists because something is ...
5
votes
1answer
533 views

Determining ESRI File Geodatabase release version?

Is there any method in Python, ArcObjects, or the File GDB API for determining the release version (9.3, 10.0, etc.) of a file geodatabase? There is a need to find all of our shared 10.0 version file ...
0
votes
1answer
255 views

How to use the transformer KMLRegionSetter ? (Python/FME)

I use Python and FME. I would like to use a transformer "KMLRegionSetter_2" for KML file. I use a fmi file for the transformation. reader=FMEReader("OGCKML",{'USER_PIPELINE':"C:\\arcfactory.fmi"}) ...
5
votes
1answer
2k views

Python Field Calculator ArcGIS 10 expression for a RANGE

what is the python expression for defining a range of numbers? I have tried numerous combinations but cannot get a simple range of angles (100 -200) to compute correctly. Screen shot : screen shot ...
2
votes
3answers
2k views

Read KML file with GDAL/OGR for Python

I have file : test.kml and I try to open it with GDAL/OGR (1.6) librairie in Python (2.5). But I don't succed can you help me ? This is my code : from osgeo import ogr adresse = 'test.kml' ...
1
vote
0answers
230 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") ...
2
votes
3answers
472 views

writing a 3D polygon (arcpy)

I currently working on some scripts with 3D polygons using arcpy (arcgis10). Reading and data manupulation works fine, however writing the output back into a shapefile doesn't seem to work, it only ...
5
votes
3answers
2k views

Python: Combine multiple Shapefiles

i have got a lot of Point-Shapefiles (r20010101.shp, r20010202.shp, r20020101.shp...). Each of them has the same amount of points at exactly the same location. In a column that is named after the Date ...
1
vote
2answers
908 views

Creating and serving pdf files from ArcGIS server 10.0

I am tasked with sending map data from the Flex client to an MXD then to serve that as a PDF to the client and/or a server side location. Creating the PDF isn't an issue, however, I am having trouble ...
2
votes
1answer
310 views

Enumeration Problem with Eclipse and ArcGis 9.3

i'm recently using Python for my Processing work that I do with ArcGis 9.3. I figured out, that using Eclipse (with PyDev) could be helpfull for debugging purpose. The geoprocessor is starting as ...
0
votes
2answers
308 views

FME API Module null?

I try to convert my geodatabase to Excel. And i have a strange message: FME API version of module 'XLS_ADO' matches current internal version (3.6 20101014) Trying to find a DYNAMIC plugin ...
0
votes
0answers
238 views

How to read a feature table empty with FME / Python?

I would like to convert a feature table Geodatabase (empty) to MapInfo, but my feature table is empty. I would like to write the schema of feature table in MapInfo file. Is it possible to force the ...
0
votes
2answers
398 views

Read feature table with FME / Python

I try to convert a feature table Geodatabase to MapInfo with FME / Python But each test, my application crash. There is no geometry in my feature table in file geodatabase. Why my application crashes ...
3
votes
1answer
1k views

Grouping points by location

This is ArcGIS specific. I do have surveyed points (sections). There will be 200 sections, each section 20-30 points. I want to create polylines (sections) out of the points. In order to do so, they ...
19
votes
4answers
1k views

Run a Python Script when opening an MXD?

Can anyone tell me how to accomplish this? I want a Python script to run on opening the MXD which would pull an excel worksheet into a GDB and refresh the map. I only want this to happen in this ...
4
votes
1answer
3k views

Find and Replace expression needed in Field Calculator ArcGIS 10

Looking for the Field Calculator code (Python preferred) to replace the last numeral values in a field using another field's values for entire attribute table. Please see screen shot here:
1
vote
1answer
341 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) ...
2
votes
2answers
987 views

Automate creating Rectified files from georeferenced images

A python 2.6.5 / ArcGIS 10 solution is preferred. UPDATE: I found a tool to do this "Create Ortho Corrected Raster Dataset" but the python script for it gives errors when I try. import arcpy import ...
3
votes
2answers
743 views

How to get a list of features from FME? Python?

I would like to get a list of geodatabase feature tables from FME. Is it possible with Python? Or another transformer? Thanks.
2
votes
2answers
721 views

Mapnik TextSymbolizer showing nothing above OpenStreetMap base layer

I'm trying to use Python to create a TextSymbolizer to display a trail name above the trail LineSymbolizer. Below this layer is the OSM base layer which contains its own data for that trail. I can ...
5
votes
4answers
1k views

Changing image projection using Python

Image corner coordinates are known: Top left: (70.20315, 20.92749) Top right: (70.20315, 31.45240) Bottom left: (59.70571, 20.92749) Bottom right: (59.70571, 31.45240) (Basically map over Finland ...
9
votes
2answers
1k views

Speeding up my Python calculated field

I am new to Python and have started to create scripts for ArcGIS workflows. I am wondering how I can speed up my code to generate an "Hours" double numeric field from a timestamp field. I start with ...
8
votes
1answer
2k views

How to create sidebar help information for custom arcgis script tools?

I have been creating custom gis tools with python via the arcpy module. I can set up the tool successfully with parameters and all, but I cannot figure out how to create help text that shows up on ...
3
votes
1answer
1k views

How do you make a SQL join query for a NULL in a search cursor in ArcPy?

I am trying to learn how to do some error catching/avoiding in ArcPy. Here is a simplified version of what I would like to do. I would like to take some points, and then check to see if there is a ...
0
votes
1answer
372 views

Calculating length with Python and the PYTHON_9.3

(Please critic wholly if possible) If I have polyline data in NAD83 and I want to calculate geometry using the PYTHON_9.3 parameter from the arcgisscripting.create(9.3), I am getting mixed results. If ...
3
votes
1answer
726 views

How to Solve the error - “Python Plugin is Broken”?

I tried following the steps to build a python plugin for QGIS. (step 3 is where I am stuck at) 1) I used the Plugin Builder plugin to build the initial set of files. I call my plugin ...
1
vote
1answer
289 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 = ...
6
votes
3answers
6k views

Converting X,Y coordinates to lat/long using pyproj and Proj.4 returns the wrong coordinates

I'm writing a python script that reads multiple XML files containing x and y coordinates and combines them all into a single csv file. Latitude and Longitude are required fields in the csv, but I am ...
2
votes
1answer
411 views

How can you make RasterToASCII_conversion observe environment setting output cell size?

I have two rasters (an ESRI grid and an IMAGINE image) that differ in projection, extent and cell size. I want to convert the IMAGINE to an ASCII, and want it to have the extent, cell size and ...
5
votes
1answer
757 views

arcpy.mapping.ListLayoutElements() takes longer in a tool than in ArcMap

Has anyone else noticed that accessing elements from arcpy.mapping.ListLayoutElements() through a tool script takes longer than within ArcMap? Whether using a specific name, wildcard or nothing, the ...
2
votes
3answers
668 views

Definition Query to Python script on Oracle 9i and ArcGIS 9.3.1

SUBTYPECD=1 AND SERIESNAME NOT LIKE '%-%' AND OPERATIONALSTATUS IS NULL OR SUBTYPECD=1 AND SERIESNAME NOT LIKE '%-%' AND OPERATIONALSTATUS = 976 The above is my def query in ArcMap against ArcSDE ...
3
votes
1answer
1k views

How to import qgis.core in a Osgeo4W installation?

when I try to import qgis core module from python: from qgis.core import * I get this error: ImportError: DLL load failed: The operating system cannot run %1. Searching the web I found that I need ...
2
votes
2answers
2k views

GDAL tools for QGIS on OSX - what is the exact directory for gdal binaries?

When I try to use the gdal raster tools, eg clipper, I get the message "The process failed to start. Either the invoked program is missing, or you may have insufficient permissions to invoke the ...
9
votes
1answer
605 views

How to implement MultiValue Parameter with Multiple Columns?

This might be a simple question, but I haven't been able to find a straightforward answer. I'm working on an ArcGIS (9.3) Python script. One of the inputs is a list of features. For each feature, I ...
21
votes
2answers
3k views

Python Efficiency — Need suggestions about how to use OGR and Shapely in more efficient way

I'm looking for some suggestions about how to make my python code more efficient. Normally efficiency doesn't matter for me but I am now working with a text file of US locations with over 1.5 million ...
2
votes
1answer
659 views

Create a Python script to merge broken polylines from a microstation CAD file in ArcGis

I have tried using the dissolve tool with unsplit_lines option but it does not merge the lines... maybe there is a step I am missing?
10
votes
3answers
5k views

How to list feature classes with active “attribute domains”?

I have an Esri file geodatabase with attribute domains defined. I need to delete some of the attribute domains but can't because "The domain is used by an attribute rule.". How might I discover which ...
1
vote
3answers
5k views

os.sep in python scripting

what is os.sep and when should i use os.sep while scripting for arcgis ? for example in below code i don't understand why should i use os.sep . import arcpy from arcpy import env import os # Set ...
2
votes
3answers
2k views

Does ArcGIS 10 have a Geoprocessor Programming Model by using Arcpy?

Does ArcGIS 10 have a Geoprocessor Programming Model by using Arcpy? is it possible to use ArcGIS 9.3 Geoprocessor Programming Model within ArcGIS 10?
12
votes
5answers
450 views

Smallest GIS library for embedded devices?

I need to use very simple geometry operations (read SHP or other standard format and simple searches) within an embedded device running a simple linux based os. What is the smallest and simplest API ...
1
vote
1answer
347 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 ...