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

learn more… | top users | synonyms (1)

3
votes
1answer
37 views

Creating individual points from count field in point feature class using ArcGIS for Desktop?

I have a point feature class with a count field associated with each of the points. I would like to create a new feature class where each of the points are duplicated by the value of the count ...
0
votes
1answer
22 views

Detecting Runtime Errors in Arcpy Loops [duplicate]

I am looping over a feature in Arcpy and doing several geoProcessing tasks on each feature/iteration. The loop runs pretty well but crashes on some of the features. I dont really know why but its ...
2
votes
1answer
62 views

Basin numbering according to Pfafstetter Method?

I would like to divide my basin into subbasins and numbers according to the Pfafstetter method. Is there an easy way to implement this in Python using ArcPy? Or are there some freely available ...
0
votes
0answers
52 views

ArcPy loops/cursors faster without background processing?

I am running loops via cursors and raw Python in Arcpy. Within the loop several processes take place, selecting shapefiles and converting to raster, clipping, running euclidean distances, extracting ...
5
votes
1answer
116 views

Pause ArcPy script until feature class lock goes away

My script needs to copy data into a feature class to an SDE geodatabase that might have a lock on it from another application. I shouldn't break the lock (that app has priority over a data update), ...
0
votes
0answers
49 views

Arcpy Table To Table Conversion Error

I am running a script that uses an excel spreadsheet to define and output maps, kinda like my own data driven pages set up. The only input into the tool is the path of the spreadsheet. When I run ...
2
votes
1answer
58 views

Is it possible to create a data frame graphic using arcpy?

I'm interacting with an MXD using arcpy, and wish to create a graphic within a data frame - as with the Draw toolbar when working manually. The GraphicElement page says... The GraphicElement ...
1
vote
1answer
48 views

Multivalue processing in the context of the modelbuilder

I am new to python so please bear with me. I have the following script that is supposed to get a multivalue parameter of several shapefiles as an input and then run the unionanalysis on all these ...
1
vote
1answer
70 views

How to set workspace from input Feature Class?

How to set workspace from input Feature Class ? is there an attribute of the source GDB for a feature class ? some times the FC is in a dataset and some time it isn't, How can i get the path of source ...
1
vote
1answer
62 views

Calculation of a text value, The value of which is separated by a special character

How can I calculate a text value, the value of which is separated by a special character? For example: dog | duck, I would like to keep the first value: dog or elephant | cat, I want to keep ...
0
votes
1answer
54 views

D8 algorithm to get the flow direction in ArcGIS

I am using ArcGIS 10 for the get the flow direction from DEM. I wonder about the algorithm they have used while calculating flow direction. It is mentioned there that it is using D8 model. D8 model ...
2
votes
1answer
38 views

Intersect shapefile with raster, then determine proportion of each raster value?

Using the arcpy module in Python, I want to find the proportion of each pixel value within the boundary of an overlaying polygon. (The polygon is in a shapefile.) For example, there are 10 possible ...
3
votes
1answer
89 views

ArcPy delete terrain: cannot be deleted

I can't get my ArcPy script to delete a terrain. If it exists, it should be deleted. However it throws an ERROR 000317: {path} cannot be deleted My script is a lot longer than this, but this ...
5
votes
3answers
102 views

Is it possible to calculate statistics across multiple fields in arcpy?

The summary statistics command can be used in arcpy to calculate statistics - this tool runs against a single field, eg: SUM—Adds the total value for the specified field. Is there an ...
0
votes
0answers
19 views

How to make a loop to MakeNetCDF Table View?

I was trying to write a code to extract grid point data from the NetCDF file. I am able to view and save the table data extracted as follow #Import system modules import arcpy # Set local ...
3
votes
1answer
83 views

Using Python Add-In to delete/remove ArcMap layers that are turned off?

I have made a python addin button which removes layers that are turned off in an MXD. The strange thing is that I get different results depending on whether I run the python commands in the python ...
1
vote
0answers
53 views

Creating symbology by category in python?

I'm trying to create a python script that creates color-coded symbology by county for multiple maps with different data. I've never created a layer file for the purposes of symbology before, but I ...
4
votes
1answer
61 views

Arcpy Cell Statistics - maximum number of input rasters

I am running cell statistics in arcpy. Essentially I am summing together a folder of grd files to create a new grd representing their sum This will eventually take place on a folder of 20,000 raster ...
1
vote
1answer
57 views

Model Builder or a python script for pulling SDE data in a single GDB file

Would like to know if Model Builder or a Python Script would be better for pulling dozens of fc from ArcSDE into a single .gdb file ? The tool will need to be run on a regular basis.
3
votes
1answer
29 views

How to find the distance between start of line and start of raster with arcpy/python?

I'am creating a python script tool for ArcGIS Desktop 10.1 to extract profiles. I’m using stack profile to extract values to a table but stack profile only outputs values where the line and raster ...
2
votes
1answer
77 views

ArcPy inconsistently accepts SQL queries for MakeFeatureLayer or SelectLayerByAttribute

I need to buffer a subset of features in a particular feature class. To do this, I am first creating a feature layer (using a SQL query to select only what I want), and then running Buffer. So my ...
2
votes
1answer
42 views

How to save MakeNetCDFTableView output?

I was trying to extract the time-series data from the netcdf using grid points (lat/long) by MakeNetCDFTableView. I have more than 100 grid points and I want to extract the data from the netcdf file. ...
-1
votes
1answer
33 views

Is there a method in ArcObjects that is equivalent to ArcPy's: SelectLayerByLocation_management?

I have 2 IFeatureClass and I want to do an INTERSECT between the two. What is the best way to do this from ArcObjects?
8
votes
2answers
309 views

Does dissolving features improve geoprocessing efficiency?

I have a large set of line data (>140,000 features). Is there a processing advantage, in either time required or (more importantly) memory used: to running Dissolve on the data before running ...
1
vote
1answer
41 views

Overwrite option on a standalone ZonalStatisticsAsTable using ArcPy

How can I code an "overwrite option" on a standalone ZonalStatisticsAsTable using ArcPy? I don't see any overwrite option from a Esri example. # Execute ZonalStatisticsAsTable outZSaT = ...
1
vote
0answers
56 views

Cause of Error 000308: Invalid Field Type when batch running ArcPy script?

This is my first post on this site. I am using ArcGIS 10.2 for Desktop. I wrote a simple script in the form of a python toolbox to calculate the speed of travel between consecutive entries of a ...
2
votes
1answer
63 views

How do I rename rasters in an mxd by using my csv?

I have the following data in a csv: RasterName First name Raster 1 Aaron Raster 1 Paul Raster 2 Bryan Raster 3 Cranston Raster 3 Vince I have added these ...
2
votes
3answers
154 views

Clipping faster (i.e. in bulk/batch) in ArcGIS for Desktop?

I have 100 different input vector layers and one clip feature vector layer. I have to clip them 100 times but its a large amount of work. Is there any Python script (ArcPy) in ArcGIS for Desktop ...
3
votes
1answer
64 views

How write query in “Select_analysis” that compare string from one column with another column?

I have a shp file (s.shp) with column "A" and column "B". I try copy from this file only that rows where string value from column "A" is part of string value from column "B" e.g. A 0.1 0.2 0.3 ...
0
votes
0answers
72 views

Cause of ExecuteError: ERROR 999999: Error executing function from Spatial Join?

I'm trying to use the spatial join to append rows to my target feature from my join feature. Here's my code: #import the module import arcpy from arcpy.sa import * from arcpy import env ...
2
votes
0answers
65 views

Converting KML To Layer using ArcPy losing objects?

I am trying to a convert kml file to a layer using python. This is my code: import arcpy arcpy.KMLToLayer_conversion('C:\kml\\result.kml', 'C:\kml', 'result') But the layer has lost a lot of ...
2
votes
1answer
62 views

Using auto increment code with counter

I was wondering if it's possible to use the standard auto increment code to work on groups of records: FeatureClass = "newFC" recs = collections.defaultdict(int) autoIncrementEXP = "autoIncrement()" ...
2
votes
1answer
159 views

Python Syntax Error when running Python Snippet of successful geoprocess

I am having an issue with a simple python snippet. Here's the background: I wanted to include an additional step in a nightly update script that replaces characters in a field that simply do not play ...
1
vote
1answer
46 views

Specifying output coordinate system in ArcPy

I'm updating somebody else's old Python scripts, and trying to make sure I understand their logic and desired outputs while streamlining the code. In this particular script, it specifies an output ...
0
votes
2answers
34 views

TIN to Raster - specify raster's origin

How could I specify raster's origin, while using arcpy.TinRaster_3d?
1
vote
0answers
144 views

Copy Features giving ERROR 000210: Cannot create output in ArcPy?

I have an issue where I'm trying to save separate feature classes for each route in an already solved closest facility problem, and one seemingly arbitrary route won't save. I tried to look at the ...
0
votes
1answer
31 views

How to resolve ERROR 010271: Raster does not have an attribute table?

From my code which builds least-cost paths between several polygons by using the functions "CostDistance" and "CostPath" of ArcGIS , I obtain this error message: ExecuteError: ERROR 010271: Raster ...
2
votes
1answer
68 views

RuntimeError: Field is not editable when using InsertCursor on ArcSDE geodatabase with ArcFM installed?

We are running ArcGIS Desktop 10.1 SP1, and also have ArcFM installed. I have this simple code: workspace = "C:\\my.sde" arcpy.env.workspace = workspace edit = arcpy.da.Editor(arcpy.env.workspace) ...
1
vote
1answer
62 views

arcpy searchCursor numeric variable in where clause

I know this question has been answered but I am not seeing an adaptation that I can understand. I am trying to use a numeric variable in a where clause and just having a hard time figuring it out. ...
1
vote
0answers
59 views

Making Map with Color Ramp Using SQL Database Intergration?

This could be a trivial question, but I've been kind of stuck on it for awhile. I'm trying to construct multiple maps that reflect aggregated data showing overall risk by county in a SQL Database ...
4
votes
2answers
84 views

How to access raster NoData value?

I am trying to programmatically access the NoData value in a raster dataset as shown in the screenshot. Two tools that come to mind to describe raster properties do not seem to be able to describe ...
1
vote
0answers
75 views

Cause of Field Calculator UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 5: ordinal not in range(128)? [closed]

def Befahrung(value1,value2): if value1 is ' ': return ' ' else: return "G:\\Example\\" + str(value1) + "\\File_" + str(value2) + ".pdf" I try to create a field with a hyperlink. It works ...
1
vote
1answer
52 views

How to get Last ObjectID of feature class using ArcPy?

I have a feature class and I need to know the ObjectID of its last record. What is the best way to find out last ObjectID? Opening a search cursor and reading all the records is one way, but is ...
0
votes
0answers
51 views

How do I change graduated color class values with python?

I am trying to use python to adjust my graduated color symbols' class breaks and labels. The layer is a query layer tied to an SQL DB and I want to be able to execute my python (after the database has ...
1
vote
2answers
82 views

arcpy.mapping.Layer error when working with files over multiple dataframes

I can get the following code to run in an mxd with a single dataframe. I need it, however, to run and loop through an mxd that has multiple dataframes with identically named files and data sources to ...
2
votes
1answer
47 views

Populate a layout text element with the description from a coded value domain

ArcGIS 10.1+ lets you easily put dynamically populated text boxes in your print layouts. Doing so puts some text in the text element that looks something like this: <dyn type="page" ...
2
votes
2answers
40 views

Performing a Python scripted tool based on whether a field is populated or not

My question is if I'm running the ArcMap Dissolve tool through a Python script, how can I tell it to check for attributes in one field, and if that field is empty, to perform the tool on another ...
1
vote
1answer
97 views

How to merge Shapefiles from multiple folders into Geodatabase Featureclass?

I have a question regarding the merge of a lot of folders, which has a lot subfolders, which has the shapefiles stored. I would like to merge all those in one geodatabase. So I thought to use a ...
1
vote
3answers
81 views

How to generate automatically the name of output parameters in a python script tool? [closed]

I have some Python script tools in ArcGIS for Desktop. I need to reproduce what all geoprocessing tools do when the first input parameter is introduced: autogenerate a workspace and basename for the ...
1
vote
0answers
50 views

How to batch process near feature distance in ArcGIS

I have 2000+ point shape files. These are all GPS tracks. I want to calculate the distance from each point to the nearest feature (road, train line, restaurant etc) within a 30 meter radius. I am ...