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

learn more… | top users | synonyms (1)

1
vote
1answer
59 views

Python code that uses arcpy.describe skips if statement?

I have multiple shapefiles in a folder which I am trying to compare with same named features in geodatabase. I want to first clip them within a polygon and then copy and overwrite the features in ...
2
votes
1answer
29 views

Apply Symbology from a Layer

I am trying to update the symbology of a layer with another layer with a python script. I have written a code for this. But I am getting the following error message : ERROR 000732: Input Layer: ...
0
votes
1answer
28 views

arc.describe file name not working

I have multiple shapefiles in a folder which I am trying to compare with same named features in geodatabase. I want to first clip within an area polygon and then copy and overwrite the features in the ...
1
vote
1answer
33 views

Why does arcpy's Alter Field return “The tool is not licensed”?

According to the help file, the ALTER FIELD command is available at any license level. ArcGIS for Desktop Basic: Yes Why am I getting a license error when trying to rename a field alias on a ...
-2
votes
0answers
24 views

NumPy Array to Feature: Expected a readable buffer object [closed]

I am consuming data from a json web service with NumPy array to feature class an am receiving a TypeError: expected a readable buffer object. What is the cause of this? containerItems = [] ...
1
vote
1answer
32 views

What tool would be best for getting the max value out of Identical ID rows?

As the title may imply I want to keep the maximum value in field2 for several identical IDs in field1, the others are deleted for example this table: Field1 Field2 14772 1 14772 4 14766 3 ...
0
votes
1answer
12 views

Partial Text String replace for Standard Annotation Feature Class Inconsistent

We have several hundred mxd maps that contain standard annotation feature classes. Each map is of different municipalities and each annotation file includes municipal boundary labels. Depending on the ...
6
votes
0answers
183 views

Python toolbox works in ArcToolbox and in Python console, but not in ArcCatalog

I have a set of Python tools in a Python toolbox (.pyt). They are broken into multiple files and modules and have been functioning correctly, but now I'm seeing inconsistent behavior on multiple ...
1
vote
0answers
47 views

ArcPy reading a raster in a moving window?

I typically read large raster data using gdal and setting up a moving window of 256*256 pixels (for example). I recently had to do some processing using arcpy, so I did the same thing, using ...
0
votes
1answer
35 views

Change color of feature (active cursor row) with ArcPy

I have a selection of polygon feature and with a cursor loop I walk through them. I determine the extent of eachfeature and arcmap will zoom to the feature. My default selection color in ArcMap is ...
0
votes
0answers
20 views

How to `Enable SQL Access` through ArcPy 10.2

I have a multiversion view for a feature class. When I add any field in feature class, it does not reflect on its multiversion view. I have to manually right click on feature class -> Manage ...
0
votes
0answers
40 views

Calculating Closest Distance from one polygon to another [on hold]

I am trying to calculate the shortest distance from my polygon centroid to another polygon. I would later use this measurement in another piece of code I have written. Keep in mind, I have limited ...
1
vote
0answers
8 views

Quickest way to Read 3D Area from arcpy.SurfaceVolume_3d?

What is the most efficient way to access just the 3D Area result from an arcpy.SurfaceVolume_3d calculation? I have the tool running as described ...
0
votes
2answers
43 views

Applying symbology to a layer with python, How to only have symbology in TOC that the sub layer has

i am trying to apply a symbology to multiply layers that i have created from one feature class. The original feature class is used to create several sub layers see layer loop this involves using ...
1
vote
0answers
21 views

ReconcileVersions tool yields ERROR 000301

I am wanting to create a version, step into the version, make edits, and then post and reconcile that version. When I get to the ReconcileVersions_management tool, it is giving me ERROR 000301: The ...
1
vote
2answers
48 views

ignore Null Values when iterating through fields with python

So far I have a code which iterates through Fefature Classes and ignores all fields of type String, Geometry and OID. I now try to add some lines which tell python to ignore all NULL values when ...
0
votes
0answers
42 views

Error in importing arcpy in arcgis python console

I have been coding in eclipse using arcpy 64 bit. the pythonpath in eclipse is set to the 64 bit, the pythonpath in environment variables is also set to the same address. but when I want to improt ...
1
vote
1answer
62 views

Compute annual mean of overlapping cells using daily rasters

I am stuck at somewhat simple looking calculation. I have daily temperature rasters from 2001 to 2014 with following name format: `2001001` `2001002` | | `2014365` I want to compute annual mean ...
0
votes
0answers
49 views

Using custom shape files as buffers in ArcGIS [closed]

I would like to use a custom shapefile as the buffer shape for a project that I am working on. I have created a buffer around a compressor station of 3 miles and am planning to clip the lines that ...
0
votes
0answers
40 views

After execute arcgis script, what happen with the variables?

After the execution of a Arcgis script (I wrote the script in python language) on a Arcmap session. What happen with the variables that I used in the script? They remain stored somewhere in ArcMap (So ...
3
votes
2answers
82 views

Displaying estimated computational time when running tools in ArcGIS for Desktop?

I'm almost positive I have set up models to display the estimated runtime/computational time for the models/tools in the past, but I can't seem remember how to turn on this option. I've looked around ...
2
votes
1answer
30 views

How to set empty date field with arcpy.CalculateField_Management?

I want to simply set my date field to empty i.e "". No problem directly in ArcGIS , but with arcpy I can´t seem to get the syntax right. When I try with a date this is no problem e.g '22.06.2015' But ...
1
vote
0answers
45 views

How to automatically generate pour points along stream network?

The following screenshot shows the results of a water flow analysis where I identified stream order via the Strahler method in ArcGIS. Now I need to generate watersheds for 2nd order streams and ...
0
votes
1answer
59 views

arcpy.da UpdateCursor where_clause

I am trying to get a where_clause working on a UpdateCursor (arcpy.da). I can get it to work fine with a SearchCursor, but for some reason the same clause throws a RuntimeError: General function ...
2
votes
0answers
44 views

Using Python to iterate through directory to create event layer and perform kernel Density for each file?

I am new to Python for ArcGIS, but have been using ArcGIS a while. I have a large directory of tables with point data. For each file of each folder I want to create a kernel density layer. I have ...
0
votes
1answer
30 views

Using Python to Union two polygons from separate gdb? [closed]

I'm in the processes of learning python and am stuck on an exercise. One part of the exercise requires me to union a polygon from one gdb with a polygon in another gdb. Here is what I have, which ...
2
votes
2answers
64 views

definition query with 3 plus variables to loop with python and save layer files

I have a script that takes an input feature class and uses a field within this class to create a definition query for each unique field. A question on how to do this is listed below saving layers for ...
0
votes
1answer
16 views

arcpy CSV file to raster attribute table?

Using TableToTable_conversion I can convert a CSV file to a table in a geodatabase, but how can make this table be the default attribute table for a raster in the geodatabase? I can't seem to find ...
0
votes
0answers
50 views

Configuring Python to avoid conflict with ArcGIS for Desktop (ArcPy)?

I am trying to find the best way to configure a new version of python in my computer (windows) so that I do not have any problem with the python version that I have with ArcGIS. Is there anyway to ...
1
vote
1answer
20 views

Why is there a lock when using arcpy.DeleteField_management in arcgis 10.0?

This code only works when ArcCatalog is closed or the featureclass has never been opened by ArcCatalog. For other arcpy management functions this is not the case, but when ArcCatalog is open, I get ...
1
vote
1answer
43 views

How can I programatically set the “Description” for a ArcPy Geoprocessing Service?

When I create a Python Toolbox (pyt), I set the name and description of the toolbox. When I create the parameters, I can set their name, type, default value, in/out, etc. Basically, everything that ...
0
votes
1answer
51 views

ArcGIS 10.0 Python script not working with ArcGIS 10.2.1. Looping through SelectLayerByLocations

Last year I got assistance from StackExchange to write a Python script for ArcGIS 10.0 which loops through SelectLayerByLocation with buffer until it returns no new rows. Then it uses the selection ...
1
vote
1answer
14 views

Calling a variable in SelectLayerByAttribute

I am trying to code a Python add in for ArcGIS 10.2. I have a shape called FACILITIES which contains facilities, a field CATEGORY and I wish to select all the entities that are categorized as "school" ...
2
votes
2answers
75 views

Ignoring field types in Python list returned by arcpy.ListFields()?

I am generally just wondering if there is a nice and easy way in python to ignore all fields of a specifiy type (eg string) in a feature class. At the moment I am doing it with field_names = ...
1
vote
1answer
22 views

Field mappings object not functioning with Merge_management

I'm trying to limit the number of fields when I perform a merge to two. Below is the script I have created to do so. However, the merged feature class carries over all fields, despite my use of a ...
0
votes
0answers
25 views

SQL fails in python. In ArcMap error FDO error: -2147024871 returned

I'm having issues with an SQL expression for a feature class in a file geodatabase. When working in ArcMap, the SQL will fail on its first attempt, and produce the following error: However, when I ...
1
vote
0answers
20 views

Why is arcpy ChangePrivileges_management adding a second feature class to map?

I am new to GIS and pretty new to python, so sorry if this is ugly code. I am creating a feature class in a postgres database if it does not already exist and the user wants it created. That works ...
0
votes
1answer
52 views

cannot concatenate str and list objects

I'm trying to rename a group of rasters to "I1986_" + [The 1st 3 letters of the raster]. For example, if a raster is named "Raster1", the output would be "I1986_Ras". I've tried including str() ...
1
vote
1answer
38 views

How to replace field name with a variable in exported whereclause?

In the select by attribute how do I replace "AADT", with a predefined string variable? I don't understand the pattern in "\"AADT\">=" , can you please explain why is it that way when exported from ...
0
votes
1answer
51 views

Python Script to Select records based on user input

I am running Arc 10.3 in a versioned environment. I am attempting to write a simple code that will select service records coming from Oracle CRM to a separate feature class containing only records ...
1
vote
1answer
31 views

How to search for fields in a GDB and add them if they don´t exist with arcpy?

I have a list of files that need to be present in my featureclasses - myFields[]. I need to add these fields if they are not present in my FeatureClasses. import arcpy myField="Field01" myFields = ...
0
votes
0answers
21 views

Assign a dummy value for removed features in a Polygon-Grid

I want to calculate the entropy index for landuses classes for an area based on a 100m Polygon Grid. I did find an existing toolbox that does all the required calculation. Input features are the 100m ...
4
votes
2answers
150 views

Fastest way to numerate intersecting polygons in ArcGIS

I need to numerate a thousands of polygons in groups, so each group will get unique number. Every intersecting polygons is unique group (see picture). So polygons have field "groups" with values: ...
0
votes
1answer
47 views

TypeError: value #0 - unsupported type: datetime.timedelta

The following code runs fine minus receiving the error below, which doesn't make any sense (to me) as I have other UpdateCursors and perform UpdateRow(row) with other date values. As can be seen ...
1
vote
2answers
56 views

Export feature classes in geodatabase to CSVs

I am trying to export feature classes within a geodatabase to CSV format using "Export Feature Attribute to ASCII" in ArCGIS. I am getting the following error Traceback (most recent call last): ...
2
votes
2answers
55 views

How to access Spatial Analyst extension from stand alone script?

If I run this script: import arcpy arcpy.AddMessage(arcpy.CheckExtension("Spatial")) from arcpy.sa import Con from arcpy import env fDir=r'd:\scratch\fdir' outFolder=r'd:\aerials\images' ...
2
votes
1answer
76 views

How to use %i%“.csv” in arcpy to name an output csv file?

I am using arcpy to describe datasets and output the results into a csv file. I am doing this via a script in arctoolbox and would like to save the file in the same folder as the file being analysed. ...
0
votes
2answers
64 views

How to enter date with arcpy.GetParameterAsText with arcpy?

I want to allow users to enter a date as a parameter through a dialog window in a toolbox script. I have obviously defined the field with a "Date" data type but something is wrong with the ...
2
votes
1answer
62 views

Polygon found with search cursor, but not update cursor

Here's my issue. I am doing two things with arcpy: 1) I search a feature class using arcpy.da.SearchCursor() and pull out a UID field and the geometry in WKB format for all polygons in the file, ...
0
votes
4answers
162 views

Is there a site with templates for Arcpy where I can just fill in the blanks?

I have a Shapefile containing near 7000 pour points across the globe (GCS, WGS84). I'm using the following model to select the first feature point of the Shapefile, copy the selected feature in a new ...