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

learn more… | top users | synonyms (1)

6
votes
1answer
190 views

Generate ArcGIS spatial bookmarks from feature envelope

Curious if anyone has some code that would rip through a feature class and generate a spatial bookmark for each feature's envelope. You could define a field in the feature to be the bookmark's name.
5
votes
1answer
624 views

Stop an arcgis model until all values are collected and then continue

This is similar to Modelbuilder - If precondition is false, continue iterating next input but I want the iterate tool to run to collect all the values and only then continue to the merge. Any ideas? ...
4
votes
1answer
101 views

Renaming 1,200 rasters in File Geodatabase using ArcPy?

I've been tasked with renaming a large amount of raster files within a file geodatabase (ArcGIS style). I'm taking weather data which has a name format as such: "G"mmddhhhh I'm trying to add a year ...
4
votes
1answer
120 views

How can I exclude a field on a table from being copied?

I have a query "layer": >>> r = arcpy.MakeQueryLayer_management(r'C:\path\to\connection\file\connection.sde', 'TEST', 'SELECT T.ID AS OBJECTID, T.* FROM MY_TABLE T WHERE T.SOME_COLUMN = 1', ...
4
votes
1answer
188 views

Can a folder connection in ArcMap Catalog window be added using Python?

I have created a set of general scripting tools for map automation, etc. In one of my tools a geodatabase is created in the workspace folder the script points to. Just out of curiosity, is there any ...
4
votes
1answer
266 views

Getting buffer wizard-like speed in Python (vs using MultipleRingBuffer_analysis)

I've got a script that takes a single input polygon feature, throws 10 buffers around it at tenths of a specified input distance, and then symbolises the output based on an existing layer file. ...
3
votes
1answer
61 views

How write query in “Select_analysis” that compare string from one column with another column?

I have a shp file (s.shp) with column "A" and column "B". I try copy from this file only that rows where string value from column "A" is part of string value from column "B" e.g. A 0.1 0.2 0.3 ...
3
votes
1answer
236 views

How come “Zoom to Polygon” always puts me in the middle of Nebraska?

This is an issue related to this question I'd asked a few days ago. I've got that code working, to an extent. Every time, though, that I double click on one of the Polygons in the attribute table that ...
3
votes
1answer
194 views

Exporting records from an attribute table and placing them in a txt file

I am trying desperately to grab records in a shapefile's attribute table and copy them, with additional formatting to a txt file. Below is the code I have developed thus far: I have used the ...
3
votes
1answer
166 views

No placement inside feature dataset using arcpy XYtoLine?

When I run the following code with the outFC creation path set to a feature dataset inside a file geodatabase... arcpy.XYToLine_management(tempFC, outFC, "POINT_X", "POINT_Y", "NEAR_X", "NEAR_Y", ...
3
votes
1answer
857 views

Multiline VBScript Label Expressions in Arcpy

I am able to set simple label expressions, but when I try to set multiline expressions (which all VBScript expressions are) it does not get copied into the expression box properly. I have tried using ...
2
votes
1answer
35 views

Populate a layout text element with the description from a coded value domain

ArcGIS 10.1+ lets you easily put dynamically populated text boxes in your print layouts. Doing so puts some text in the text element that looks something like this: <dyn type="page" ...
2
votes
1answer
50 views

Map algebra from files in multiple directories

I'm a rookie in python programming. I want to do map algebra for multiple rasters but these rasters are in different folders. Here's the code ive created so far: #Importing modules import arcpy from ...
2
votes
1answer
66 views

How to get the two nearest points between two polygons

I'm trying to draw the nearest line between the nearest polygons in a Polygon dataset (ESRI Shapefile). I know that for this purpose there is the Near Tool (ArcGIS), but it just return the point TO ...
2
votes
1answer
49 views

How do you duplicate a point within a shapefile using Python?

How do you duplicate a point within a single feature class using Python? I have a partial sample script below, but in a nutshell, I want to duplicate a point, copy it into the same shapefile, and ...
2
votes
1answer
28 views

ArcPy Empty Buffers

I have written an ArcPy script to process a DTM into a point feature class to be used in Landform classification and ranking. It successfully produces what I need most of the time. Randomly the ...
2
votes
1answer
44 views

Export Stretch Function values - Arcpy

I'm looking for a way to export Stretch Function values from images that’s stored in a Mosaic dataset. Not values from the whole set, but specific stretch functions per image. The set is stored in ...
2
votes
1answer
917 views

Getting ValueError: max() arg is an empty sequence on a Python Script in the Field Calculator in ArcMap

I have a script that populates a FacilityID Field on a Attribute table in the Field Calculator but when I run the script below I am getting a error. EDIT: Python Script: def autoInc(): import ...
2
votes
1answer
73 views

Conditional SQL Query

I've been running a code that searches a desired field in a feature class and performs an specified SQL query based on whether the field is string or double. The variables are just temporary fillers ...
2
votes
1answer
80 views

update cursor to calculate field

This is my first post, so any help is greatly appreciated. I'm trying to use an update cursor to calculate a field. Basically, I'm trying to avoid division by 0 by looking in row[0] and see if it's 0. ...
2
votes
1answer
35 views

Filtering out Annotaion Feature Classes using arcpy.da.Walk()?

Is there a way to use: for dirpath, dirnames, filenames in arcpy.da.Walk(): to filter out annotation feature classes? The help doesn't specify them as a type, which is strange because using the ...
2
votes
1answer
283 views

mosaic raster to file geodatabase yields missing raster sections

Since upgrading to ArcGIS 10.1 (SP 1) from 10.0, I've been encountering an issue when running the arcpy.MosaicToNewRaster_management() tool with output to a file geodatabase. I'm principally working ...
2
votes
1answer
226 views

Arcpy Network Analyst solver error

Hello GIS Stack Exchange, I am finding it difficult to load locations to sublayers using python in ArcGIS 10.0 network analyst Vehicle routing problem. I'm also having some trouble debugging my ...
2
votes
1answer
234 views

How do I write a script to list those layers with broken data sources?

In my SHP to GDB toolbox, I create a list of layers in MXD, then I check for those not broken I move them. Despite using ListBrokenDataSources I have errors like this: Runtime error : [Error 3] ...
1
vote
1answer
11 views

Including NoData zones in zonal statistics table

I am running the zonal statistic tool on a raster with a shapefile that consists of several regional polygons. I would like the zonal statistic to include the regions that are completely NoData in the ...
1
vote
1answer
26 views

ArcGIS 10.2 arcpy — how to import/install win32com?

win32com used to be included with arcpy 9.x but no longer. I used to use it to manipulate excel occasionally. I downloaded and let win32com install itself and then tried to follow some online ...
1
vote
1answer
40 views

ArcPy script stops running randomly with no error returned

I am doing a batch watershed and analysis process on 135 points. This script worked great the first time I ran it. Ever since the first time, however, I have had the script stop at random moments. ...
1
vote
1answer
30 views

Programmatically access HTML Popup in Layer Properties ArcGIS 10.2

Is it possible to access HTML Popups (found in layer properties) programmatically in ArcGIS 10.2? I can't find any reference but thought I'd ask to double check.
1
vote
1answer
44 views

Multivalue processing in the context of the modelbuilder

I am new to python so please bear with me. I have the following script that is supposed to get a multivalue parameter of several shapefiles as an input and then run the unionanalysis on all these ...
1
vote
1answer
35 views

Add multiple fields to attribute table by python, with a prompt window for parameters

I know how to add field to arcmap shapefile using Python: import arcpy arcpy.env.workspace = "H:\pythonexercise\NZL_rds\NZL_roads.shp" arcpy.AddField_management("NZL_roads", "LENGTH", ...
1
vote
1answer
37 views

Moving Esri grid format and info folder inside working directory?

Using the below code, I want to extract a new raster from an original raster using value field and I want to automate the process for 70 more rasters. However, for testing purpose, I'm using only 3 ...
1
vote
1answer
79 views

Extremely slow processing time to map lat/lon data onto census shapefile with ArcPy?

I am a newcomer to ArcGIS and Python so I would greatly appreciate any and all input on this issue. What I am trying to do is very simple: map 400K business locations using lat/lon coordinates onto a ...
0
votes
0answers
75 views

Compare cell value of a row

How can I compare the cell value of row(n) with cell value of row (n+1){where n = 1, 2, ...} import arcpy arcpy.env.workspace = "C:\RG\Kings County\Test.gdb" inFC = arcpy.GetParameterAsText(0) inFC ...
0
votes
0answers
154 views

Arcpy - change layer from sde connection to file geodatabase

We are copying data from our corporate office to field offices and we are creating a file geodatabase at these field offices. We are copying the layers that point to sde and they need to point to the ...
0
votes
0answers
131 views

Why would arcpy.Delete_management give ExecuteError: ERROR 000317: …dataset cannot be deleted?

arcpy.Delete_management(r'..dataset') returns ExecuteError: ERROR 000317: ...dataset cannot be deleted But it works in python interactive window... Anybody run into the same issue before?
0
votes
0answers
131 views

Error in Select Numeric type column in pyodbc with ArcCatalog

I created a python script that uses "pyodbc" plugin to connect a SQL Server database and write out data. It was imported in an ArcGIS 10.1 tool and run from there. try: arcpy.AddMessage('FLAG 0') ...
0
votes
0answers
36 views

How to use na.Solve() on layers already created?

I am fairly new to arcpy and I am having troubles recreating the following set of instructions with a python script. Open the KeyChainTest.mxd Enable the Network Analyst extension. Click solve on ...
0
votes
0answers
172 views

How to convert shapefile to tpk using python(ArcGIS 10.1)?

I'd like to convert shapefile to tpk using Arcpy.I surf in ArcGIS 10.1 help but i couldn't find any desire reference to help me . How can i convert shapefile to tpk using arcpy ? which function i need ...
0
votes
0answers
86 views

Copy Raster Catalog from .mdb to .gdb, but only within a certain extent with arcpy?

I am stumped again, this website has really helped me before so here is another shot. I am trying to copy a raster catalog from a personal geodatabase to a newly created file geodatabase but only ...
0
votes
0answers
687 views

insert cursor and arcpy.da.editor

I am trying to insert geometries and attributes to a featurclass the has attachments enabled. The featureclass is in an sqlserver SDE 10 database with service pack 2 installed and the featureclass is ...
0
votes
0answers
59 views

Pyscripter hangs on spatial join?

I've got a script which loops through a series of FC layers (tracker points). Using a FOR loop, they're reprojected then joined to a streets layer. Sometimes it works fine, then other times it never ...
0
votes
0answers
205 views

python script to calculate and return values based on several conditions

I need to calculate and return the value "continuous" to those records in a polygon feature class with species records aggregated to a UTM grid considering the attributes are species name, grid code, ...
0
votes
0answers
87 views

Create Vertex and add empty attributes to it

How can I create a vertex(and then a point feature on the vertex) on a polyline and give it some empty attributes(create fields), move an existing vertex, delete vertex? I am in ArcGIS environment and ...
0
votes
0answers
141 views

Can I do full SQL expressions through the “WHERE” clause in UpdateCursor?

Run as a standalone python script for a shapefile in a toolbox on ArcMap. For example: psql_url_pop = '''SELECT shapefile.NAME_# + shapefile.WIKI_URL FROM public.shapefile''' rows = ...
0
votes
0answers
153 views

How to iterate throught fields names in a table and change row values?

I got table like that one (Example). I need to change 0 to 1 and -1 to 0 in each field except first and second. The problem is that every time i have different number of fields and field name is ...
0
votes
0answers
947 views

Use Python to change datasource from a feature class to a view built on the feature class

I'm trying to replace the datasource for all of the layers in my map document using Python but I keep running into an error. Right now, all of the layers point to a feature class called ...
0
votes
0answers
159 views

Export Data Driven Pages extents to Kmz

Is it possible to export the extents of DDP to KMZ using arcpy - Map to KML (Conversion)? Alternatively can we export each extent of a single DDP extent to a new mxd and then run arcpy.MapToKML_3d on ...
0
votes
0answers
390 views

How to: ArcGIS Server GP Service messaging back to silverlight client

How would I get messages back from my GP Service to the silverlight client? I am passing the gp service some data to process and I want to have the gp service give some respone that the silverlight ...
0
votes
0answers
149 views

How to enable user to specify field mappings from a table joined to a feature class?

I have a feature class and a new table every few days. I need to have the table's attributes added to the feature class based on a join. What would be a good interface in ArcMap to let the user map ...
-3
votes
0answers
30 views

Exporting group layers from Table of Contents (TOC) to Folders of shapefiles?

I have some group layers in the Table of Contents (TOC). Each group of layers references a few shapefiles from different source folders. I would like to export each group layer name as a folder and ...