A site-package created by Esri to expose GeoProcessing from ArcGIS to Python.

learn more… | top users | synonyms (7)

0
votes
0answers
58 views

Rebuild multiple Address Locators using arcpy run into issues

I have multiple address locators (including a composite locator) stored in a folder which I am trying to rebuild using arcpy 10.1 (ArcGIS 10.1). When I try to rebuild locators looping in an array ...
0
votes
0answers
44 views

How can I “filter” annotations when another layer has a definition query applied?

I have an ArcPy script that runs on a map, looping through a list of asset IDs, to create a definition query for layers and outputting a PDF map for each ID. Thus, each PDF shows only the assets ...
1
vote
1answer
50 views

Finding Point Counts in Multiple Ring Buffers for Multiple Point IDs Using Python

I have a shapefileA that has 13 points. Each of these points is coded with a unique ID from A to M. I created 10 different buffers (representing different distances) around each point via the ...
2
votes
2answers
66 views

ArcGIS temporal relationship between two feature layers

how can I built a temporal relation between two feature layers. My first layer has a observation time period and my second feature has the actual observation. I would like to build the relation ...
4
votes
2answers
186 views

Script (ArcPy) vs field calculator (Python Parser) behaviour of getPart in ArcGIS for Desktop?

From time to time I have to access geometry field and shuffle through points in it. Process is simple: Get shape Get it's part Iterate through part's points This is how it looks like in a script ...
2
votes
1answer
130 views

What is the purpose of arcpy.Array()?

I am wondering what the purpose of arcpy.Array() is. It seems an intermediate step between creating a list of objects and performing some sort of conversion, for example, such as in the sample code ...
4
votes
1answer
199 views

Managing environment variables in arcpy?

The Arcpy documentation seems to suggest that when writing python scripts that utilize/modify variables in arcpy.env, you should wrap everything in a bunch of try/except/(finally) loops with custom ...
1
vote
2answers
209 views

Creating tool in Python toolbox to export field list to Excel?

I am creating my first tool in a Python Toolbox (*.pyt) to export a list of fieldnames to Excel. I have the following bits of code: import arcpy class Toolbox(object): def __init__(self): ...
0
votes
2answers
71 views

How to Dissolve Polygons Inside a Feature Class Based on Attribute Conditions

I have a large shapefile (saleArea.shp) which includes hundreds of small adjacent polygons. I would like to dissolve the polygons based on some conditions from tValues field into 5 bigger groups like ...
0
votes
2answers
133 views

Calculate and Restart Sequential ID for Unique Values in a Field

I need to calculate a sequential ID for unique values in a field. So, for the values in Field1, the sequential ID count should count all occurrences of that value, then restart the count for the next ...
2
votes
2answers
957 views

How to correctly use arcpy.da.Editor

I am attempting to remove duplicates in a feature class that are generated by a Python script. At the end of my script I have the code block below; I haven't implemented it yet, but would like to see ...
1
vote
1answer
158 views

How do I compact a file geodatabase with ArcPy? [duplicate]

I am preparing some data using FME, which I end up writing to an Esri file geodatabase. Unfortunately, FME doesn't appear to update the written feature classes' spatial indices. This results in ...
0
votes
0answers
49 views

Error CreateConstantRaster on ArcGIS Server

I am writing a geoprocessing service with a function to create constant rasters. Currently the process runs fine locally but outputs an error when run on the gp service. The python traceback shows ...
1
vote
1answer
72 views

How to create MXD in folders programmatically,

I have an MXD as a template and about 650 folders. Each folder corresponds to a species. What I want to do is to make an MXD (same as the template) in every folder of each species. How to do ...
0
votes
1answer
49 views

CalculateField_management: Different results than in the field calculator

I`m using ArcMap 10.2.2 and Python 2.7.5 I´m tryig to calculate values with the CalculateField_management tool. my script: def mthree(mthre, mtwo): if mthre >= 1: return -3 if ...
1
vote
1answer
41 views

Automatically create a polygon around other polygons depending on attributes

I have 1000+ polygons, each has an attribute "Project_Area". There are maybe 8 different project areas. Is it possible using built-in Tools or Python to create a new shapefile that encompasses each ...
0
votes
0answers
32 views

Bing Authorization pop up still appears after using script to remove Microsoft Virtual Earth layers [duplicate]

My organisation does not have a Bing key, so Bing and Microsoft Virtual Earth layers don't work and a Bing authorization pop up happens whenever I open a MXD containing them. This pop up interrupts ...
1
vote
3answers
328 views

How to copy entire fields into a python list

I'am trying to find a way to copy entire fields(columns) in a feature class attribute table as lists inside a master list (python). To illustrate it, consider the table below: So the list should ...
1
vote
1answer
231 views

Turning off all layers in MXD using ArcPy?

I tried this standalone script to turn off all layers in the MXD: print "This script turns off the following layers:" try: arcpy except NameError: import arcpy mxd = ...
0
votes
0answers
53 views

Solving OD Cost Matrix gets slower and slower in the iteration process

I have 7000 points, and for each point I want to create a OD cost matrix of that point to all other points and write the result in separate tables - that is 7000 tables with 6999 records each. ...
1
vote
1answer
180 views

How to copy attachment feature class from personal GDB to File GDB?

I have some feature classes with attachments in personal geodatabase . I want to copy these from personal to file geodatabase automatically using arcpy. I used the code suggested by @Aaron to copy ...
1
vote
1answer
157 views

Export coded value domains

I've attempted to write a script that will export all the coded value domains in a geodatabase to a table. Before I dig in the to script and what's wrong, I have looked at the similar question on this ...
1
vote
0answers
55 views

Python code and modelbuilder [closed]

I am working with ArcGIS 10.2 and using python to use the function for zoom to selected feature. I need to have this zoom to selected feature work for any project and I also need drop down menus for ...
0
votes
2answers
96 views

specified target version has no edit versions to reconcile with

I'm writing a script to automate post and reconcile a target and edit version. I consistently get the warning message "The reconcile process was not performed. The specified target version has no edit ...
0
votes
1answer
249 views

arcpy.listfields for a beginner

I am very bad at python and I can't even get this script to work and the worst about this is that its really small script. Lets say I have a shapefile in C:\temp\test.shp and I want to list all the ...
0
votes
1answer
108 views

Creating Python Toolbox (*.pyt)?

I would like to create a new shapefile based on input. My input is DATE parameter. This is my code for input parameter: param = arcpy.Parameter( displayName="TARIKH", name="date_feature", ...
2
votes
0answers
305 views

Accessing results of trace geometric network tool in Python AddIn? [closed]

I'm attempting to write a python addin to ArcGIS that will carry out numerous traces on a geometric network using user specified flags/barriers. The first trace works fine and I'm able to access the ...
0
votes
3answers
106 views

How to export multiple MXD's using python?

I have several mxd's that use data driven pages to create an updated mapbook every month. 15-18 mapbooks and 163 pages each. This usually takes me two days and I'd like to automate this. I can export ...
4
votes
1answer
58 views

Excluding pages without point within extent from Data Driven Pages?

ArcMap 10.2 I am creating a utility mapbook to show HVAC points on an installation. The data driven pages are named and sorted by a separate layer (area feature class). There are 70 named areas, ...
0
votes
1answer
440 views

arcpy.env.overwriteOutput = True not working for one dataset

I am doing a basic copy from sde database to file geodatabase. I have a loop going through each feature dataset in the sde database, this loop is really basic it just uses arcpy.Copy_Management to ...
2
votes
1answer
93 views

ERROR 000271: Cannot open the input datasets Failed to execute (CompositeBands) (arcpy)

I am trying to stack bands 3 and 4 together for numerous landsat scenes, and I am trying to do it using a loop and arcpy.CompositeBands_management. The code I am using is: import arcpy #set ...
0
votes
2answers
103 views

Finding empty attribute field with search cursor

I'm trying to iterate through all fields in my feature classes to find which fields are empty. I've had a go at using the SearchCursor (borrowing bits of code from other answers). This is what I ...
0
votes
0answers
45 views

updateParameter() python toolbox

I can't update parameters in my Python Toolbox and I don't understand why. Someone can help me with this example code? class Tool(object): def __init__(self): self.label = "Tool" ...
1
vote
1answer
107 views

How to delete duplicate rows where multiple values are duplicated?

I have a feature class where there are multiple values duplicated in a row, i.e. SRNumber and RESOLUTION_CODE. I would like to delete all rows where my SRNumber and RESOLUTION_CODE are found in ...
0
votes
0answers
7 views

Putting “halo style” to labels with ArcPy? [duplicate]

I'm using ArcGIS 10.3 and I'm making a script I need to turn the field label of "ROUTE" and put my halo style lebels and add a text to my lebels this is my script as could modify my script? layer = ...
1
vote
1answer
147 views

How to batch merge point, polygon and line feature classes into a new feature class?

Using ArcGIS 10.3 for desktop. For our noxious weed surveys, we have some features recorded as polygons, some as lines, and some as points. I would like to convert everything to points, and then ...
2
votes
0answers
71 views

Update feature class from values in csv file [closed]

I'm trying to update a feature class with new data from a csv file. My workflow is as follows: Make a csv reader from csv file Identify my data columns using their index position Use an update ...
0
votes
1answer
77 views

Arcpy - add layer tif

I'm trying to write a python script that will add a tif to the table of contents of my map. (Eventually I want to convert to tool that allows the user to type in the filename and then has the tool ...
2
votes
0answers
78 views

arcpy RasterToNumPyArray causes shift in location of values

I am converting a couple rasters to arrays, then performing calculations on them. First step- polygon to raster. This creates a 1/0 mask that I can multiply the larger raster by. After noticing my ...
7
votes
2answers
159 views

Bing Authorization interrupts arcpy script

I made this happy little arcpy script to fix some data source problems: print "Hi, I will fix find and replace file path sections on your behalf. \nGive me a moment to just count the number of MXDs ...
0
votes
2answers
71 views

UpdateCursor not calculating the date

My UpdateCursor isn't working in arcpy. Here's my code: urows = arcpy.UpdateCursor(firstDatabase+ os.sep + "Temp") for urow in urows: urow.Import_Date = time.strftime("%d/%m/%Y") ...
0
votes
2answers
66 views

Selecting files with matching names and then executing a process

I have two lists and I would like to find a way to select them based on names. In list one I have a series of tif files: list1=['LT50300281984137PAC00_sr_band1.tif', ...
1
vote
0answers
61 views

Using the 'Mean' mergeRule with a spatial join

I have two feature classes. The first is a point file, derived from a raster, with the values for slope of the terrain. The second is a shapefile of polygons. What I want to do is spatially join the ...
1
vote
1answer
120 views

Determining local geodatabase release version with arcpy?

Can anyone get the release version of a ESRI local geodatabase, using arcpy? I should be simple, and yet... I use the "Describe" function on both personal and file geodatabases, and need to retrieve ...
3
votes
2answers
735 views

Using PyQGIS, ArcPy, NumPy, SciPy Together in Windows Command Prompt

I ran across this slight issue when I was looking to access python installations from ArcGIS, QGIS, Anaconda (cited because SciPy & NumPy come with it), and version 2.7 vs 3. Sometimes, I find it ...
0
votes
1answer
27 views

Creating polygons or map book from DBF file through ArcPy?

I have a dbf file, which contained a list of coordinate information as shown in below. It also could be thought as a catalog file. Example: ID XMIN YMIN XMAX YMAX 1 -52800.0 ...
1
vote
1answer
547 views

Using Raster Calculator expression in Python

I've posted about this problem before but I've got a few new questions. So here's the problem. I have two rasters containing bathymetry data: one containing the bathymetry of the sea floor, we'll ...
0
votes
1answer
232 views

Unknown Error? - A Column was specified that does not exist

shps = [(shp1,"field1"), (shp2,"field2")] for item in shps: shp = item[0] field = item[1] for row in arcpy.SearchCursor(shp, fields='"{0}"'.format(field)): if row == ...
0
votes
1answer
113 views

arcpy.da.UpdateCursor error: RuntimeError: create cursor has failed [closed]

I'm trying to delete a few rows in the output table that is created using the Compare Table tool (anything that has an ObjectID < 0). My script was working fine (i.e. it produced the table compare ...
0
votes
0answers
19 views

“df.zoom To Selected Features ()” is not near enough

Excuse me for my bad english I'm using ArcGIS 10.3 I am creating a script to screeshots I'm using df.zoomToSelectedFeatures () arcpy.SelectLayerByAttribute_management ("Road", ...