A python API created by ESRI to perform geoprocessing and layer management.
6
votes
1answer
193 views
How to draw shapes with highest possible decimal accuracy
I am trying to read input of lat and long to draw the shape based on condition.The input is standard array of lat and long with 15 decimal accuracy. I am realizing - I am loosing some decimal accuracy ...
6
votes
1answer
878 views
ArcObjects C#: Create Random Points fails with ERROR 999999: Error executing function
I am having trouble running some ArcObjects C# code that calls create random points. I would not be doing this in ArcObjects, but I am suffering with the same issue using Arcpy as seen here:
...
6
votes
2answers
975 views
Is anyone successfully using arcpy.ExportMetadata_conversion?
I don't know if it is a bug or my lack of python skills, but I keep getting 'ERROR 000816 The tool is not valid' in my python script when I call ExportMetadata_conversion
Initially, I was attempting ...
6
votes
1answer
229 views
Using python, how do you “reload cache” an opened Attribute Table
Used python to update a shapeFile through cursors. The Shapefile is updated, but there could be an opened Attribute Table. Manually you can hit "reload cache" to update the Attribute Table and see ...
6
votes
1answer
1k views
Python-arcpy : How make feature list from gdb and value list from field and use them in gaLayer function?
I'm not an expert in python, however I have to write a script to do geostatistical analyses with the GACreateLayer function from Arcgis.
I have several data (>2000) and I want to use list of features ...
6
votes
1answer
233 views
How to access a graph in an ArcMap document with arcpy?
I am trying to access an existing graph in an ArcMap document with arcpy. I know how to create a new graph with arcpy, but I cannot seem to figure out how to access an existing graph in an ArcMap ...
6
votes
1answer
405 views
Arcpy hanging on Linux
I am having issues getting arcpy to run correctly on Linux Red Hat. I solved some earlier problems which appeared to be related to permissions on the init_server file. Now that si resolved, when I ...
6
votes
1answer
234 views
Arcpy crashes in loop geoprocessing (general behaviour)
I have several standalone scripts that create a list of shapefiles to process (or coverages in one of the scripts). Sometimes my script crashes after it processes three files, sometimes ten, ...
6
votes
1answer
564 views
ArcGIS 10 Linux experience
We have ArcGIS 10 installed on a nice clean Linux box. We have developed scripts to run on the Windows desktop development machines, and modified them to run on Linux.
Now, if we run the scripts on ...
6
votes
1answer
164 views
What percentage of ArcGIS users are using version 10.1 already?
I'm planning on building an add-in using ArcPy, but some of the functionality I need is only available in 10.1. I want to distribute this add-in and was wondering if making it 10.1 only would limit ...
6
votes
0answers
245 views
python.exe has stopped working
A python script was written about 18 months ago by a person who has now left. It produced the required outputs then. I've been asked to run it again but with different (finer resolution) data ...
6
votes
0answers
207 views
Land Classification with Spectral Python (SPy) [closed]
Does anyone have experience working with the Spectral Python module for land classification? The following k-means clustering example takes an iterative approach to classification through pixel ...
6
votes
1answer
1k views
Python Script to Create Table Using Data Driven Pages
I am trying to convert some python script to display a table (based on a dbf) of features located within a specific data driven page. So far, I have the script successfully able to refresh the map to ...
5
votes
5answers
190 views
How to divide a feature class into ranges?
I have a shapefile consisting of around 4000 polygons. The polygons are created from buffering around a similar number of islands somewhere in the Norwegian archipelago. Due to an error in the ...
5
votes
2answers
3k 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 ...
5
votes
2answers
1k 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
3answers
2k 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 ...
5
votes
2answers
386 views
How to implement bivariate Ripley's K function in ArcGIS 10?
The attached image shows a forest gap with red pine represented as circles and white pine represented as crosses. I am interested in determining if there is a positive or negative association between ...
5
votes
4answers
994 views
explode overlapping polygons to new non-overlapping features
Given multiple polygons that overlap in multiple ways, I would like to export from this feature all polygons that don't overlap with others iteratively. The product would be a number of features with ...
5
votes
1answer
1k views
In an arcpy script, how do I convert ArcGIS date value to a string reading in mm/dd/yyyy format?
I am writing an arcpy tool script in ArcGIS 10.0. In a fGDB feature class, I have a Date type field. I gather that the values in the Date field are stored as long integer dates, but they display in ...
5
votes
2answers
109 views
ArcMap Arcpy scripts: How to handle user password input?
I'm currently trying to write a script that has a username & password input which then returns some data if the user has appropriate access. The script works just fine when I hardcode my own ...
5
votes
2answers
113 views
Exit Python script in ArcGIS 10.0
I have a script with an bail-out function like so:
def die():
from sys import exit
exit()
Occasionally in the script I check a condition and exit if necessary. This works great in 10.1, ...
5
votes
1answer
4k views
How to access data from a selected feature in ArcGIS 10?
First to describe my problem as I see it. I've been asked to design a tool that will take a selected features attributes and copy it out to an output table, with each successive selection and ...
5
votes
3answers
1k 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 ...
5
votes
2answers
218 views
Correct usage of a counter using arcpy.da.UpdateCursor
In the Python code inside a Calculate Value tool in my model, I have the following:
getNum("%Selected Features%")
def getNum(ftr):
lst = [4, 11, 15] #values for SQL expression
x = 20
fields ...
5
votes
1answer
79 views
Is there any restriction on file size while using arcgis tool box or arcpy methods
I am working with ArcToolBox's tools and their python supports. I found there is some restriction on file size of shape files/feature classes etc. It makes me interested to know about is there any ...
5
votes
2answers
925 views
Frequency, summarize tool
I'm looking for some general frequency, summarize tool.
What I basically want is some tool like the summarize tool in ArcGIS (right click in the attribute table> summarize) that runs on all attributes ...
5
votes
2answers
831 views
Use arcpy.mapping to list broken data layers?
I want to list all the broken links in all mxds in a server drive. But whenever I try I get an error come up. Can someone use a specific example, say the drive is D drive, how would I put it into ...
5
votes
3answers
648 views
arcpy taking longer and longer in a loop
I am looping through an amount of point arrays, creating data on the fly.
The features/arrays, are largely similar in size. One thing I have noticed, is that when I start the process, the time it ...
5
votes
1answer
2k views
How do you write a world file when exporting a TIFF with ArcPy Mapping?
According to documentation, the options are:
Syntax
ExportToTIFF (map_document, out_tiff, {data_frame}, {df_export_width},
{df_export_height}, {resolution}, {world_file}, {color_mode},
...
5
votes
1answer
94 views
How much database bloat is reasonable?
I use personal geodatabases to hold all the data for my projects (probably around 10-20 feature classes across 2-4 datasets on average). I use the personal gdb because I like being able to hook into ...
5
votes
2answers
144 views
Make Buffer like Offset in Arcpy
I would like to make a buffer for a polyline and get as Output a Polygon with the same angles as the polyline, having not arcs, like in ordinary buffers.
i tried the FLAT option in arcpy, but it's ...
5
votes
1answer
284 views
How to keep spatial reference using arcpy.RasterToNumPyArray?
I am using ArcGIS 10.1, and want to create a new raster based on two preexisting rasters. The RasterToNumPyArray has a good example which I want to adapt.
import arcpy
import numpy
myArray = ...
5
votes
2answers
148 views
Using newly created features in the next part of a python script
Good Afternoon
I am trying to write a python script which buffers a large number of features from a geodatabase (but not all) and then dissolves the newly created buffer shapefiles together. ...
5
votes
2answers
565 views
arcpy.UpdateCursor for multiple fields
I've hit a wall trying to loop through multiple fields with arcpy.UpdateCursor. I have a list of files (2) with multiple fields (10-15'ish) that have its own error check in SQL, and an error value to ...
5
votes
2answers
187 views
Check validity of file geodatabase using arcpy
AS the title suggests, how can I whether a GDB file is valid using arcpy? One approach is, only checking the whether the name ends with .gdb, but that's not a robust approach. Because a normal file ...
5
votes
1answer
842 views
Is there a way to delete a raster using arcpy / ArcGIS 10.0?
I'm trying to find a way to delete a raster dataset (in any format) using arcpy. As it is now I have been writing custom functions for each file type (eg, delete directory and pyramids for grids, ...
5
votes
2answers
1k views
How do I calculate a weighted centroid with respect to a raster, e.g. population weighted centroid
In ArcGIS 10.0, how do I calculate the weighted centroid of a collection of polygons, where I want the weight to be a raster layer. In particular I am using a raster of population counts and would ...
5
votes
1answer
431 views
How to Make a New Shapefile Based on Attributes of an Existing Shapefile?
In my last post I had an issue where I wanted to create multiple shapefiles based on only one attribute field (years). How to do it was answered in that post. I want to make that tool more dynamic so ...
5
votes
2answers
235 views
Problem with the where clause in ArcGIS when dealing with variables
I am writing a python script for ArcGIS. I have an input feature class which contains multiple pipelines which is saved as a variable InputPipeline. I would like to iterate through the pipelines and ...
5
votes
2answers
406 views
Create a polyline buffer with Arcpy
I'm trying to write a python script with ArcPy that draws arcs and I've achieved something with creating a buffer and then clipping it with a bounding box so I only keep the length I need (I thought ...
5
votes
2answers
753 views
Calculating slope cell-by-cell in ArcPy
I am relatively new to the ArcGIS-Python environment and want to calculate elevation raster slope. But it says "ValueError: setting an array element with a sequence". Below code is what I have. Any ...
5
votes
3answers
3k views
How to use Arcpy UpdateCursor to update a field?
This should be simple but I've spent days trying everything to get it to work. I need to update a field in a layer based on two other fields. I can't even get it to update based on one field. Could ...
5
votes
1answer
80 views
problem with “Con” conditional expression
I created a python script where I use Con (Spatial Analyst). Till now I passed the where clause value as value>1000 and it worked fine for me. But recently I found some raster on which Con ...
5
votes
1answer
254 views
Guidelines for organizing Python Toolboxes (.pyt) in ArcGIS
For one of my tasks I need to create a Toolbox with three tools (python scripts).
Instead of ordinary tbx I've decided to write it as Python Toolbox (pyt).
Everything is clear except the "good" way ...
5
votes
2answers
843 views
Using SearchCursor to access & export values in a raster table
I am desperately trying to export the values in a raster table to a .txt file. I've seen some other folk post about this, but for some reason can't get the code to work in my case.
I have a raster, ...
5
votes
1answer
729 views
Get shape filename in attribute field using field calculator
I apologize for crossposting against the ESRI geoprocessing forum, but it seems like this one gets answers. I'd like to have a modified append tool (ArcToolbox) that takes multiple shapefiles with ...
5
votes
4answers
961 views
Creating perpendicular snapped polylines between an existing point and polyline using arcpy
Here's my situation - I'm working on a project that requires 20,000+ short connector lines be created, each drawn from a point to a snapped location on a nearby polyline such that the resulting ...
5
votes
1answer
542 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 ...
5
votes
4answers
3k views
'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 ...

