Tagged Questions

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

learn more… | top users | synonyms

14
votes
6answers
2k views

Pure Python Library for Geometry Operations

Does anyone know of a pure Python (no C or Java dependencies) library for doing geometry operations such as buffer, union, intersects, etc? I'm looking for something that Google AppEngine compatible. ...
7
votes
2answers
834 views

Process a raster with multiple geoprocessing tools in arcgis 10 using python - flow between processes

I'm writing a short python script that includes processing rasters with different geoprocessing tools in ArcGis 10, for example, the three processes below, is this best way to use multiple tools ...
3
votes
3answers
751 views

Is it possible to create a python script to rec/post versions?

I’m trying to set up a python script so that I can schedule our rec/post to run on a server. I’ve created a model with the Reconcile Version tool, with the option to Post checked on. I then export ...
5
votes
3answers
1k views

Server side clusterer for Google Maps

After doing a lot of research on different types of clustering coordinates (server side) I am still having problems with choosing the best approach for my project. My requirements: Ability to work ...
4
votes
2answers
5k views

If/then VBScript/Python code equivalent to SQL IN ('x','y',z') expression in ArcGIS Field Calculator?

we need just like the following, only with multiple records selected... have tried the "xyz" in (1,2,3,4,5) SQL code but of course VB Script wants something else. dim f2 if [field1] = "foo" then f2 ...
3
votes
2answers
3k views

Dealing with empty feature classes in a ArcGIS 9.3.1 Python script

I have a script that goes over all the feature classes within a geodatabase (in ArcGIS 9.3.1) and copies them. The problem (as far as I can understand) is that when the script goes to a empty feature ...
3
votes
2answers
1k views

Is it possible to get arcpy on 9.3* or Qgis? Or maybe some of the functions?

If this isn't possible what would be the closest equivalent open source? Could parts of the module be ported to work on 9.3 or QGIS? I'm not sure if this would infringe on the license porting for 9.3. ...
10
votes
4answers
3k views

How to develop GUI in Python for geoprocessing?

I want to develop GUI in Python for geoprocessing, but I don't know what is the best GUI tool or library (Tkinter, PyQT, wxPython) for geoprocessing? Can I use PyQT for GUI programming in ArcGIS?
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?
5
votes
2answers
940 views

Using an integer variable in where-clause in arcgis python script

I've seen some questions on this, but there seem to be many different answers... and none have seemed to work. I'm trying to include an integer variable in the SQL where-clause of a tool like this ...
5
votes
1answer
808 views

Problem with deleting file locks in ArcGIS 10

I did not realize that I should have been deleting cursors after accessing attribute tables until today. Up until now I never did this, but I've noticed that there are lots of file locks after my ...
3
votes
1answer
143 views

Calling LineString.closestPoint or LineString.project methods from Python?

I'm trying to use the GEOS library from Python, specifically via Django (django.contrib.gis.geos). Looking at the GEOS documentation, there are two methods on LineString I want to call that aren't ...
8
votes
4answers
425 views

Joining lines when direction is not known

I am struggling with this problem. I have a polyline made up of several segments. Each segment is made up of points, each point identified in 3D space by coordinates and elevation. Together, if ...
10
votes
2answers
5k views

Using python in ArcGIS, create a line of varying distance from an origin point

What I'm trying to do is create a line feature from a single point, using a set distance and angle. Using ArcGIS and Python (I hope). Here's the scenario: Say I have a point at these coordinates: ...
3
votes
1answer
1k views

Count of raster cells as variable in arcgis 10 modelbuilder

I want to use a cell count of an integer raster as a variable in Arcgis 10 modelbuilder (and later in a python script), but can't seem to find how to access this information. Is there a (python) ...
35
votes
7answers
5k views

How can I effectively debug arcpy Python scripts?

I have written many Python scripts using arcpy in ArcGIS 10, and so far my only means of debugging is restricted to printing messages to the geoprocessing results window using arcpy.AddMessage(). Are ...
9
votes
2answers
8k views

Converting projected geoTiff to WGS84 with GDAL and Python

Apologies if the following question is somewhat stupid, but I am only VERY new to this whole GIS thing. I am trying to convert some projected geoTiff images to WGS84 using gdal in python. I have ...
3
votes
1answer
1k views

gp.Describe() on sde table

Python newbie needing help with a simple task. I'm trying to create a list of stand-alone tables in an sde workspace. Code below works just fine to list feature class names and paths and table ...
0
votes
1answer
1k views

Arcpy and arcobject [duplicate]

Possible Duplicate: How do I access arcobjects from python? Hi : I'd like to begin programming with Python in ArcGIS 10 by Arcobject.but i don't have any experience about python and ...
14
votes
6answers
5k views

Generate points that lie inside polygon

I have polygon feature and want to be able to generate points inside it. I need this for one classification task. Generating random points until one is inside the polygon wouldn't work because it's ...
2
votes
2answers
2k views

How to recode field values based on field contents?

Is there a convenient (or even effective) method for recoding field values using the field calculator or standalone python script? In this case, I am given several unique strings to identify a type of ...
2
votes
1answer
2k views

Using python lookup table to compare records with existing geodatabases

I am trying to use python to look through an access table containing facilities that need to have geodatabases with geodatabases that already exist in order to generate a list of facility geodatabases ...
4
votes
5answers
1k views

How to use python to turn a .dbf into a shapefile

I have been scouring the internet trying to find a pythonic (sp?!) way to process this data.. Everyday we will recieve a load of data in .dbf format (hopefully) - we then need to save this data as a ...
7
votes
4answers
5k views

Avoiding import arcpy error (RuntimeError: NotInitialized) when using IDLE?

ArcGIS Version: ArcGIS 10, Python 2.6.5 Machine: Windows 7 64bit (Intel) I'm receiving the following error when importing arcpy using the the IDLE (gui and cmd prompt) and when using pythonwin. I ...
5
votes
2answers
2k views

Cannot get rid of lock on file geodatabase and feature class created in Python script

I have a python script, (for ArcGIS 10), that creates a new file geodatabase, creates a new feature class in that file geodatabase and then reads data from an SDE feature class to populate the new ...
2
votes
2answers
287 views

How to use any ArcMap tool from a python script?

I'm trying to develop a tool that uses some of arcmap default tools like the Sketch Tool or Trace Tool. Is it possible? Let me explain a little more, I need to draw a feature, ask for user input, and ...
1
vote
1answer
697 views

How to Convert Code from VB to Python in Map Algebra?

I have a problem with Map Algebra in ArcMap 10 to convert some codes made by VB, so i need to convert it to python to work in arcmap 10 without problem. and can any one help me how do i deal with map ...
0
votes
1answer
422 views

Update, Insert Cursors don't work on Features that have annotation?

I've been working on a script to update my feature classes by grabbing new data from one feature class, and applying it to another feature class. It does this with several cursors, basically get ...
1
vote
2answers
856 views

Help with a Simple Code to Read a Metadata from a Raster File

Please help me with a python code to read metadata from a Raster file. Thanks
2
votes
1answer
2k views

How to update feature class by iterating through values with branching?

I'm really struggling with getting this to work. Basically, I want my script to get the "newID" value and use that as a look up value. If the "newID" is found in the OldID list then do one thing, ...
6
votes
2answers
908 views

ArcGIS metadata creation scripts

I maintain metadata as I always have....inconsistently and sporadically.. I know...booh to me. Anyways, I know python can pull all kinds of info out of mxd in V10. Has anybody come up with some ...
4
votes
4answers
617 views

Compressing map algebra outputs from ArcPy

When creating a raster map algebra output, is it possible to set its compression? I'm creating a model which generates many hundreds of rasters, and currently each is being stored without any ...
1
vote
2answers
2k views

How do I programmatically update/recreate an ArcSDE feature class from external sql data?

I have an ArcSDE feature class that contains project points based on xy data from an external SQL databaes. (Not a geodb). I am looking for the best way to "recreate" the ArcSDE feature class from the ...
6
votes
4answers
3k views

Programmatically edit/update metadata in ArcGIS 10

Has anyone succeeded in programmatically updating metadata in ArcGIS 10? Considering using Python/arcpy but ArcObjects (C# or Python/comtypes) is also a possibility. I need to update both the FGDC ...
2
votes
3answers
546 views

Why is this polygon “self intersected” and invalid?

I have a polygon defined as follows: segment from 43:29:02 N 003:50:39 E to 43:34:12 N 003:43:04 E arc(CW): center (43:34:49 N 003:58:16 E) from 43:34:12 N 003:43:04 E to 43:45:45 N 003:59:56 E ...
5
votes
2answers
1k views

Call FWTools (ogr2ogr) from ArcGIS python script

In ArcGIS, I want to use a Python script (and a standard ArcGIS script tool UI) to call functionality from FWTools. How would I make the call to FWTools? I tried using ...
3
votes
2answers
575 views

Enabling time aware layers using arcpy

Is it possible to enable time aware on a layer programmatically? I can add a time-enabled layer to a non-time aware data frame as shown here: ...
14
votes
3answers
8k views

Listing all feature classes in File Geodatabase, including within feature datasets?

From python how can I build a list of all feature classes in a file geodatabase (*.gdb), including inside feature datasets? The standard example only lists feature classes at the top level of the ...
0
votes
1answer
306 views

Eliminating a column from a copied feature class via a fieldmap object in ArcGIS Python

The use case is exporting a feature class via a Python script (arcgisscripting v9.3x. Only a few of the columns are needed in the result feature class. I commonly use the fieldmappings/fieldmap ...
3
votes
2answers
3k views

How to export selected records to a .txt file

I am working on a project where I need to create a tool/method to export the attributes of selected features to a .txt file. I have point features containing addressing information, and the tool ...
4
votes
1answer
437 views

How to deal with direction (CW, CCW) of circles, in particular with shapely?

I am translating an input that describes zones by mixing segments and arcs. Arcs are given by a center, 2 points (beginning/end of arc) and a direction (CW or CCW). In a first prototypes using GDAL, I ...
12
votes
4answers
4k views

Clustering Trajectories (GPS data of (x,y) points) and Mining the data

I've got 2 questions on analyzing a GPS dataset. 1) Extracting trajectories I have a huge database of recorded GPS coordinates of the form (latitude, longitude, date-time). According to date-time ...
1
vote
2answers
473 views

How to create GRASS scripts in C# in Windows

Most of the tutorials that I have seen are under Python and Linux. Is it Possible to create GRASS scripts in C# or atleast in Windows. I can create scripts using a different language as a compromise ...
6
votes
5answers
1k views

Who uses FME Python extension and how?

I saw a great interface to FME with Python there What you guys are doing with it? I want ideas.
0
votes
0answers
490 views

Change from data --> layout view using arcpy? (ArcMap 10)

The opposite, from layout to data, was asked and answered, but I can't figure out how to switch to the layout view from data view using arcpy. Can it be done? Thanks.
7
votes
3answers
2k views

How to create a circle in arcpy

Suppose I have a dataset where each record has an x,y and r (the centroid and radius of a circle). How can I create a polygon feature class containing parametric circles? Sorry to those who have a ...
4
votes
2answers
805 views

Calculate spacing of polylines along transects in ArcGIS

I have a shapefile with a number of roughly parallel lines in it, and I want to calculate the spacing between these lines using a number of transects across the map. How should I go about this? I ...
6
votes
2answers
5k views

How does one access a featurelayer in SDE via Python?

I am trying to use Arcpy to run the CopyFeatures_management script so that I can copy a featurelayer in SDE. What do I use for the input (and output, for that matter, since I'll be copying the layer ...
4
votes
3answers
2k views

How to format dynamic text element in Data Driven Pages [closed]

Is there a way to format the Name element generated as dynamic text from Data Driven Pages. This element serves as my title and it is too long and needs to be wrapped onto another line.
4
votes
1answer
123 views

Is it possible to install 9.3 Desktop Administrator as a standalone program?

I have ArcServer 9.3 installed on a server that I use for running scheduled Python geoprocessing scripts. I have several running, and now I'm trying to schedule one to rec/post, delete and recreate ...