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

learn more… | top users | synonyms (1)

0
votes
0answers
27 views

Why Arcpy ExtractByMask returns a mysterious value “-128”

I'm getting an unexpected value of "-128" as a results of arcpy Extract by mask analysis. Input data is Esri GRID only containing values 0 or 1. Output format is .tif. For example, in this picture ...
0
votes
0answers
49 views

name 'row' is not defined error appears overnight

I'm using arcpy with arcgis 10.0. I strived days to write my first python script, and I finally get what I want until...a new error occured during the night. The script you can see below was tested ...
0
votes
1answer
75 views

Error 000728 field does not exist within table - field already exists

I am running arcpy.AddField_management to add a field called "cnid" and update it with x centroid values. For add.field I get the error "cnid" already exists. I tried print.field name and I cannot ...
0
votes
1answer
67 views

Syntax error using ArcPy Spatial Analyst module in Python [closed]

I'm very new to using python and figure I'm missing something obvious in the following script. I keep getting a "syntax error" message no matter how much I fiddle around with the first few lines. I ...
0
votes
1answer
30 views

Trouble with AddJoin_management? [duplicate]

While i'am trying to execute this code IN IDLE, i got error : import arcpy import math import arcview from arcpy import env arcpy.env.workspace = "D:/Users/saadiya/Documents/ArcGIS/Default.gdb" ...
1
vote
1answer
44 views

Unable to Write to Text File Unless Python Script is Re Pointed

I have a python script running from ArcToolbox. Each time the script is run, it creates a new text file (testtext.txt), writes to it, then deletes it at the end. Before the script is re-pointed, the ...
0
votes
1answer
40 views

limit spatial extent of arcpy cursor

How do I limit spatial extent of features that is returned by arcpy.da.SearchCursor? Can I use arcpy.env.extent? Or somehow come up with sql statement to specify spatial relationship? Or do I have ...
2
votes
1answer
84 views

How to get information about layers using Arcpy

I have this layer structure in ArcMap: "Localities, Gazeteers, Bases, Regions, and Territorial Claims are all Group Layers. All others under these are layers. I have a script that uses the Arcpy ...
1
vote
1answer
65 views

Update a field for similar values in the second field based on third field value

So I have the table like this: City Distance NearFeature Comments A 90.5 131025 A 0 781446 B 15.5 131057 B 42.2 140521 C 21.7 784116 C 0 ...
-1
votes
2answers
50 views

Intro to Geoprocessing Scripting with Python for ArcGIS? [duplicate]

Can you point me to any recommended online resources where i can learn the fundamental basics of geoprocessing scripting and the different modules/python has available for an ArcGIS environment. I ...
0
votes
1answer
51 views

Feature Layer no longer accesible after MakeFeatureLayer_management

I am creating a new layer out of an old one with MakeFeatureLayer_management like this: arcpy.MakeFeatureLayer_management("layername", "newlayername", "DEPTH = 1200") This works for the first time ...
2
votes
2answers
47 views

How to find number of synchronized records in ArcGIS10.2.2 (Data Management)

I want to find number of records synchronized while using arcpy.SynchronizeChanges_management tool. Right now, I'm getting only messages like process is Executing, Synchronize successfully ...
0
votes
1answer
39 views

Ignoring group layers when iterating through layers

I have this nice code that goes through each dataframe in the current MXD, and through each layer in the dataframe, and generates a list containing the name of the dataframe, the name of the layer, ...
1
vote
1answer
34 views

how to get date from excel with xlrd as text in textelement

when I run the script below in arcmap in the python window the date gets print however I get the following error:Parsing error SyntaxError: invalid syntax (line 19) the date isn't showing as text in ...
1
vote
1answer
59 views

Run a custom model via ArcPy fails

I'm trying to geocode a few address using a custom model created. When running the model via model builder all runs perfectly. Also when running it via the embedded interactive python console in ...
1
vote
1answer
34 views

ERROR 000358: Invalid expression “Parcelles_class.OBJECTID” = 1 OR “output_table1.src_OBJECTID” = 1 Failed to execute (Select)

I'm executing this code. I don't know if i'm missing something, I'm using Arcpy, Python, Arcgis 10.1 whereclause1 = '"Parcelles_class.OBJECTID" = 1' whereclause2 = '"output_table1.src_OBJECTID" = ...
-1
votes
2answers
70 views

SelectLayerByLocation - arcpy

I have 2 layers: "atikot" and "ways" that located in C:\Project\layers\New File Geodatabase.gdb , and i try to use this code based on "ArcGIS Help 10.2" to select features from "ways" layer: import ...
2
votes
1answer
53 views

Methods for converting a regular polygon grid to a numpy array

I have a regularly spaced model grid, 5000 by 5000 feet (517,300 cells), which I need to convert to a numpy array. I am investigation a couple of different methods, using arcpy, by which I can convert ...
2
votes
1answer
44 views

Nested SearchCursor functionality

I am trying to ultimately compare the gate height to the corresponding fence height located nearby. So far I have come up with the following: gates = "gate_line" fence = "fence_line" ...
1
vote
2answers
52 views

can't set up script tool parameters

I'm using arcgis 10.0. I red the ESRI doc to setting up script tools parameters, but I don't succeed at setting them up. My parameters before (without variable) #arcpy.env.workspace = ...
0
votes
1answer
55 views

Replace a feature class in a feature class list

I'm using arcpy with arcgis 10.0. I try a script that erase successively all the feature class of a list depending on a reliability field value. Each time a feature class is erased by an other one, I ...
3
votes
2answers
104 views

Assign point IDs to respective start and end attributes of a polyline

I have two shapefiles, Point and Polyline. I'm trying to populate my polyline layer with the point data ID (systemID) where the lines start to where they end; eg. create two columns (from and to). The ...
0
votes
0answers
36 views

Using Modelbuilder or Python to write output a folder name using database or table file? [duplicate]

Has anyone worked on Modelbuilder or python to write to automate creating a folder using the database or table file to write output a folder name and or/create the subfolders? I recalled I had an aml ...
1
vote
1answer
56 views

Can't solve “list out of range”

I'm using arcpy in ArcGIS 10.0. My code is supposed to test the intersection between all layer in a geodatabase by group of 2, and if so, erase one feature of each couple by the other depending on a ...
0
votes
1answer
69 views

Add CAD feature class to Arcgis using arcpy

I'm trying to add a CAD layer (point, polyline, annotation...etc) into ArcMap by python code, i'm using Arcgis 10.1, IDLE(Python 2.7), I faced many codes but they all gives errors, so i'm blocked ...
1
vote
1answer
65 views

Problem with Nested For Loop in ArcPy

I have two vector layer files, 'hausnummer_cropped5' and 'gebaudepoints_cropped5 - Kopie2'. Both have a point geometry and I am trying to shift the locations of the gebaudepoints_cropped5 points onto ...
2
votes
1answer
117 views

Tutorial on creating python toolboxes?

I've done the ESRI training: Creating Python Toolboxes Using ArcGIS 10.1 but is there anything more in depth? Since VBA is no longer supported in ArcMap 10 and up I'm trying to convert a cross section ...
1
vote
1answer
72 views

Trying to loop if condition at PYTHON code using Arcpy

I'm working with Arcgis 10.1, i'm trying to loop if condition on PYTHON code, but they give me as error : Parsing error IndentationError: unexpected indent (line 18) I don't know what is going wrong. ...
1
vote
1answer
42 views

Using ArcGIS ModelBuilder and GeoCoding

I looked at ArcGIS and python and I'm not quite ready for that rabbit hole as I'm on a schedule. I have a little experience but not at the level to pick it up quickly enough for my time frame. The ...
1
vote
1answer
57 views

arcpy.da.UpdateCursor where clause persists

I have some unexpected behaviour in an UpdateCursor. I'm iterating over quite a large dataset, and I've found that Python freaks out less if I break up the iteration into chunks: env.workspace = ...
1
vote
0answers
24 views

Parsing long lat xml tags into shapefile using ArcPy? [closed]

i have this xml http://www.massdot.state.ma.us/feeds/MARoadwayEventsXML.aspx import arcpy import xml.etree.ElementTree as etree xmlD = etree.parse("C:\data.xml") root = xmlD.getroot() this will ...
2
votes
2answers
83 views

Adding * .prj file to output via Python script tool that creates fishnet?

I'm a new python user. I wanted to make a tool box like fishnet in ArcGIS 10.2. Everything, works fine. However, at output there is no .prj file, although spatial reference was defined at the tool. ...
3
votes
1answer
66 views

Thiessen Polygon Total Area Calculations Model Builder/Python Code

I am attempting to create a tool using Model Builder (and Python code) for calculating the average annual precipitation of a study area using the Thiessen Polygon Method. My model runs good other than ...
1
vote
0answers
62 views

Download layers from arcGIS online in python [closed]

How can I get layers/maps from arcgis online in Python? I mean to download layers from Arcgis online in python, just like publishing. I've searched about it in the documentation of Arcgis 10.2.2, but ...
3
votes
1answer
107 views

Using arcpy and script toolbox to add the date to a attribute table

I would like some information on how to add a date to an attribute table, by adding a user specified date in a script tool that will update the polygons attribute table. In short I have two polygons ...
0
votes
1answer
48 views

What is expression for finding perimeter in ArcPy and Field Calculator?

What is the correct format for finding perimeter as an expression for arcpy. I was able to use expression !shape.Area! to find the area of my polygon. However when I use the expression ...
3
votes
2answers
38 views

Exporting multiple dataframes as images using ArcPy?

I use this code to export a dataframe to png, and it works. import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd)[0] ar = df.extent.height / df.extent.width ...
2
votes
1answer
61 views

Add value to field using arcpy

I calculated the azimuth angle between two points. I'm trying to create a new field where I will store my angle values, but although the field is created it stays empty, no values within! I'm using ...
2
votes
1answer
30 views

Trouble renaming layers using arcpy

Running ArcMap 10.1 So, I have a bunch of layers that all have the same name. I'm trying to rename them so that they have names that actually mean something. Everything runs fine until it is time ...
0
votes
0answers
27 views

Change Privileges tool does not work against feature dataset containing a network dataset

I'm trying to change the privileges on a feature dataset that contains a topology and network dataset using the ChangePrivileges geoprocessing tool. This works if I run the command manually from the ...
1
vote
2answers
90 views

Use row as input to other processes in python

I am new to python and need help. Looked for my answer but don't know if I am even using the correct terminology. I have a model in which I iterated through rows and performed a set of processes on ...
1
vote
0answers
27 views

ArcPy RemoveLayer removes all layers in loop

I am trying to remove layers that are not found within a list. The loop iterates through the layers within the Map_Left data frame. However, when I run this, it removes all of the layers within the ...
1
vote
2answers
61 views

Multi Value User Input as Variable in SQL Statement

I'm attempting to write a script that takes a user's selection as a parameter and uses that as part of the SelectByAttributes function. The parameter represents field attributes and is multi value, ...
2
votes
3answers
67 views

Arcpy: Processing multiple files subsequently

I have an indexed dictionary containing files and want to "mosaic" (arcpy.MosaicToNewRaster_management) all files with the same index. The number of files per index range from 1 to about 30. ...
0
votes
0answers
27 views

How to get a polygon of the outline of a raster using arpcy

I have a large number of georeferenced raster datasets, for each dataset I need to create a polygon of the outline of the raster. I know this is possible using raster calculator in spatial analyst by ...
4
votes
2answers
57 views

How to check for corrupted raster data?

I am working with thousands of tiled (2km x 2km) 4-band NAIP images. When I diced the images in Erdas, the program corrupted many of the tiles. The screenshot shows an example of one of the ...
2
votes
1answer
44 views

Arcpy SelectByAttributes and Show Selection

I understand that in order to do a SelectByAttribute in Python, you need to first convert the shapefile to a feature layer using the MakeFeatureLayer_management function, and run the SelectByAttribute ...
3
votes
2answers
55 views

How to get size of SDE geodatabase feature class

Is there a way in catalog or arcpy to determine the amount of hard drive space a SDE feature class takes up on disk? In catalog the 'size' column is blank and Esri help states: The size, ...
1
vote
1answer
33 views

How to use a feature class attribute to look up values in a table and pass them as parameters to a function?

My problem: I have a set of points inside a polygon. My goal is to figure out how long it takes (in days) for each point to move outside the polygon, based on a daily movement which affects all the ...
1
vote
0answers
49 views

Extract layer by attribute and export to new shapefile using arcgis scripting 9.3

I have a n-number of shape files based on attribute i want to extract the layer to export to new shape file, Using feature class to feature class conversion i can do, but i want to check for specific ...