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

learn more… | top users | synonyms

7
votes
2answers
3k views

How to create a checkbox parameter in a ArcGIS custom Python tool?

I am working on creating an ArcGIS tool from a Python script I am writing. I am wondering if it is possible to have a checkbox parameter. Basically what I want to do is have a parameter where the ...
2
votes
1answer
177 views

ArcGIS 10 SP2 issue with AggregatePoints

ESRI persuaded us to upgrade to SP2 and now we cannot use the code we have, as it doesn't work. According to the download material, NIM063853 is when AggregatePoints doesn't create the derived table. ...
8
votes
2answers
851 views

ArcMap running scripts slower if you import Arcpy

I am finding ArcMap runs slower, if you have written a script, which imports arcpy. You may wish to write a script that can be operated in ArcMap, through the python window, or as a standalone ...
2
votes
0answers
249 views

RT Sql Layer plugin giving an error [closed]

I am trying to use the aforementioned plugin with QGIS 1.7 and Postgres 9.0/PostGIS 1.5. Added a PostGIS spatial layer w/out a problem and then clicked on the RT Sql layer button which displayed the ...
3
votes
1answer
1k views

How to update only a single vector layer in QGIS map canvas?

I want to update a single vector layer as I am working on 8 vector layers and they are getting fast data from serial port so for updating I use mapCanvas().refresh() which refresh all the layer and I ...
3
votes
2answers
524 views

PostGIS + pgRouting: Adding dummy links to a road network and performing routing analysis

I'm a beginner when it comes to postgis and pgrouting development. For a project I'm working on and a bit of the algorithm: I have a polygon layer that represents zones I have a line layer that ...
1
vote
2answers
3k views

Get extent of Georeferenced Rasters in Python and output to polygon shapefile

I would like to create a shape file containing the extents of each of the rasters in a directory. Is it possible to capture the extent of a raster using Python? I have tried ...
2
votes
0answers
572 views

Perfectly running python script gives error when run from web.py

I have the following python script which runs perfectly if run separately: import arcpy val = arcpy.GetCellValue_management("D:\dem-merged\lidar_wsg84", "-95.090174910630012 29.973962146120652", ...
4
votes
2answers
669 views

arcgis 10, python update raster of mxd file

i wanted to update the raster file in a mxd file using python. for example, i created a.mxd which contains b.tif file in it. now, i obtained c.tif and want to update the a.mxd, i.e. want to delete ...
3
votes
2answers
3k views

Loop through records

I have written a python script that is supposed to basically loop through selected records of a feature class. Here's a sample of what a table looks like: OBID STID FL TL 1 1 0 9 ...
7
votes
1answer
203 views

Optimize GEOSGeometry's spatial operations by avoiding thread-safety checks

A ranking algorithm I'm developing for a Django webapp requires performing spatial operations (within, intersections, sym_difference, etc.) using a query against large number of geometry objects. ...
1
vote
4answers
1k views

Install other python distributions on top of ARCGIS installation ? - esp. Python(x,y)

I'm using ArcGIS 10 and would like to use various additional libraries that are not included in the delivered version of ArcGIS (esp. numpy and matplotlib). First I tried to install them manually as ...
8
votes
1answer
2k views

Polygon overlay with Shapely

I'm trying to capture all the non-overlapping polygons indicated below using Shapely (given polygons A,B & C). Moreover, I'm hoping to do so without iteration, testing for intersect etc. The ...
3
votes
2answers
2k views

How to create a feature class in a file geodatabase in ArcGIS 9.3 with Python?

I'm not entirely sure if I am using the correct terminology, so I apologize in advance. What I am looking to do is create a file geodatabase and add a feature class directly into that file ...
1
vote
3answers
504 views

python: Replace Variable in VB-Expression-File (.cal) [ArcGis 9.3]

I'm trying to modify a VB-Expression saved in a cal-file: dim out if [D19830701]=-9999 then out= [D19830501] else out= [D19830701] end if __esri_field_calculator_splitter__ out with this ...
6
votes
3answers
3k views

Insert Raster to MXD using arcpy.mapping (ArcGIS 10)

What i want to do seems simple. But again i can't even find a workaround... I have got a lot of Raster-files (ESRI-GRID) which i need to insert into a layout mxd-file and then export the map to ...
14
votes
1answer
2k views

Voronoi polygons that run out to infinity

I have been working on implementing the voronoi.py script (Bill Simon's translation of Steve Fortune's code). According to the QGIS link it is basically the same code that I am working with, but the ...
4
votes
2answers
1k views

how to create graphs while running python with ArcGIS 10

As Matplotlib seem not to work (what a drag it's such a nice tool) I'am looking for alternatives to create graphs while running python with ArcGIS 10. Besides regular pie and column charts I need in ...
4
votes
2answers
762 views

Using a bounding polygon, instead of a bounding box

I've got a large set of LAT/LON coordinates. Up until now, when I needed to select out those that fell within a certain region, I'd just create a bounding box using some MINx, MAXx, MINy, MAXy values ...
5
votes
2answers
610 views

Access to SpatiaLite .dumpshp via Python?

I'm trying to interact with a SpatiaLite database via Python on my Windows machine. I've managed to connect to the database and load the SpatiaLite extension, which means that I can pass SQL queries ...
1
vote
3answers
783 views

CreateFeatureclass_management doesn't add a layer to the TOC of ArcMap10

I created a python script for a toolbox and I am wondering about the fact that CreateFeatureclass_management doesn't add the feature-class as layer in the actual dataframe. This does not happen in the ...
1
vote
2answers
424 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) ...
2
votes
1answer
2k views

How to populate a field with the max M value of a feature using Python in Field Calculator?

I need to calculate the max M value for a line feature using Python in ArcGIS 10 Field Calculator but I cannot figure it out. In 9.3 I used the follow VBA expression… **Pre-Logic VBA Script Code:** ...
6
votes
2answers
439 views

Disambiguate messy place names in python (preferably on local machine)

I have list with several million place names that come from Flickr profiles. Users provided these placenames as free text, so they look like this: Roma, Italy Kennesaw, USA Saginaw, MI Rucker, ...
5
votes
1answer
353 views

Combined area of all features within features of another layer

I have a grid shapefile (basically, a half-degree grid of the world, where each cell has a unique id number), and a set of files with features. I want to record for each grid cell, all the areas ...
5
votes
3answers
630 views

matplotlib does not work in ArcGIS 10 and Eclipse (Python)

I have installed matplotlib (v. 1.0.1) which works with iPython quite good. But if I insert the same script in ArcGIS 10 or Eclipse 3.7.0 (with PyDev) I get always errors. As I consider to use ...
5
votes
4answers
2k views

Is there a way to disable code autocomplete in the Python window in ArcGIS 10.0

Autocomplete slows down my workflow in the Python window, especially if I am remoted into a machine. Is there a way to disable this? Alternatively, a way to disable this and then invoke as needed ...
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
564 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
934 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
375 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
719 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
531 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
906 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
307 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
237 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
397 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 ...