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

learn more… | top users | synonyms (1)

3
votes
1answer
37 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
55 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
43 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
77 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
55 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
37 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
70 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
65 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
36 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
32 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
46 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
78 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
37 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
82 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
47 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
84 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
51 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
61 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
57 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
69 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
64 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
39 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
82 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
305 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
51 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
39 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
194 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
85 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: ...
1
vote
1answer
98 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
94 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
44 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
75 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
82 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
45 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 ...
4
votes
1answer
211 views

Setting up a Drop-Down list in the Parameters of a python script tool from a large list

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
157 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
39 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
117 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
74 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
73 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
38 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
57 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. ...
0
votes
1answer
52 views

Can FieldMappings be used to drop all attributes?

We have a script that regularly copies a bunch of feature classes out to shapefiles, keeping only the most important attributes (e.g. customer category) and dropping useless/private information (e.g. ...
1
vote
1answer
74 views

How to print log from FME when run from python script?

I created a Spatial ETL ToolBox in ArcCatalog. When I run the tool from ArcCatalog I see log massages. But when I run this tool from a python script, the logs do not print to the python console. ...
1
vote
1answer
46 views

Programmatically access HTML Popup in Layer Properties ArcGIS 10.2

Is it possible to access HTML Popups (found in layer properties) programmatically in ArcGIS 10.2? I can't find any reference but thought I'd ask to double check.
0
votes
0answers
35 views

What is the most efficient method for deleting row/features from a versioned FC in python?

I'm trying to delete all records from a feature class in SDE and then append new data using python. My dataset is versioned in SDE. I've tried Truncate Table (doesn't work with versioned tables), ...
1
vote
1answer
50 views

Creating fishnet from template feature class using ArcPy?

I can’t use the tool arcpy.CreateFishnet_management because define the parameter “templateExtent” with a shapefile it is not filling automatically the parameters “originCoordinate” and ...
2
votes
3answers
184 views

How to use ArcPy to Check if Search Cursor Returns Anything

How can I use arcpy to check if a search cursor returns anything and then do something based on the answer. So far I have this and it recognizes the positive - i.e. when i pass the query for 001 it ...
0
votes
1answer
292 views

'List indices must be integers not tuple' Error

I'm using an insert cursor to write rows to a destination feature class where the input Shapefile field names do not match the destination FC names. To accomplish this, I'm trying to use the indices ...
0
votes
1answer
9 views

How do I not specify a CustomerWeightField when scripting CustomerDerivedTA_ba?

When you run the Business Analysis toolbox wizard for creating a Customer Derived Trade area, you have the option of weighting each customer by count or for specifying a field (such as sales or number ...