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

learn more… | top users | synonyms (1)

1
vote
1answer
15 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
63 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 ...
4
votes
3answers
50 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 ...
-1
votes
0answers
10 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
38 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 ...
0
votes
0answers
35 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
46 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
29 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
24 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 ...
0
votes
0answers
48 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
26 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
vote
1answer
28 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?
6
votes
2answers
226 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
31 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
44 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
51 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
142 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
58 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
33 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
42 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
40 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
134 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
30 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
30 views

TIN to Raster - specify raster's origin

How could I specify raster's origin, while using arcpy.TinRaster_3d?
1
vote
0answers
40 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
21 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
32 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
37 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
41 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
66 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
39 views

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

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
35 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
30 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
53 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
0answers
22 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
39 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
56 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
72 views

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

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
32 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 ...
4
votes
1answer
44 views

Changing value field when applying symbology from layer using Python Add-in?

I have a python addin button that creates a layer file from a polygon feature class in ArcMap. I want to take that layer file and, with user input from a combobox, apply it back to the feature class ...
2
votes
1answer
35 views

Map algebra from files in multiple directories

I'm a rookie in python programming. I want to do map algebra for multiple rasters but these rasters are in different folders. Here's the code ive created so far: #Importing modules import arcpy from ...
4
votes
1answer
83 views

Renaming 1,200 rasters in File Geodatabase using ArcPy?

I've been tasked with renaming a large amount of raster files within a file geodatabase (ArcGIS style). I'm taking weather data which has a name format as such: "G"mmddhhhh I'm trying to add a year ...
4
votes
0answers
43 views

arcpy - ascii encoding error when updating field content in SQL Server table

I know there are plenty of posts and blog explanations about unicode errors, but I still can't figure out to handle it in my particular case. So here is my problem: I am writing a Python script to ...
2
votes
2answers
33 views

Running ArcGIS Data Reviewer using ArcPy?

I want to run the ArcGIS Data reviewer in Python code, to check domains. My scenario is check the attribute values if its meet the domain value. Is it possible to run ArcGIS Data Reviewer in ...
1
vote
2answers
47 views

Creating shapefile from selection - remove from map

I am iterating over a shapefile and creating a new shape from each row. I will be creating several thousand individual shapes and do not want to inundate my TOC with that many layers (I bet ArcMap ...
4
votes
1answer
47 views

How to extract certain values from a table using the SearchCursor Tool

I am trying to write a python script to extract certain values from a table: the table I am referring to is a big collection of nitrate values for different water depths, which are deposited in the ...
1
vote
2answers
33 views

Run FME Script in batch file using .NET

Encountered another roadblock. I have a working FME script that I want to automatically run using a console app. I created a simple batch file which accepts a MDB file path as parameter: fme.exe ...
2
votes
2answers
54 views

What is the most efficient method to iterate geoprocessing operations through an attribute table?

I want to calculate the clipped raster layer percentage for a shapefile consist of overlapping polygons, since ArcGIS doesn't support tabulate area for overlapping features, so I used a loop to ...
3
votes
0answers
35 views

ArcPy: Initialize zero valued grid Raster and iteratively increment

I'm jumping right into ArcPy to help out a friend who needs to automate some ArcGIS work. The problem at hand can be reduced to the following pseudocode: accumulationRaster = SomeZeroedRaster for ...
1
vote
0answers
27 views

arcpy: changing lyr data source (raster layers)

I am trying to create a lyr file for each raster file in a folder. To get exact same display settings I thought I would create a lyr file, then, using arcpy copy-paste it for each file in folder and ...