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

learn more… | top users | synonyms (1)

1
vote
0answers
18 views

Using Arcpy to Update Data Source Does Not Update Related Tables

I have a python script that updates the data source of mxd's from staging to production. Here is an example of the code: import arcpy mxd = arcpy.mapping.MapDocument(r"C:\Project\MyMap.mxd") ...
1
vote
0answers
21 views

Updating Field Mappings Parameter on table selection in Python Toolbox?

I am building a python toolbox with ArcPy and would like to associate an input feature class parameter with a field mapping, so that once user selects the input feature class the field map populates ...
0
votes
0answers
11 views

Pythonw has stopped working when running arcpy.SubsetFeatures_ga

I'm currently trying to subset a shapefile into training and validation files. When I run the following line of code, python crashes. I'm using ArcGIS 10.1. arcpy.SubsetFeatures_ga(current_shapefile, ...
2
votes
1answer
19 views

problem deleting shapefiles because still in use by arcpy cursor [duplicate]

I have a function outputTblContents which contains def outputTblContents ( path ): rows = arcpy.SearchCursor(path, fields="alpha; beta") for row in rows: print("{0} => ...
1
vote
1answer
34 views

Export data with data frame coordinate system using ArcPy

I want to export data in current data frame and use the same coordiante system as data frame using ArcPy as I have multiple files. Any suggestion on how to "Export with data frame's coordinate ...
1
vote
0answers
16 views

Sorting cursor made of Network Analyst outputs?

I have solved OD Cost Matrix analysis and I'm trying to access the results using da.SearchCursor with SQL sorting. The problem is that the result is not sorted at all. lines = ...
2
votes
2answers
27 views

ArcGIS zoom to next selected feature

How could I adapt the following code to enable me to zoom to each individual selected Geometry one after the other? import arcpy mxd = arcpy.mapping.MapDocument('CURRENT') df = ...
0
votes
1answer
36 views

Confusing results from script that uses arcpy.clip analysis?

Following on from previous question Python code that uses arcpy.describe skips if statement?, I have now attempted to include clip analysis and this is my result; I am confused as to what is ...
1
vote
2answers
26 views

add multiple rasters, each located a branch too deep in separate folders - ArcGIS

I have a year of daily raster datasets (365) that I would like to use the Cell Statistics tool on; however, each raster is located in a separate folder so I cannot add all of them at once. ie: ...
0
votes
2answers
23 views

Selecting features in feature class and updating feature class fields based on Spatial Selection?

Using arcpy, is there any way to update the selected records of a feature class' field based on a Selection by Location of another shape file? In other words, update a field in a feature class' point ...
2
votes
1answer
45 views

How to delete selected rows using ArcPy?

I want to delete all rows in a feature class but remain rows 1 to 5. In other hand I want to remain first five rows and delete others. I know that I have to use search cursor and update cursor but I ...
1
vote
1answer
30 views

Adding Vertical Reference in Python to ArcGIS feature dataset

I am creating a python script to generate a terrain. In the process I am creating two feature datasets. However, in order to successfully create this FD, i need both horizontal and vertical datums. I ...
0
votes
1answer
32 views

How to use list broken Data sources for layers saved in Windows not within an MXD

I have seen a few question related to listing broken data sources of layers within an MXD MXD list broken links See Link . I am interested in layers that are not within an MXD. That are sitting ...
0
votes
1answer
34 views

Can't get the where clause in Select layer by attribute working!

I am trying to develop a script that searches for a particular ID in a user selected field. To this end I have used the select layer by attributes tool to search for a derived number in a field ...
0
votes
0answers
21 views

Is it possible to save a dxf in memory

Following on from my question here, when I run the ExportToCAD tool arcpy.ExportCAD_conversion(listOfLayers, formatRelease, location + fileFormat, "Ignore_Filenames_in_Tables", ...
3
votes
3answers
58 views

How do I compare two features to test if they are identical?

What is the most efficient method for determining if two features (points, lines, or polygons) are geometrically identical? I'm not concerned about a square figure that contains eight vertices (four ...
0
votes
0answers
30 views

Consolidating spatial data for nearly 200,000 acre area

more of a broad question here: I'm trying to take a huge amount of spatial data for a specific 200,000 acre area, collected over 15 years dating back to 2000, and organize it. The data layers relate ...
1
vote
1answer
32 views

Getting aspect and reclassifying raster files using Python in a loop

By using Python in PythonWin 2.7.3, I tried to obtain aspect files of a list of raster files in a folder(called database_Dem20) and save it to another folder, database_Dem20/testOutput. In the same ...
1
vote
1answer
53 views

Creating polygon geometry using points array

I am parsing an Openstreetmap gpx file which I exported from here. I'm trying to put the data into arcgis geodatabase feature classes. Some of the features in the gpx are points (saved as wpt), while ...
1
vote
2answers
32 views

Adding new field and populating with shapefile name

I have a set of shapefiles that need a new field adding to them called "Policy_Ref". I then need to update this field with the shapefile name. However when I do, it uses the full title, including the ...
0
votes
0answers
31 views

Summarize an attribute table using python

I am a trying to summarize an attribute table for a dataset that I have. The problem is similar to the one discussed in this question here: ...
1
vote
1answer
55 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
28 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
23 views

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

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
31 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
11 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
120 views
+50

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
46 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
33 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
19 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
37 views

Calculating Closest Distance from one polygon to another

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
42 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
19 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
47 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
37 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
37 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
80 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
28 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
44 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
56 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
43 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
29 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
61 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
48 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 ...