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

learn more… | top users | synonyms (1)

1
vote
1answer
55 views

Graph/Network building and analysis of linked polygons in ArcGIS 10.2

This is more of a follow-up question to Divide polygons into *n* number of groups of equal counts with ArcGIS 10.2 and grouping village points based on distance and population size, particularly the ...
1
vote
1answer
38 views

How to select layer of .shp format by attribute using ArcPy?

I have to first load a vector layer (in .shp format) in arcmap and then it should select to specific attribute (the name of attribute is taken as input from user which i have done). and only selected ...
2
votes
1answer
28 views

Parameter to script tool gives Invalid expression ERROR 000358?

I have created python script tool in arcgis 10.1 as below. I am trying to take input parameter and passing to select statement. There is error when i execute this tool. import arcpy from arcpy ...
4
votes
1answer
129 views

Moving a Map Service Group Layer out of a Group Layer with ArcPy

I am struggling to move web services (tiled basemaps) out of group layers into the data frame. I've used arcpy.mapping.ListLayers to compose a list of layers, then I've ascertained what is a group ...
0
votes
1answer
35 views

find all the null records for all fields in a shape file

I figured out that I can use field calculator on a single column in arcgis 10.3 attribute window as follows: def RemoveNULL(x): if x is None: return '' elif x == '': return ...
2
votes
0answers
28 views

I have a large dataset of lakes, which I want to group into n clusters, based on a target total amount of perimeter they have. Suggestions?

There's a longer explanation of why I'm interested in this below, but in short, I'm wondering how to run something like a k nearest neighbors formula, with the number of groups determined by a maximum ...
2
votes
1answer
35 views

Automating update of network dataset in ArcGIS Server

I am trying to set up an automated process that does a nightly extract of the network dataset from SDE and publish to: ArcGIS Server 10.3 as a network service fGDB as network dataset It seems ...
2
votes
2answers
36 views

How to calculate field as a substring of another?

I have a text field, field1, that's populated with 14-digit identifiers, like "01234567890123". I create a new field, field2, that I want to show the first four digits of field1. I would like to do ...
2
votes
1answer
56 views

Looking to find (or build) a particular Python geoprocessing tool

So here is my situation: There is a large area (a wildlife refuge) of nearly 200,00 acres that we have loads of spatial data for, from habitat management projects from the past several years. My boss ...
0
votes
0answers
21 views

Using a Value Table to Calculate Multiple Fields

I'm looking to develop a tool (ideally through model builder as my python writing ability is not stellar) that creates a simple user interface that has dropdown menus for desired fields of a selected ...
0
votes
0answers
31 views

Common Tasks on ArcGIS Server REST service

I have a published REST service with line geometry. If I have the permissions to edit the service in ArcMap, shouldn't I be able to perform a arcpy.Dissolve_management on the lines (client side) to ...
1
vote
0answers
30 views

How do I data page with arcpy?

I have a enterprise SDE feature class and need to retrieve its data. Attempting to copy all the data at once appears to be problematic. How do I take a feature class and split up the data retrieval ...
5
votes
1answer
120 views

Cutting a circular buffer via Arcpy

I am currently working with compressor stations on centerline routes. These compressor stations have a 3 mile buffer surrounding them. I wish to cut a portion of the circular buffer off. These cut ...
2
votes
1answer
42 views

Alter Field character limit incorrect

I'm having trouble with the Alter Field Data Management tool -- it will not allow me to create a field name longer than 31 characters. The table I'm using is a File Geodatabase table, where the ...
1
vote
1answer
52 views

Directional Spatial Join with Python - Arcpy

Using Python, I want to join one point feature (centroid node) to the closest 4 links (polylines), but spreading the search in the 4 directions around my point, so that I have: 1 centroid-link ...
0
votes
0answers
55 views

MS SQL table with geometry field to feature class

I have a table in a native SQL database (no geodatabase, dc_geobank_public.sde in the code) with cca. 300 000 records and 18 fields. Two of the field contains projected X and Y coordinates, and one ...
0
votes
0answers
40 views

Adding Array of strings in File geodatabase feature-class' field

I need to include array type in file geodatabase/shapefile field's content so that when i expose it as a map service, i can get array instead of string or integer. e.g., i got fields: OBJECTID, ...
1
vote
1answer
20 views

Properly setting Extents in Arcpy Using path

I am trying to set the extents of my processing using Arcpy, but when my processing is completed, there has been no change to the extents (it results in an extent that did not go as large as I ...
2
votes
1answer
27 views

Redirect remote shell command output to ArcMap geoprocessing tool display?

I have a Python script that runs a shell command on a remote server (using the Fabric module). When I run the tool in the debugger, I see all the output scrolling, as the command can take hours to ...
1
vote
0answers
19 views

Extract multiple grids from HDF with subset tool using ArcPy

This should be fairly simple thing but bugging me at the moment. I have ~5k HDF files in a folder with names: MOD11A1.A2001001.h24v05.005.2006343042921 and so on..... I have following which loop ...
1
vote
1answer
39 views

How to troubleshoot a hard crash on CopyFeatures_management()

I have a script that uses arcpy.CopyFeatures_management(FEATURE_CLASS_SDE, FEATURE_CLASS_LOCAL) to copy a feature class from our enterprise SDE to a local file geodatabase. For the most part, it works ...
4
votes
1answer
75 views

Automatically create new layers from a single dataset using definiton query for unique values in a field

I would like to automatically display a featureclass as different layers based on a specific field. I've seen a few tools online and on XToolsPro under the category of Split by Attributes, but they ...
3
votes
1answer
129 views

How to iterate through all geometries using a search cursor?

I would like to use a python add-in which uses a button click to iterate through each selected polygon one by one. The following code manages to zoom only to the first polygon. How can I adapt it to ...
1
vote
1answer
31 views

Python: how to set a different output folder

I want to transform some vectors to rasters in my folder but I have difficulties setting the output folder. The following code only allows me to output to the original database. I hope to output all ...
0
votes
0answers
43 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") for lyr ...
1
vote
0answers
52 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
19 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
20 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
49 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
25 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
38 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
42 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
36 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
26 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
56 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
39 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
37 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
39 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
22 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
70 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
32 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
48 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
63 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
34 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
35 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
63 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
37 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
31 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
42 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 ...
1
vote
1answer
33 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 ...