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

learn more… | top users | synonyms (1)

0
votes
1answer
32 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
30 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
52 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
27 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
56 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
42 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
43 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
49 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
48 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
77 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
55 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
61 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
63 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
94 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
67 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
35 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
55 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
69 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
48 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
55 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
89 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
36 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
35 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
51 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
25 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 ...
-1
votes
0answers
30 views

how to use “ListFeatureClasses” to shp add to dataframe by geometry

I'm using arcgis 10.2.2 and I want to make a tool I have a feature dataset that is being updated constantly with new feature class The purpose of the tool is to have the option to deploy all my data ...
0
votes
0answers
18 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
1answer
70 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
25 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
50 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
65 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
25 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
52 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
40 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
47 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
31 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
36 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 ...
1
vote
0answers
50 views

multiprocessing and the ArcGIS in_memory workspace

I am trying a script that makes use of multiprocessing and a number of tools within arcpy. The script works only if I write all input, intermediate, and output from child multiprocessing executions to ...
1
vote
1answer
36 views

python script to retrieve names and scale range from an ArcGIS MapServer url

i am pretty new at ArcPy. i need to write a python script to retrieve names and scale range from an ArcGIS Map Service url. i had a look around json and url2lib but i am lost. I want to retrieve the ...
3
votes
0answers
54 views

Changing workspace path of query layer using ArcPy?

I'm trying to change the workspace path of a query layer using the code below and it always breaks. The layer is connected to a view in an Oracle Spatial 10g database. The database is SDE enabled ...
0
votes
1answer
38 views

Sort legend items up and down with arcpy

I work with arcmap 10.2.2 and I have 10 mxd's in one folder. I try to sort the legend items with a python code by moving the legend items up\down and i want that the layers in the TOC stay as is. I ...
1
vote
1answer
52 views

Saving a ArcMap layers RGB values into the attribute table

I am wanting to take a symbolized layer in an mxd, and save it's symbol color (like a polygon fill) into its attribute table as an RGB value. My goal is to use this value in MapInfo to symbolize it's ...
3
votes
0answers
25 views

Can I automate the transfer of symbology information of a raster to a polygon feature?

I have a raster dataset that is symbolized using Natural Breaks (Jenks) classification (9 classes). To reduce file size for web service display and download, I used the Reclassify tool to remap pixel ...
0
votes
0answers
31 views

Moving legend items up and down with arcpy [duplicate]

How can I move a layer up/down in the legend using arcpy? I work with ArcMap 10.2.2
1
vote
1answer
40 views

Find points within a radius in ArcGis 10.2

I have a feature service which is created from a view in a geospatial geodatabase. I want to retrieve all the point/geometries than fall within a specific distance. I am using arcgis 10.2 I know that ...
0
votes
1answer
88 views

Optimizing ArcPy code to cut polygon?

There is a lot of nested loops and wondering of ways I could speed up this code? Any ideas? Note: This requires ArcMap 10.2 def cut_geometry(to_cut, cutter): """ Cut a feature by a line, ...
1
vote
0answers
36 views

Extract .mxd file + data from map package .mpk?

I have two applications - a pc app which uses .mpk and a mobile app which uses .tpk I can generate both, given the .mxd file - but I'd like an easy way to go from a .mpk to .tpk The idea being that ...
2
votes
1answer
27 views

Changing the active tool in an ArcGIS Python Add-in Tool Palette?

I have an ArcGIS Python Add-in project with a tool palette that contains a dozen different tools. I would like to be able to change the 'active tool', i.e. the tool that is visible on the toolbar, ...