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

learn more… | top users | synonyms (1)

1
vote
0answers
62 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
46 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
38 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
65 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
37 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
81 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
78 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
40 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
67 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
50 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
102 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
1answer
94 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
40 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
51 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
57 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
42 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
66 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
39 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
29 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 ...
1
vote
1answer
35 views

Determining active layer regardless of its name using ArcPy?

ArcPy has a method of defining an active map regardless of its filename or path: mxd = arcpy.mapping.MapDocument("CURRENT") I wonder if there is a similar way to define an active layer. I need it ...
2
votes
2answers
112 views

Python Window Crash and import arcpy issue

Trying to do anything in the Python shell within ArcGIS 10.2 and it just crashes once I hit enter after writing code, no matter what I do. I've tried to uninstall, deauthorize, reinstall, ...
2
votes
2answers
53 views

Arithmetic on rasters with variable names in Map Algebra/Spatial Analyst?

I'm a Python (and StackExchange) novice trying to figure out how to perform calculations on temporary rasters with variable names. My attempt at a minimum working example is below, but I would ...
-2
votes
1answer
63 views

Inserting new Text Element into MXD using ArcPy? [duplicate]

I'm using Desktop 10.2 and I tried with this script to add new text element "road 90" to a lot of mxd's, but Something wrong with the code: import arcpy from arcpy import env env.workspace = ...
2
votes
0answers
17 views

Modelbuilder only outputs Info files and logs [closed]

I am developing a processing algorithm in ArcMap ModelBuilder. When I run it everything seems to work fine and running to completion. However when I go check the output directories I only find Info ...
2
votes
0answers
21 views

Using arcpy.StackProfile_3d within arcpy addin

I want to get elevation profile in ArcScene using arcpy. Specifically, I want to create tool used as follows: click tool button, draw line interactively and output a graph presenting elevation ...
4
votes
1answer
44 views

get count of like features types based on field attributes

I'm trying to create an update cursor which will take the count of the number of like features in a field and then use that number in a random number generator. The field would look something like ...
2
votes
0answers
62 views

Cause of ExecuteError: ERROR 010067 from arcpy.sa.CostPath?

By using the code below that creates least-cost paths between several polygons, I obtain this error message: ExecuteError: ERROR 010067: Error in executing grid expression. Initalization failed ...
2
votes
1answer
63 views

arcpy.AsShape function returning RecordSet not Geometry

I have the following code: feature_geometry = arcpy.AsShape(json_string, esri_json=True) print feature_geometry print type(feature_geometry) >>><geoprocessing record set object object at ...
2
votes
1answer
20 views

queue.empty error when using search cursor

I'm having trouble with an error message and can't seem to figure out the reason which, I'm sure is something simple. I have a bit of code listed below: insertPts = arcpy.da.InsertCursor(newFC, ( ...
-1
votes
1answer
51 views

ArcGIS Erase Function in Python

Aplogoises if this has already been solved but I'm having problems using the Erase function in ArcGIS. I have had problems using the normal function, as it throws a Error9999 Topology error amongst ...
0
votes
2answers
43 views

What causes ValueError: I/O operation on closed file? [closed]

I obtain the following error message: ValueError: I/O operation on closed file Here is my code (It selects each polygon contained in the shapefile "selected_polygons.shp" and builds the least-cost ...
0
votes
1answer
72 views

What causes AttributeError: 'module' object has no attribute 'da'?

I have a shapefile "selected_polygons.shp" that contains 2000 polygons. I would like to select each polygon contained in the shapefile by using a search cursor in order to apply the function ...
0
votes
1answer
68 views

How to automatically generate least-cost paths between several polygons?

What is the fastest way to automatically generate least-cost paths (LCPs) between several polygons with ArcGIS ? I created a python program to do this by using the functions "CostDistance" and ...
2
votes
1answer
71 views

Naming directories in python?

Why is it that when I label my directories this way: arcpy.env.overwriteOutput = True arcpy.env.workspace = "C:\\Users\\Documents\\ArcGIS\\Testing" arcpy.env.scratchWorkspace = ...
0
votes
1answer
33 views

Algorithm to implement for batch processing in ArcMAP modelbuilder [duplicate]

I have a directory with about 10 polygon shapefiles. I need ArcMAP to take all these shapefiles and union them all into one layer using the model builder. I know I need to use some sort of iterator, ...
1
vote
1answer
40 views

How to get around “name 'row' is not defined” error when row in question doesn't exist?

I am getting a "name 'row' is not defined" error when I run a particular piece of code (see below). This only happens when my input layer has one entry instead of two. So when the attribute query is ...
0
votes
0answers
27 views

Wrong line segments are being matched by Spatial Join in ArcPy?

I'm working on an analysis in which I want to compare 2 polyline-datasets. In one of the first steps, I use a spatial join to create a sub-dataset with only those line segments that have an exact ...
4
votes
1answer
31 views

Changing default IDE for editing Validation code in ArcToolbox?

Do you know a way that I can change the application that opens the validation scripts in ArcGIS 10.2? At the moment hitting Edit... opens up Notepad, which ain't that friendly an IDE.
2
votes
1answer
34 views

Convert polyline to presence absence raster in arcpy

I have a polyline that I am converting to a raster in arcpy. This is occuring within a loop and at each iteration I change the processing environment to a different area of interest. In this case it ...
3
votes
2answers
55 views

Using ModelBuilder, how to define directory while using a Python script?

I have a model (shown below) in which at the very end of it I run a Python script ('SumFieldInsertNew'). One issue I'm having is that I'm creating this model for an end-user that will have little to ...
1
vote
1answer
36 views

trouble with code block execution in python script

I am trying to calculate values for a field in a python script, but keep getting an error that I don't understand: ExecuteError: ERROR 000539: Error running expression: Fron000000F1 Traceback (most ...
4
votes
1answer
125 views

Can ArcGIS ModelBuilder be exported to Python and run in QGIS?

Is it possible to construct a geoalgorithm on the ArcMap modelbuilder, export this entire algorithm to python syntax (without having ANY knowledge of python) and then import this algorithm to QGIS and ...
2
votes
2answers
62 views

Remove item from legend using ArcPy?

I can't remove item from the legend (lyr called "atikot") using arcpy with this code: import arcpy from arcpy import env removeLyr = arcpy.mapping.ListLayers(mxd, "atikot")[0] mxd = ...
5
votes
1answer
54 views

How does the deactivate function of an ArcGIS Python Add-in Tool work?

I have not been able to figure out how the deactivate function of a Python Add-in Tool works in ArcGIS. The help page that mentions the function, and that it 'causes the tool to no longer be the ...
2
votes
1answer
28 views

Using search and update cursors for random number generation

I am having some trouble getting a searchcursor to return a value for each record. The purpose of my code is to scan through a list of records in a field (FieldA) and based on those values populate a ...
4
votes
1answer
100 views

Find max and min values from a table based on two fields

I have a geodatabase table with the following fields: County_Name, State_Name, Date_Time, Customers Example Alameda, CA, 8/1/2014 12AM, 6 Alameda, CA, 8/1/2014 1AM, 1 Alameda, CA, 8/1/2014 2AM, ...
4
votes
2answers
183 views

What is the most efficient way to search a geodatabase for NULL-like records?

The problem: I have a geodatabase with several datasets and many more feature classes within. The fields within the feature classes have been populated through joins with shapefiles and manual edits. ...
4
votes
0answers
42 views

Save fails on raster object created from NumpyArrayToRaster [closed]

I am trying to save an ESRI grid built from a numpy array and am getting an error I've never seen before: Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly ...
2
votes
1answer
30 views

Table to Excel Arcpy Error

I am trying to export a point shapefile to an Excel sheet using the arcpy.TableToExcel_conversion(FinalClipOutput, ExcelOut, "", "") The "FinalClipOutput" is the result of a clip that happens ...