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

learn more… | top users | synonyms

3
votes
1answer
457 views

ArcGIS GeoProcessing Model - Store List of Altered Features in Database

I am trying to build a GeoProcessing model which will find any parcels that have had their geometry values changed and store the corresponding parcel numbers in a separate non-spatial table. I am ...
1
vote
1answer
525 views

Win7 GRASS 7 & i.landsat.toar

Hello has anyone got experience running i.landsat.toar ? The output files I get are empty, the command takes but a moment to complete. However when run in verbose mode all the calculations are done, ...
9
votes
4answers
495 views

ArcView 3.x Avenue Bitmaps (Tabs?) vs. ArcView 10 Python Cursors

Note: While this question has an answer, any further tips for optimizing a cursor process would be greatly appreciated. I will be monitoring for any updates. Currently, my boss (who works in Avenue) ...
10
votes
1answer
1k views

Exit script with Python

I've got a Python script for ArcGIS that I'm working on, and I'd like to have the ability to have the script quit if it doesn't have the necessary data available. I tried a straight up sys.exit() but ...
2
votes
0answers
573 views

Spatial Analyst Cell Statistics seems to give the wrong answer in ArcGIS 10.0

I have a script that calculates standard deviation for a list of grids using the Cell Statistics function in Spatial Analyst for ArcGIS 10.0 The syntax is this: stdevGrid = ...
7
votes
2answers
4k views

Basic Field Calculator Python Question

I'm trying to used the Python syntax in ArcGIS 10's field calculator and am thoroughly confused. So far the most basic calculations are failing me, and I don't understand why. I'm trying to create a ...
3
votes
1answer
1k views

calculate value using maximum value from different feature class

I'm trying to get the maximum numeric value from one feature class and use that value in an expression to calculate values of a different feature class. fc2.bldg_id = max(fc1.bldg_id)+1 Can this ...
6
votes
2answers
785 views

ArcGIS Python Tool Script Parameter - Binding Objects to a List Parameter

I am working on a python based script/tool. I would like to make use of drop down lists for several of the parameters. This is very easy to do if the lists are just plain old strings. Does anyone ...
2
votes
1answer
562 views

Is there a way to set a mask(halo) for labels in a python script?

I currently am writing a python script and using a lot of the arcpy mapping module functionality. I have been using the LabelClass of the arcpy mapping module to automate the display of labels with my ...
4
votes
1answer
1k views

Processing time using ArcGIS Hydrology toolbox tools in standalone Python script vs. ArcCatalog

My question is: what might cause the ArcGIS 9.3 Hydrology Toolbox Snap Pour Point and Watershed tools to run significantly slower in a Python script versus manually running the tools in ArcCatalog ...
6
votes
3answers
3k views

Arcmap: attach python script to a button?

In ArcMap 9.x how can I attach a python script to a button?
0
votes
1answer
167 views

Accessing smb share on Trimble YUMA with python

I need to write a script that would import a .shp on the YUMA to a gdb on the script/host pc for manipulation with arcpy. I can't seem to find a smb python module. So Im not entirely sure on how to do ...
2
votes
1answer
841 views

Export from SDE to SHP in ArcGIS 9.3.1 - problem: not exporting all fields

I'm exporting a layer from SDE to SHP by python script, and I'm doing it in 2 phases: the first includes select by location (for picking the relevant features) and the second phase includes the Select ...
4
votes
3answers
1k views

Need to create a collection of polygons from a collection of points

I have a set of points, which are spread over a wide geographical area. I need to be able to create a set of polygons which best represent the clustered points. In parts, some points may simply lie ...
3
votes
2answers
3k views

Can you create labels based on an attribute field in a shapefile with Arcpy?

I was curious if anyone knew how to access the ArcGIS label engine with arcpy? I want to be able to label point features on my map in a python loop.
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 ...
4
votes
3answers
2k views

Python crashes during large cursor process

In a current project, I am attempting to extract several fields for each record of a table in a GDB that has ~8.5 million records. My current strategy is to create a search cursor, fetch the data I ...
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 ...
8
votes
3answers
3k views

How do I use variables from one Python script in other Python scripts?

I want to set up a single python file containing variables that have the locations of all my data sources. This would then be used by all my other scripts, then as a data source changes, I only have ...
4
votes
1answer
820 views

occasionally empty search cursor looping through a raster list with arcpy

I'm looping through a raster list, to export cell counts (from "Count" field in the table) to a text file, I'm only interested in cases where the field "Value" = 1, so I have included this in my ...
3
votes
3answers
742 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 ...
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 ...
5
votes
2answers
1k views

Can a “Join” be detected programmatically?

I have some Python code that is launched from within an ArcMap project. Any joins that the user may have created in the project must be removed in order for my code to run. Unfortunately, the code ...
8
votes
1answer
336 views

Running ArcGIS 10.0 Under Virtualenv

I am working on a Python package that has a mixture of command line tools and ArcToolbox tools. For Python development it is really useful to use VirtualEnv, especially when working with installers. ...
6
votes
2answers
2k views

Is it possible to access ArcGIS's table operations “Summarize…” and “Statistics…” in python?

ArcGIS has a few nifty table tools, including Summarize and Statistics. Is there a way to access them through arcpy, or will I have to hack my own methods via math and lists?
5
votes
1answer
921 views

Rescale Raster Band With GDAL Python Bindings

I am trying to figure out how to rescale a raster band's pixel value using the GDAL python bindings. I am looking to emulate the -scale switch in gdal_translate.exe; rescaling the pixel values in my ...
9
votes
2answers
649 views

Scriptable alternative to ArcScan (particularly vectorising lines within tolerances)

Sadly the answer to this question suggests that it is not possible to script ArcScan from within a python script. Therefore, does anyone know of any alternatives to ArcScan (either within ArcGIS, or ...
5
votes
2answers
953 views

Backwards compatible python scripts in ArcGIS

As I move through my small collection of python scripts written for arcgis 9.3 I'm discovering that many things work with little or no changes in arcgis 10. For example this pattern "just works": ...
2
votes
2answers
1k views

Putting multiple lines of Python into ArcGIS 10's Field Calculator

I've gotten some incredibly valuable help here on this already, much Thanks. Entering these lines of Python one at a time works like a charm.... Just need one more seemingly simply issue solved... ...
1
vote
2answers
1k views

unique value symbolize layers from a lookup table

I need to create a large number of Arcmap layer files (v9.3 or 10), perhaps a hundred, from lookup tables. I don't have to set the symbol patch itself, that can be random, but I do need the value and ...
0
votes
0answers
485 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.
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. ...
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
924 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 ...
3
votes
1answer
141 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
421 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 ...
5
votes
1answer
806 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
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) ...
2
votes
2answers
733 views

Any python script to convert a geoPDF to a KML embedded with a jpg link?

I have many geoPDFs. I want to turn them into KMZ or KML+JPEG using a python script. Any suggestions? SEE CODE BELOW
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 ...
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 ...
1
vote
1answer
695 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
416 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 ...
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 ...
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 ...
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, ...
1
vote
2answers
835 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
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 ...
4
votes
4answers
612 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 ...