A site-package created by Esri to expose many ArcObjects to Python.

learn more… | top users | synonyms (1)

3
votes
1answer
547 views

How to rotate labels using ArcPy?

I'm writing Python code for ArcGIS using the arcpy library and now I'm experiencing a little problem with labels. In fact I'm not able to rotate them in layout via arcpy (I should rotate all labels of ...
1
vote
1answer
496 views

Converting arcpy based python script to OGR for semi-automated Metadata creation

I have created a script to automatically generate base ANZLIC standard metadata using arcpy based coding. Can anyone help me convert it to OGR/GDAL python? This is so that it can be run in QGIS and ...
0
votes
1answer
2k views

arcpy.RegionGroup fails with error 999999. Workspace or data source is read only

outRegionGrp = RegionGroup(inRaster,"EIGHT", "WITHIN", "ADD_LINK", valToIgnore) arcgisscripting.ExecuteError: ERROR 999999: Error executing function. Workspace or data source is read only. The table ...
4
votes
1answer
891 views

Why can't I multiply two string fields in the Field Calculator by converting them to int() and float()

I'm using ArcGIS 10 and new at python scripting. I have a string field that I need to calculate by multiplying two other string fields. I can do it in python using two arbitrary values... CINPT1 = ...
5
votes
1answer
342 views

What is the most efficient way to get a list of featureclasses from a large ArcSDE database?

I have a SDE DB which consists of 40 feature datasets and around 300 featureclasses. I need to get the full list of all featureclasses whose name does not contain "ARCHIVE". It takes several minutes ...
4
votes
1answer
3k views

Detecting duplicate attribute values in table using ArcPy without Advanced/ArcInfo level license?

In ArcMap, the right-click Summarize option very quickly creates a frequency listing of the chosen field: Note that the count field shows the count of duplicate values. How can I access this ...
1
vote
3answers
8k views

Python Script for Select by Attributes taking user input

I am trying to write a python script and create a script tool in ArcGIS that will let a user choose the value or values that will be used to extract a shapefile. These selected value(s) will then need ...
4
votes
2answers
1k views

Arcpy remove invalid character

I've built a model that takes the name of the Excel worksheet containing xy data, and uses that name as the name of the output shapefile. ( Worksheet "massachusetts_sightings" in an xlsx becomes ...
1
vote
2answers
2k views

How to Set up Data Driven Pages using arcpy?

I've read a lot about the topic data driven pages. I'm writing a python script for ArcGIS and I've defined my stripmap using the arcpy.StripMapIndexFeatures_cartography command and now I have to set ...
19
votes
1answer
2k views

How to Split a Concave Polygon Into Convex Polygons in Arcpy?

I'm looking for a tool or algorithm to detect concave polygons and split them into convex polygons. Like explained in the picture, the blue polygon is split into A and B polygons I'm using Arcpy ...
1
vote
2answers
970 views

pour point user click input over map for watershed delineation

I have a drainage density map and i want to interactively retrieve watershed by clicking a point on map. Once I zoomed to an area of interest and click the highest accumulation point of my choice then ...
8
votes
3answers
1k views

python script error- with GetParameterAsText [duplicate]

I have a seemingly simple code which iterates through a list of feature classes and calculates an ID field in the attribute table that is equal to the first 5 characters of feature class name. The ...
3
votes
2answers
2k views

Getting values from attribute table and inserting another table using ArcPy?

I have line feature class of a river network and “FromTo” table. Lines are dissolved so they are not segmented from junctions. I need to write a Python script in ArcGIS to do following: Begin from ...
7
votes
2answers
4k views

arcpy overwrite files in a geodatabase file

I'm writing a python script, I've got an mxd and its workspace is a geodatabase file with all the files I need into. The problem I'm encountering in testing and writing code is that, despite of the ...
2
votes
1answer
4k views

How to calculate polyline azimuth or polyline direction?

I am looking for a Python code block to calculate azimuth per each polyline feature. So far I have been able to use the following Python code to calculate bearing: 180 + math.atan2(( ...
1
vote
1answer
696 views

Appending from file geodatabase to ArcSDE fails using ArcPy?

I'm trying to append a feature class from a file geodatabase to an Arcsde featureclass using this line of code: arcpy.Append_management("parcel_copy", sde_path+"parcel" ,"NO_TEST") This line works ...
5
votes
2answers
925 views

arcpy - how to check if a domain contains a particular coded value?

How can I check if a domain contains a particular coded value? How to check if domain already exists? shows how to verify whether a domain exists in a geodatabase. However, I can't see how to check ...
6
votes
1answer
910 views

Why are results from Python tool not in Results window?

I am relatively new to ArcPy 10. and I want to return the list of feature class from a dataset. I can see them through the message, but cannot see them from the result window. Actually there are only ...
4
votes
2answers
1k views

How to programmatically work with featureclasses from multiple geodatabases?

I have produced a Python script which creates multiple buffers of specific (listed) feature classes within a geodatabase. This is achieved by running each feature class through a for loop. I would ...
9
votes
1answer
2k views

Creating table containing all filenames (and possibly metadata) in File Geodatabase?

I need to create a metadata-table for all files in a File Geodatabase or Spatial Database. It would be awesome if it were possible to automatically be updated with new filenames, and possibly even ...
6
votes
1answer
427 views

Why does tool take longer to run when in Python script?

I have written a python script that does some euclidean allocation. For that I use arcpy.gp.EucAllocation_sa() method. Now, my python script takes 30-40% extra time than spatial analyst euclidean ...
0
votes
1answer
232 views

Python adding grouplayer to muliple maps

I have the following code which is supposed to add a one group layer to each of the maps. In this case the group layer is always the same. Desired output: Map1 = 1 group layer added Map2 = 1 group ...
4
votes
0answers
4k views

Assign symbology to multiple layers in one operation? [duplicate]

Is it possible to assign the same symbol to multiple layers of the same geometry type within an ArcMap document in one operation? For example, I was hoping to: Select multiple layers in the TOC ...
5
votes
3answers
5k views

How to create lines from points pair coordinates with arcpy?

I've got some points pair coordinates (start and end points) which I have to transform into lines. Until now, I used an append of both the coordinates in a pippo.Point(), a pippo.CalculateGeometry() ...
3
votes
1answer
1k views

How can I use a variable to specify which field to update with arcpy.UpdateCursor?

I am writing a script that cycles through several different point shapefiles, finds how many lie within a given area and the writes the outcome to a table in an Access database. I've used an search ...
2
votes
1answer
211 views

Renaming rasters in directory based on field value of centroid feature class in ArcGIS Desktop?

I have a lot of rasters named like r001.tif, r002.tif and so on. There is a point shapefile with centroids of these rasters and their real name in the attribute table. I'm looking for a way or ...
53
votes
10answers
4k views

Alternatives to using Arcpy

I seem to use ESRI's Arcpy site package for virtually all of my python geoprocessing. To ESRI's credit, these are an incredible suite of tools that can help accomplish a great deal. However, I would ...
1
vote
2answers
88 views

Automating attribute completion of new polygons

I am currently outlining property boundaries and then copying and pasting in the necessary attributes on a daily basis. I would like to speed up this process and remove the chance of error by ...
2
votes
0answers
1k views

Why am I getting an ERROR 000728: Field *fieldname* does not exist within table even though field exists?

I do some script for a shapefile's table. And this script works for 2 fields and do not for other ones, because of: ERROR 000728: Field FID_158_01 does not exist within table But this field is ...
4
votes
2answers
1k views

Delete all fields from feature class with arcpy

I want to delete all of the fields from a feature class in a simple tricky way, I don't want to loop over the fields because this method is very slow in arcpy. I'm using a polygon feature class, I ...
2
votes
0answers
356 views

ArcGIS/arcpy: Geometry object comparison methods not working. Do they take z values into account?

I have an arcpy script that makes calculations based on an input PolygonZ feature class. What I need to do in several places in the script is test whether a point falls within a polygon in 2D. In ...
2
votes
1answer
854 views

How to add new data frame(s) to map using ArcPy?

I want to add a 2nd data frame to an existing "*.mxd" file. Right now, i see option to add layers and edit properties of "CURRENT" data frame but could not figure out how to add a new one and export ...
16
votes
5answers
1k views

How are people using Python data structures and classes in ArcPy?

This question may expose my ignorance on programming but I'm curious about how people are using different python data structures within ArcPy. This page lists the data structures in Python. I ...
3
votes
1answer
1k views

Panning to specific feature using ArcPy?

I am attempting to use python and arcpy to automate the creation of some standardized maps I need to export for feature classes from various projects. I have a set of points and I need to export a ...
3
votes
3answers
4k views

how to get ALL FIELD NAMES from table? (using arcpy.ListFields)

I have a table: , Script at ModelBuilder's "calculate values": Expression: a("%path%") Code BLOCK: def a(path): fields = arcpy.ListFields(path,"FID_*") for field in fields: return ...
5
votes
2answers
4k views

Clipping/exporting multiple selected vector layers in map to extent of another raster/vector layer in ArcGIS Desktop?

Is there a way to clip/export selected vector layers (more than one) in a map to the extent of another raster/vector layer at a time?? in Arcgis or any other software. I am using Arcgis10. I am ...
2
votes
2answers
2k views

How to clip multiple raster datasets with county polygons?

The example below shows three raster (i.e. in black) and a single county polygon feature class. How can I clip/extract by mask the rasters by their corresponding county polygons (i.e. Edwards, Clark, ...
0
votes
1answer
1k views

Why do i get an input error no module named arcpy when i try and import it into pythonwin?

Here is the error i get when i use the import arcpy command in pythonwin: Traceback (most recent call last): File "", line 1, in ImportError: No module named arcpy Can any one tell me how to fix ...
4
votes
2answers
607 views

focal statistics with variable radius

is there an easy way to do focal statistics on a raster, with a variable radius for the neighbourhood to be searched? As in: that search radius would be stored in another raster? i tried something ...
5
votes
2answers
236 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. ...
0
votes
0answers
173 views

How to iterate throught fields names in a table and change row values?

I got table like that one (Example). I need to change 0 to 1 and -1 to 0 in each field except first and second. The problem is that every time i have different number of fields and field name is ...
2
votes
1answer
2k views

Formatting SQL queries for use in Arcpy?

I have to make an SQL query on a column having not adequat name "type_borne_id", I couldn't make SQL queries using arcpy.Select_analysis neither selectbyattribute, but when I use select_analysis ...
1
vote
1answer
194 views

ResultObject: Error in getting output

I am getting "ResultObject: Error in getting output" message when I run the following code. I know it has something to do with "os.path.join" but can't figure out what. Thanks. Sam import arcpy ...
2
votes
3answers
667 views

Is there a way in arcpy to convert map units from feet to decimal degrees?

This is my problem: I have an arcpy script that finds the XMax, XMin, YMax, and YMin of a polygon. It shows the results in feet, but I want them to be in decimal degrees. In ArcMap I can change the ...
5
votes
1answer
296 views

Adding kernel density output to map with ArcPy

I am trying to emulate the behavior of the Kernel Density tool from the ArcMap 10 GUI in a script; in other words, I want to calculate the density of a dataset, and add the visual result to a map. If ...
2
votes
1answer
343 views

Python script for Data Driven Pages to run a series of DDP at once?

I have a several different polygon shapefiles that I am using to create individual maps for each polygon within the shapefile. The layout is the same for each map, the only thing that changes is the ...
0
votes
1answer
119 views

Creating point layer from linear layer with only ends of lines using ArcGIS Desktop?

I have ArcGIS 10 with ArcView licence and I need to make point layer from a linear layer, with only start and end points for each line. In ArcInfo I could use Feature Vertices To Points with ...
10
votes
2answers
291 views

Count raster value in a bounding box (spatial extent)

I have simple question: given a bounding box, how can I count the number of specific values (say, I am interested in the number of value == 1 ) in a raster in 1) arcpy, or 2) raster package in R?
2
votes
1answer
333 views

Python add-in won't buffer from output layer

I have a simple add-in script for Arcmap 10.1 to create a toolbar, select a layer from a drop down list of the current layers in the project, buffer that layer four-miles, then use the resulting ...
3
votes
1answer
2k views

Writing Python script to give multiple buffers of different sizes in ArcGIS for Desktop?

I want to write a loop that will cause the output to be multiple buffer shapefiles. For example, I want a circle buffer of 50ft, 100ft, 150ft, etc. Can anyone help? I'm new to this and am trying ...