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

learn more… | top users | synonyms (1)

1
vote
1answer
596 views

Creating bulk field aliases for several layers within same ArcSDE feature class using ArcPy? [duplicate]

I have an ArcMap with ~200 layers from the same sde feature class. After I finished adding all the layers it was brought to my attention that we need to add field alaises for the attribute table. ...
1
vote
1answer
149 views

How to select and update from multiple tables?

I have two feature classes which have common Valve ID #s. One table has multiple service connections with a unique number. I need to select all services linked to each valve and collect the ...
1
vote
1answer
2k views

Automate converting labels to annotation in ArcMap at multiple scales?

I need to be able to convert labels to Annotation feature classes at multiple scale levels for both address and street data. Similar in concept to generating tiled layers for a web service, I have 5 ...
1
vote
1answer
214 views

Odd behavior with arcpy.mapping.PublishMSDToServer

When I publish an MSD to ArcGIS Server 10.0 manually in ArcCatalog (through right-click context menu) or through the web interface, the service is created properly. When I use ...
1
vote
1answer
766 views

Hotlink vector/raster files to open in current workspace in ArcGIS 10 similar to Mapinfo

I want to add datasets to ArcMap and place them in a particular group layer by simply clicking on hotlinked polygons in a shape file. The same process is easy in MapInfo and I want to implement the ...
1
vote
1answer
350 views

Opening ArcCatalog to FGDB causes application to fall over

I have some python scripts I have written to create a lot of objects. I write these, in code, to a couple of FGDB's. If I happen to open ArcCatalog in one of these FGDB's, the application falls ...
1
vote
1answer
660 views

user select fields to be deleted in a feature class

How do I make the script below accept parameter arguments correctly in ArcGIS 10? I added it to a toolbox as a script, created parameter called Fields to be Deleted: and type as Field, but when I ...
1
vote
0answers
18 views

How to correctly input complex multiband functions in Raster Calculator?

I'm trying to compute a MTVI2 (Modified Triangular Vegetation Index - Improved) and EVI (Enhanced Vegetation Index) from Landsat 8 imagery. My formulas are as follow (I'm using ModelBuilder): MTVI2= ...
1
vote
0answers
21 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 ...
1
vote
0answers
39 views

Python script changing ArcSDE data source not updating all MXDs?

We recently made significant changes to our ArcSDE database setup by splitting our original database into five databases and renaming most of the feature sets. Right now I have a script that opens all ...
1
vote
0answers
29 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 ...
1
vote
1answer
32 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 ...
1
vote
1answer
17 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 ...
1
vote
0answers
17 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
26 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 ...
1
vote
0answers
36 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 ...
1
vote
0answers
24 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 = ...
1
vote
2answers
30 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: ...
1
vote
1answer
39 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
0answers
48 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 ...
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 ...
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
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 ...
1
vote
1answer
23 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 ...
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 ...
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 = ...
1
vote
1answer
43 views

How can I dissolve adjacent polygons based on minimum attribute value? [duplicate]

I'm trying to merge the polygons (administrative boundaries) in a dataset untill they reach a minimum value. Lets say that the polygon dataset consists of the number of people per polygon and I need ...
1
vote
1answer
51 views

Scripting spatial join in arcpy - how to set field attribute in field mapping object?

I'm scripting a spatial join in ArcGIS with Python. I only want the resultant feature class to have a single field containing one attribute from the join features. In general, many join features ...
1
vote
0answers
27 views

Portal for ArcGIS WMTS layers are optimised & un-cacheable

When a WMTS in Portal for ArcGIS 10.3.1 is opened (via Portal) in an mxd, the WMTS layer properties are not standard. The; Source, Layers, and Advanced tabs are missing. When the portal WMTS layer ...
1
vote
0answers
46 views

Extracting color values from layer to build index using ArcPy/ArcMap?

My university wants the maps we create to become more standardized and so we're changing all the colors on our base vector map. The new standard needs to be indexed and I have the task of creating ...
1
vote
0answers
65 views

Are there any Python scripts available for Hydrology to compute watershed Basin from csv file?

Let's say I have surface data available in CSV format (x,y,z). In order to create a watershed basin from surface data, there are some intermediate steps we need to follow. ASCII to surface raster ...
1
vote
0answers
33 views

Clipping Feature Classes by Data View Extents with ArcPy?

Have a fully functional script about 90% of the time. It is that 10% that is really bothering me and I cannot seem to deduce a solution. Script will take the user defined dataframe view extents and ...
1
vote
0answers
70 views

Update Data Driven Pages Index layer via Python

I am trying to find a way to update the index layer for data driven pages through arcpy. I understand that to access DDP from arcpy.mapping you need to be referencing a MXD that has DDP enabled. My ...
1
vote
1answer
49 views

Accessing bands in .pix (PCIDSK) file in python/arcpy

I am trying to perform zonal statistics on a single band from a multi-band raster in .pix format. I have things working great with a tiff file. I am able to access the bands using this code: desc = ...
1
vote
1answer
38 views

Intermittent exceptions in CopyRows_management

Occasionally, but frequently enough to be a pain, my script throws an error. The script runs fine most of the time but when it fails, I get this: Traceback (most recent call last): File "XXX.py", ...
1
vote
1answer
29 views

Changing Mosaic Dataset Properties in Map Document using ArcPy?

Does anyone know if it is possible in ArcGIS 10.3 for Desktop to access and change mosaic dataset properties within a map document using ArcPy? I am trying to write text into the symbology ...
1
vote
0answers
53 views

Automating creation of ServiceDefinition from Python toolbox of ArcPy without broken project data source?

Summary: I can create a ServiceDefinition through ArcCatalog or ArcMap, but when I try to generate the ServiceDefinition through python, it does not copy the /data folder with it, thus the script ...
1
vote
1answer
23 views

Multiply two lists of raster from two subfolder

I have two subfolders, which contains rasters for each country but which express different variables. I am trying to figure out a way to Loop a multiplication of each raster into a folder with its ...
1
vote
0answers
21 views

ArcPy arcpy.gp.ExportMapServerCache invokes error: A secure connection with this site cannot be verified

What worked last week on many computers no longer works this week. My great ArcPy script gets a users current display extent and invokes gp.ExportMapServerCache to copy a web cache locally. It was ...
1
vote
0answers
33 views

Dynamic segmentation with respect to a control factor

Is there a way either with python scripts or other solution to dynamically segment a table with linear measures (from-to fields) Each segmented section (from-to) should have all the item numbers ...
1
vote
0answers
69 views

Compression Algorithms output files larger than the originals. Why?

I'm currently attempting to write a script that will compress a few hundred .tif files. I've tried two approaches, first I wrote a script in Python using CopyRaster_management() function and the ...
1
vote
1answer
66 views

Using Spatial Join to copy a single attribute

I am attempting to use Spatial Join to combine tax parcels and zoning information, such that the parcels contain the designation of the underlying zone. However, I only want to take the "esmZONE" ...
1
vote
1answer
32 views

ArcCatalog and python crash when running ConvertTimeField_management

I have a script which reclassifies a tif file, adds a new field to the tiff, and is supposed to parse the date from the filename and add it to the new date field. Everything works as it should, ...
1
vote
0answers
91 views

Import shapefiles into PostGIS using Python with psycopg2

I want to import shapefiles to PostGIS using Python with arcpy & psycopg2 to connect to PostGIS. I don't want to use the existing shapefile loader nor ogr, just write my own import tool. My steps ...
1
vote
0answers
40 views

Are there any conditions that could break the creation of an arcpy.Polygon object?

I have a script that generates a mesh network from vertex and centroid inputs, and it works for almost all my points. But for some records that get created in the feature class via the script, their ...
1
vote
1answer
27 views

Most efficient way to retrieve pixel distributions inside many polygones (custom zonal stats)

I want to get the distribution of pixels from a 1 band raster that fall in each polygon of a shapefile to proceed to some statistics. I guess a zonal statistics does it in some kind of way but I need ...
1
vote
1answer
52 views

What defines where the files will be saved?

Hi I have a script I am using to save out layers automatically I have posted another question here ArcGIS creating individual layers for unique attribute in a given feild. Limitations of Where ...
1
vote
1answer
46 views

Exporting shapefile to csv with cursor

I'm trying to export a shapefile to a csv file using a cursor. I found this quesion asked and answered here: Exporting table to XYZ ASCII file via ArcPy? However I only want to export several ...
1
vote
1answer
53 views

Python error in Con function

I am trying to add two different rasters using the Con function. I am iterating the raster layer using the for loop to obtain two rasters belonging to the same species and their formats are in grid ...
1
vote
1answer
63 views

Script to Mark UTM Coordinate

I am currently working with ArcGIS 10.2.2 and need a script to create a tool (if possible). I have USGS 7.5'Quad Maps as my base and a series of UTM coordinates representing sites. I would like the ...