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

learn more… | top users | synonyms (1)

2
votes
2answers
124 views

Select points within a polygon and update attributes

This seems really simple but I can't get it to work. I have two feature classes, a polygon of sales areas for a city, and point layer of addresses. I want to select the addresses based on the sales ...
-3
votes
1answer
146 views

Exporting file geodatabase (GDB) to Folder of shapefiles?

I have a geodatabase with several feature dataset and feature classes associated with it. I want to export each feature dataset as folder and feature classes associated with each feature dataset will ...
1
vote
1answer
148 views

Importing file geodatabase (GDB) to table of contents (TOC) of ArcMap?

I have a geodatabase with several feature dataset and feature classes associated with it respectively. I would like to create a .mxd where the Table of contents consist of group layer and each group ...
1
vote
0answers
37 views

ArcPy on 64 bit Windows [duplicate]

I can't import arcpy into 64 bit Python. It works just fine in the python install from arcGIS, though. When I try to import it elsewhere, I get this error: Traceback (most recent call last): File ...
0
votes
0answers
27 views

PythonWin Debugging

My question is theoretical. I want to debug my script in Pythonwin. Everything is OK when I run my script normally (without debugging) but if I am debugging it, my script fails when it tries to read a ...
1
vote
1answer
74 views

Export Multiple Raster Data with custom Cell Size

I Have 172 Raster, and need to change the cellsize. So I use Export Data from TOC and change the cellsize manually (example I want to change it to "3") I tried using this python script to ...
1
vote
3answers
86 views

polygons to polygon conversion with attribute name [duplicate]

1) I have a polygon shapefile with 1000 multi-part polygons in it. Each Row of the table is a multipart polygon. 2) I need 1000 shapefiles with 1 multi-part polygon in each. 3) Each output shapefile ...
2
votes
1answer
80 views

ListRasters based on filename using Arcpy

I am trying to create a python script for ArcMap which calculates the ndvi from two raster images for each RGB/NIR pair in a folder. However, I am unsure how to create two raster lists; one which ...
3
votes
1answer
42 views

Accept multiple input types in ArcGIS Script Tools UI

everyone! I'm working on a python script that calculates aggregations of ACS Variables (i.e. adding "Renters who spend more than 30% of Annual Income on Rent", "...40%...", "...50%...", etc.). The ...
1
vote
1answer
64 views

How to generate a choice list (dropdown) in a toolbox that will allow the user to select a field in a csv as input?

I need to input a csv as parameter 1. Parameter 2 should be a dropdown displaying the various fields (the headerline) where I can select a column to use for geoprocessing. Param1: c:\my.csv ...
1
vote
1answer
44 views

How to ascertain if a cell/field contains a value in ArcGIS attribute table

I have done a bit of research on this but can't seem to find an answer. I am wondering if there is a way to identify whether a cell/field in the ArcGIS attribute table contains a value using the ...
0
votes
0answers
106 views

Looping through each specified layer and exporting PDF map showing shapefile and information taken from each attribute table?

I have been working on an automation script for the purpose of mass pdf exportmaps. I am required to export many pdf maps showing individual boundary files and client information. I believe the ...
2
votes
1answer
56 views

How to check shape length before running code in Python/ArcPy?

I am using a code to convert a polygon into evenly spaced parallel lines for point in range(0,numPoints+1): shortPoint1 = currentLines[firstLong].positionAlongLine(lineSpaceNum*point) ...
2
votes
1answer
38 views

How to create Multipart Line in ArcPy?

I am developing some script in where I want to create custom multi part line geometry. For example: I have one array of points a,b,c and second array of points e,d,f. I want to create one ...
0
votes
0answers
81 views

Exporting table of contents (TOC) with group layers to file geodatabase (GDB) with feature datasets?

I have created a python code for exporting shapefiles from TOC from different source folder to a output folder. However, in this case, I have some group layers in the Table of Contents (TOC). ...
1
vote
1answer
67 views

Listing all feature datasets and classes from multiple geodatabase into CSV file? [duplicate]

I have a folder having multiple geodatabase and I am calling that folder “Multiplegdb” There are 3 geodatabase in a folder which are as follows: ABC.gdb UVW.gdb XYZ.gdb Each geodatabase have ...
1
vote
1answer
37 views

Batch processing of geodatabases - join raster with table

I am unsure how to go about doing this using Python in ArcMap, though I know how to do it by hand. I have geodatabases containing gSSURGO data, one for each state, in their own folders. I have a ...
0
votes
1answer
34 views

Joining rainfall data to point features using ArcPy?

I have 180 point feature classes with rainfall totals. Each feature class represents one days rainfall for a region and has around 36K points (think of each point as a weather station in the region). ...
1
vote
1answer
59 views

Creating multiple Feature Datasets from table/list using ArcPy?

How to Create multiple Feature Datasets from a table/list. I can create a single feature dataset in a geodatabase with this python code. import arcpy from arcpy import env env.workspace = ...
1
vote
2answers
82 views

How to create a new field with a combination based on another field with arcpy?

I like to create a new txt which has two columns: Id and GRIDCODE. This is the original Table: The Id column of the new txt should have just unique values. I’m able to do this with the following ...
1
vote
1answer
44 views

ArcGIS 10.2 arcpy — how to import/install win32com?

win32com used to be included with arcpy 9.x but no longer. I used to use it to manipulate excel occasionally. I downloaded and let win32com install itself and then tried to follow some online ...
2
votes
1answer
87 views

ArcGIS “Merge” tool is slower on arcpy than when starts it with ArcGIS interface

I am writing python script on ArcGIS 10.2.2 and found some strange bug. I use merge tool to process 498 shape files (they are located on a hard drive). Using arcpy script it takes 6 minutes, but when ...
1
vote
1answer
56 views

how to create a multipoint geometry in arcgis using python and arcPy library

I have specific points and I need to create multipoint geometries, in a model-builder python script, following an equation that provides me the new (x,y) points around my initial point. Is there any ...
2
votes
1answer
129 views

Calculating geometry area in ArcGIS for Desktop using ArcPy?

I have a polygon shapefile and I want to write a Python script to add a field named "area" and calculate its geometry areas. The script is like this: ...
1
vote
1answer
56 views

Add annotation feature class to mxd with arcpy

From what I have researched, I'm pretty sure the answer is NO, but I want to make sure no one has found a work-around. Annotation feature classes in personal geodatabases need to be added to mxds. ...
1
vote
1answer
69 views

select random rows with python in arcgis

I am new to using Python in ArcGIS, and I wonder: how do I select random lines (or every two lines) of an attribute table? I must select these lines and calculate them, so they are different from ...
0
votes
1answer
68 views

Cause of ExecuteError: ERROR 000539: Invalid field County Insets.OBJECTID Failed to execute (CalculateField)?

The following script joins two layers on a common id and attempts to use the OBJECTID in the joined table to update records for a field in the input table. In running it in "current" mode, it moves ...
2
votes
1answer
80 views

arcpy with multiprocessing throws “UnpickleableError: Cannot pickle <type 'geoprocessing Layer object'> objects”

I'm attempting to speed up a process which is currently running synchronously, by using the python multiprocessing module. I'm having trouble sending a feature layer to a function which is called by ...
0
votes
1answer
82 views

arcpy SearchCursor return a OBJECTID value not as an integer

I use summary statistics GP tool to extract the max OBJECTID from a feature layer. After that I use arcpy SerachCursor to get the OBJECTID value from the statistics, but the result returned is not an ...
1
vote
1answer
42 views

Maintaining reference to feature layer (rather than its name string) throughout Python script? [duplicate]

When creating a Layer in arcpy, the syntax uses a string to denote the layer name, as shown in the Make Feature Layer sample script: import arcpy arcpy.env.workspace = "C:\Program Files ...
1
vote
1answer
96 views

Why does arcpy.TableToDomain_management require exclusive schema lock?

I'm talking about arcpy.TableToDomain_management, ArcGIS Server 10.2 It seems that this function requires exclusive SDE database schema lock. Something that we can't accept. We have ESRI domains but ...
7
votes
1answer
441 views

Meaning of exclamation mark in Python parser of ArcGIS Field Calculator?

In the following line, I don't understand what those exclamation marks mean? And why put everything in quotation? I don't understand the purpose of the variable expression, please explain to me as I'm ...
1
vote
1answer
57 views

Populating Access (*.mdb) table with text from Text Elements to inventory MXDs using ArcPy/Python?

I am trying to write a piece of code to populate an Access mdb table with information from text elements in an mxd (text elements all have "names"). The purpose of this is to create a catalog of my ...
1
vote
1answer
53 views

ArcPy Label Class object returning unexpected value for expression property?

import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") for lyr in arcpy.mapping.ListLayers(mxd, "TestFile_LineToPoints13_Prod"): if lyr.supports("LABELCLASSES"): for lblclass in ...
1
vote
2answers
250 views

Split a string column into 2 columns in python [closed]

I have a csv file and this is the structure of that file. It has only one column with number of strings. I want to split this one column into 2 columns at the character \. Can anyone please tell me ...
1
vote
1answer
111 views

Conditional drop-down menu list in a python script tool

I have created a script tool from some python code, and in a previous question, I learned how to enable a drop-down list in this tool by changing the Validation code - see link and image below: ...
2
votes
2answers
122 views

List all Feature datasets & feature classes from a single geodatabase into CSV

I have prepared a python code and I got the following errors: "Parsing error IndentationError: expected an indented block (line 11)" and "Runtime error Traceback (most recent call last): ...
-1
votes
2answers
110 views

arcpy.Delete_management(“”) not working

I've written a script in a python toolbox. That script creates a folder in the user defined workspace for all the output files that are created during the script process. When the script is done, I ...
1
vote
2answers
54 views

Script fails when executed from toolbox but not in command window (MakeFeatureLayer)

I am able to run the below code in the Python command window in ArcMap 10.2.1 without issue. However, when I run this as a toolbox script, it fails at line 15: newLyr = ...
1
vote
0answers
97 views

Python coding problem - unicode string passed from dictionary to AddField

I tried all possible hints but I´m still stuck. I want to write a script that can be executed from a toolbox in ArcMap/ArcCatalog. It should rename fields (build lists with old fieldnames, new ...
1
vote
1answer
83 views

Export to SHP with ArcPy with query

I have a shapefile with table with area code (field areacode). How can I export with ArcPy each unique area code so I get a SHP file for each one? It takes too long to select the layer and query ...
0
votes
0answers
47 views

Arcpy Export To PDF exporting same PDF instead of changing

I have been trying to run a loop that would change a layer in an .mxd during each iteration and then export it to a PDF. When I run it, the exported PDFs are all exactly the same as the .mxd in the ...
5
votes
1answer
333 views

Setting up Drop-Down list in Parameters of Python script tool?

I am trying to create a tool from a python script I have written that will take a list I have created and use it as a drop-down menu in the finished tool as one of the inputs (see attached image for ...
4
votes
0answers
166 views

Concatenate features in one feature class by the unique ID

Is there a way to concatenate features in ArcGIS by using ArcPy, or field calculator, to produce the following output? I am aware of the concatenate tool that Esri created, however it doesn't keep ...
2
votes
2answers
46 views

Assigning a vector to a field in feature class (UpdateCursor)

I don't know if my mistake is of a general nature. I come from R where it is very easy to store a vector in a matrix column. So now I (new to coding with arcpy) am desperately trying to do the same ...
5
votes
1answer
127 views

Calculate the common area between polygons using python?

I am trying to calculate the common "empty" area between the neighbouring polygons in order to calculate the porosity volume (the red area in the image) My idea was, first to use Convert ...
1
vote
1answer
85 views

ArcPy FieldMappings syntax using Merge tool

I'm working on script that takes several table results from the Zonal Statistics As Table tool and merges them into a single table. When merging I encounter the issue that the exported .dbf files have ...
1
vote
1answer
77 views

Is the MakeFeatureLayer temporary location the same as “in_memory”? [duplicate]

From the ArcGIS Desktop Help: The layer that is created by the tool is temporary and will not persist after the session ends unless the layer is saved to disk or the map document is saved. ...
0
votes
0answers
40 views

ArcPy PointToRaster memory locking error solution?

RasterToPolygon ArcPy tool fails on generated raster (PointToRaster) with large(?) dataset. Not sure the size threshold, but fails on 78559 x 33544 raster, completes on smaller datasets so I know ...
1
vote
1answer
71 views

ArcPy script stops running randomly with no error returned

I am doing a batch watershed and analysis process on 135 points. This script worked great the first time I ran it. Ever since the first time, however, I have had the script stop at random moments. ...