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

learn more… | top users | synonyms (1)

-1
votes
1answer
58 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 ...
1
vote
2answers
295 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
637 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
97 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
77 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
34 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
51 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
39 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
33 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
67 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
55 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 ...
1
vote
1answer
242 views

Installing pandas with Esri's python?

Trying to get pandas to import, but I'm getting what looks like an error caused by a failed dependency of the version of my Esri-provided numpy's compile, based on this stackoverflow posting. Here's ...
4
votes
1answer
142 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
91 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 = ...
6
votes
2answers
85 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
33 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
157 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
266 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
76 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
48 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 ...
2
votes
1answer
70 views

Problem with Python codeblock recognizing a field

'<'First Post Alert> I've been through multiple iterations / gyrations, and while there may be multiple problems here (and I'll appreciate feedback on all of them), the recurring issue is that the ...
1
vote
1answer
32 views

Unable to drag and drop current map elements into custom geoprocessing tool?

I know there mus be a simple solution to this but for some reason i cant figure it out. I have scripted an arcpy tool and the tool works fine in Arc10.2. The only problem is when I use the tool i ...
2
votes
1answer
53 views

How to SUM field, insert SUM into new field based on FIELD

This is a continuation of my previous question in an effort to build upon it. How to SUM field and then insert into NULL column? Given the examples of my data below, I would like to be able to ...
3
votes
2answers
109 views

Calculate field values using random integer derived from count of like features

I have a feature class which contains features classified by type. What I would like to do in my new field is generate a random number sequence for those like values using a count of the like values. ...
1
vote
0answers
38 views

Join does not return matching records after 1001 records have been successfully joined

I'm working on a process that joins a feature layer to another feature class. The code is as follows: arcpy.MakeFeatureLayer_management ("New_FC", "newFC_layer") ...
1
vote
1answer
84 views

Unable to open feature class Failed to execute (RasterToPolygon)

I'm trying yo execute the RastertoPolygon conversion tool in ArcGIs 10.1. I'm executing it through a for loop, then it resulted to an error (Unable to open feature class Failed to execute ...
0
votes
1answer
85 views

How to count number of fields in table (or feature class) using ArcPy?

arcpy contains a ListFields method, which "Lists the fields in a feature class, shapefile, or table in a specified dataset". The resulting object has a count method, but I can't see how to return the ...
0
votes
1answer
66 views

Hiding selected features in ArcGIS for Desktop using ArcPy or ModelBuilder?

I'm using data driven pages to create a series of maps of point features. Some of my features overlap spatially and I only want to show some of them on each map. Once I select the features which I ...
1
vote
1answer
102 views

Using Alter Field tool of ArcGIS for Desktop on shapefile?

According the ArcGIS 10.2.2 help this should work: inZoneData = sys.argv[1] # This is a shapefile fieldList = arcpy.ListFields(inZoneData) for field in fieldList: if field.name.upper() ...
3
votes
3answers
155 views

Using da.SearchCursor to get count of unique values in a field

Is it possible to use arcpy.da.SearchCursor() to get a count of unique features in a field without a dictionary? So, by this I mean if I have a field called TEXT which contains 10,000 rows populated ...
3
votes
2answers
113 views

Calculate Field Syntax: If statement over many fields

Apologies if this has already being asked but I couldn't find a page pointing to this problem. I'm struggling with the python syntax in the Calculate Field so that, in the table above: if b, c, d, ...
4
votes
1answer
124 views

How to SUM field and then insert into NULL column?

I am only in the beginning stages of learning Python. I have a column, 'QUANTITY_SOLID', that I want to take the sum of all of its rows. I understand I can do this with 'SUMMARY_STATISTICS', but i'm ...
2
votes
1answer
822 views

64 bit Python on ArcGIS 10.2.2 for Desktop

I am trying to have Python 64-bit with ArcGIS so that I can use my entire RAM when doing data analysis. Apparently ArcGIS 10.2 Desktop comes just with 'Python 32-bit'. Should I install a fresh Python ...
2
votes
2answers
64 views

Avoid adding new generated intermediate layers into ArcMap during Python script running?

I am running my script to do geoprocessing in the python window of ArcMap. Since the geoprocessing includes lots of intermediate files, and these files were added in ArcMap at the same time of the ...
1
vote
2answers
142 views

UpdateCursor only takes last value of SearchCursor

I have this piece of code: #written on python 2.7 for ArcGIS Desktop 10.2.2 import arcpy #set to folder where features are located arcpy.env.workspace = "c:\\Users\\python_ex" #on windows use \\ ...
3
votes
1answer
70 views

Build Network Dataset with python comtypes

I know this isn't possible in arcpy, so I thought I'd give it a stab using comtypes. I am trying to translate some of the VB.NET code to create a network dataset from the help docs: ...
1
vote
1answer
133 views

AttributeError: 'unicode' object has no attribute 'save'

I'm trying to multiply my raster to 100 from my ListRasters. I've adapted the code (especially the for loop portion) also from this site. Now, I'm encountering an error at the last line, when saving ...
1
vote
1answer
39 views

Add multiple fields to attribute table by python, with a prompt window for parameters

I know how to add field to arcmap shapefile using Python: import arcpy arcpy.env.workspace = "H:\pythonexercise\NZL_rds\NZL_roads.shp" arcpy.AddField_management("NZL_roads", "LENGTH", ...
2
votes
1answer
82 views

Removing last point in polygon geometry using ArcPy?

This polygon was created from a grid of 500 x 500 meters, then Union, Generalize and Dissolve was used to arrive at this geometry, the laspoint not help me, I just want to have points on each vertex. ...
3
votes
1answer
81 views

Copy multiple features in feature class, update field value based on number copied

I have created a field which will indicate the records I want to alter. What I want to do is then cycle through these records, each will contain sum values in a field.Based on the sum I want to copy ...
4
votes
2answers
93 views

How to get arcpy.da.walk to continue walk after encountering corrupt/problem file?

I am relatively new to python. I am trying to iterate through all DWG polylines in a directory with multiple (hundreds) of subdirectories. I would like the code to skip any DWG files that it cannot do ...
2
votes
2answers
57 views

Reclassify a rasterList and sum the reclassified value from each Pixel

I'm trying to write a script in arcpy which reclassified a List of Rasters. This rasters are made by another tool before so there is already a loop. Actually I get the error 000582 and before this ...
0
votes
0answers
82 views

arcpy.Clip_analysis() Automatically Affixing .shp.shp to Target Feature Class Name?

I created a Python script that was previously working fine, but is now giving me an error when I try to use the arcpy.Clip_analysis() function in arcmaps 10.2.1. I am not adding a filetype extnsion ...
-3
votes
1answer
49 views

Why do I get a NameError: name 'gdbSuccessCount' is not defined?

I'm using a 412-line script that gathers and merges online tile data. However, I'm receiving a Traceback error, NameError: name 'gdbSuccessCount' is not defined. I've included the portions of the ...
1
vote
1answer
73 views

Buffering a PointGeometry in arcpy only returns a line?

I am trying to buffer a PointGeometry object in arcpy to a Polygon geometry object with ArcGis 10.2. The PointGeometry object is in lat/lon WGS84 coordinates and as far as I understand, I can only ...
0
votes
1answer
54 views

Is it possible to import arcpy module to PyPy interpreter?

I'm trying to use PyPy for my code because of speed. But my code needs arcpy module to run and I cant find out how to install or import this module to arcpy. I'm using PyPy 2.3, Python 2.7 and Win 7. ...
1
vote
1answer
55 views

What is the file structure of an ArcGIS Place File?

Does anybody know format of .dat file to help with bookmark automation?
2
votes
3answers
128 views

Points from python directly to ArcMap

I have a python code that is generating coordinates one by one. Is there a way to display them directly in ArcMap as they are generated? I am aware of the insert cursor but the lock on the table ...
1
vote
1answer
75 views

Subquery in SearchCursor with ArcPy?

I'm searching for the value from the field "demA_demA" which has the lowest elevation by having the value 8 from the field "outTable_2". How can I do this in the following script. import arcpy ...