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

learn more… | top users | synonyms (1)

1
vote
1answer
101 views

Delete Turned Off (Unchecked) Layers from Arcmap with Python

I have about 100 figures that have been updated countless times and a lot of the old data was left in each .mxd but was only turned off (unchecked) and not removed. I would like to remove these ...
1
vote
0answers
1k views

How to use replaceDataSource to replace data source for multiple layers?

I appear to be having difficulty with using 'replaceDataSource'. ESRI has atrocious documentation on updating and fixing data sources, and almost everything I have read on the subject is almost what I ...
0
votes
0answers
49 views

ArcPad checkout/in process, only selected features

I am working on developing a python toolbox to automate the steps required for checking data out and back into a file geodatabase. My question is what is the best way to limit the features checked ...
1
vote
2answers
57 views

precision of positionalongline and/or SpatialJoin

I've been using positionAlongLine to create points that are supposed to line up with the lines from which they are derived. When I tried to use SpatialJoin_analysis with the match_argument set to ...
0
votes
1answer
85 views

Topo To Raster executing but not creating the raster

I am using Topo to Raster by File (ArcGIS version 10.1) via arcpy on a large stream and point dataset. Arcpy runs fine and executes without issuing any error message, however it does not create the ...
1
vote
1answer
82 views

CAD to GDB import using ValueTable function

I have several CAD files (DWG) that I want converted to Feature Classes within a file GDB. Each feature class will be based on a polyline attribute "LAYER" value, so I have a query filter applied ...
3
votes
1answer
648 views

Why does Raster Calculator (RasterCalculator_sa) give ERROR 000539 in ArcPy?

I am getting a not executed error for a raster calculator. Here is part of the output: File "C:\projectTemp\FloodAnalysis\floodxsectionanalysis.py", line 107, in makeSeemless ...
2
votes
1answer
105 views

SQL expression to python expression

I have a SQL expression that I use in Make Feature Layer in Model Builder ("HOSPITAL" = '% HOSPITALNAME%'). The expression makes a selection in a OD Cost Matrix that a patient is patient only at one ...
0
votes
1answer
174 views

Is it possible to get full path for broken data source to repair broken data link?

This question links back to an old question of mine: Convert shapefiles in nested folder to geodatabase I am attempting to find a permanent solution to fixing the broken maps, and in such a way that ...
1
vote
1answer
63 views

Arcpy MosaicToNewRaster problem

I can't seem to get the mosaic created for this. import arcpy arcpy.env.workspace = r"C:\projectTemp\FloodAnalysis\output\2yr\raster" arcpy.env.overwriteOutput = True srName = ...
0
votes
1answer
226 views

python script to convert shapefiles in a folder to .kmz's with the SAME shapefile name

Pretty new at working with python and am Stuck...I have a "for" Loop that looks in a folder and, based on a criteria (Homes valued over 500k), creates .kmz's with symbology for each of the .shp files ...
0
votes
0answers
137 views

Using cursors to update field that has relationships

I am still learning python and arcpy. I have spent too much time trying to figure out this code. I need help. What I have is two feature classes that have the same column names. One has older data ...
7
votes
2answers
222 views

Unusual results for geoprocessing speed tests

I have been observing unusual performance with a Python geoprocessing script. The (attached) script performs the following actions: Use a search cursor to look up UTM zone corresponding to polygon ...
0
votes
0answers
52 views

how to open a layer's table in a map document

Trying to create a map document programmatically. Added a featureclass as a layer. When I open the map document in ArcMap, I want the table for that layer to be open. Found TableView (doc) and ...
1
vote
0answers
169 views

How to utilize GPSQLExpression data type in Python Toolbox

I am trying to write my first Python Toolbox for ArcGIS (neat stuff by the way). The tool is simple enough - it connects to SQL Server and downloads data for the user. The trick here is, I want the ...
0
votes
0answers
101 views

Running Buffer_analysis in PyScripter fails to execute

For some reason, I can't get Buffer_analysis to run successfully from PyScripter(2.5.3.0) for a particular shapefile. It fails to complete and exits with error 999999. I can run the exact same ...
1
vote
1answer
304 views

Out of memory when calculating loop in ArcGIS 10.2 with Python 2.7

I am quite new to scripting for ArcGIS, so don't mind the styling and layout. I am trying to calculate 600.000 routes by looping a network analyst route analysis. The script extracts two pointID's ...
2
votes
0answers
42 views

Extract MultiValuesToPoints yields identical value for each band

I'm attempting to extract hyperspectral remote sensing data to a point featureclass using the ExtractMultiValuesToPoints ArcGIS tool. The value of each band (228 bands) should be appended as a field ...
1
vote
2answers
614 views

Creating a new feature class with python and then adding attibutes

I am having trouble adding rows to a shapefile after it has been created. I'm not sure if I need to create the shapefile in memory and add the data or creating then re-open the file. While I've ...
1
vote
2answers
183 views

Iterate Through All Combinations of Features by Selection in ArcGIS Python Script

I have question about ArcGIS and python script. There are following sample code, So I would like to change Another Field , not OIDFieldName. Please let me know how to change Another Field. import ...
1
vote
3answers
232 views

Append Attribute Table of multiple feature class with same points/ pointID

I used extract by points function to extract values from multiple rasters using a point feature class. The output is a couple hundred point feature classes with values associated with those rasters. ...
-2
votes
4answers
158 views

How to Calculate Field to six digit number from another field concatenated with State Plane code in ArcPy? [closed]

I'm trying to calculate a field (Unique_ID) in arcpy that will bring in a six digit number from another field (Point_ID) in the table. I want to add the state plane code to the end of the Point_ID ...
0
votes
1answer
174 views

arcpy move attributes from one column to another on a joined layer

Sort of new to Python. In Arcmap you can calculate a field on a joined table to just move the attributes from one column to another with just an = sign. Since my layer has feature linked anno on 7 ...
2
votes
1answer
770 views

How to get arcpy.AddMessage() to display a message from a script tool called from another script tool?

I am using a python script tool within an ArcToolbox in ArcGIS 10.2. The script calls another python script tool while running but does not display the messages from the called script when using ...
1
vote
1answer
6k views

What does ValueError: invalid literal for int() with base 10 indicate?

# Process: Get Raster Properties Max_Aggl = arcpy.GetRasterProperties_management(EucDist_Aggl, "MAXIMUM", "") print (Max_Aggl) print float(Max_Aggl.getOutput(0)) b = int(Max_Aggl.getOutput(0)) c = b/2 ...
1
vote
2answers
1k views

Import Arcpy using PythonWin

I tried to install pythonwin26-212 from ArcGIS10.0 Desktop CD. pythonwin26-212 stops working as soon as I press "Enter" in the interactive window. (ps. I downloaded pythonwin26-212 from sourceforge ...
3
votes
2answers
166 views

Setting the Centroid of a Set of Polygons

I'm trying to shift a set of rectangle polygons over an area of interest (AOI). I thought it would be as easy as setting the SHAPE@TRUECENTROID of the polygon area of interest to the ...
7
votes
2answers
215 views

Finding specific pixel values ​​in ArcGIS using Python

I have a raster file containing some integer values. I need to find all pixels whose values are not defined in list like this one: l = [1,2,4,8,16,32,64,128]. Is there any easy way to solve that ...
1
vote
0answers
85 views

Python script does not work for a LGA with space [closed]

Thanks! I got my script working now with replace gp.AddMessage() instead of print when running the script in ArcMap and replace the quote with blank as well since Python would include the quotation ...
1
vote
1answer
208 views

What is correct Where Clause when using variable and Select By Attribute tool within loop?

I have seen several similar posts related to this technique but I am still having issues. The following script is intended to select all points from one shapefile that are within the boundaries of a ...
2
votes
1answer
428 views

How to build SQL Expressions in ArcGIS 10.1 Python script tool dialog?

I've made a python tool that requires the user to establish which state to select within an input's table (the "Prepared Footprint"). However, once the user drops in the layer and tries to write the ...
0
votes
1answer
82 views

How to reproject Network Dataset from GCS_WGS_1984 to Web Mercator?

I need to know how to change the coordinate system of my feature dataset with its network dataset from GCS_WGS_1984 to Web Mercator. Once I know how to do this, I would like to make a tool in Python ...
9
votes
5answers
443 views

How to improve performance when using ArcGIS cursors in Python with big tables?

I have a pretty big point feature class in a file geodatabase (~4 000 000 records). This is a regular grid of points with a 100m resolution. I need to perform a kind of generalization on this layer. ...
1
vote
1answer
121 views

How to use InsertCursor to add points to a point feature class?

I am struggling with a very simple task of inserting "SHAPE@XY" into a point feature class. Following is what I have: xy = [(361087.15436001675, 198747.07296730898), (361530.56426259346, ...
1
vote
1answer
348 views

Using a Select By Location in Python and Calculating a field based on what State Plane a point falls in

Here's what I have so far. Do I need to make another feature layer based on the selection? import arcpy arcpy.MakeFeatureLayer_management(r"PATH TO THE POINT", "point_lyr") ...
2
votes
1answer
112 views

*.lyr to *.style conversion in ArcGIS

Do you know how it's possible to convert a layer symbology or an *.Lyr file to an *.style file? Thanks, Jérôme
1
vote
1answer
87 views

turn a Result object into a number

**import arcpy from arcpy import env from arcpy.sa import * import math # Check out any necessary licenses arcpy.CheckOutExtension("spatial") # OverwriteOutput arcpy.env.overwriteOutput = True ...
3
votes
2answers
256 views

Using python to Raster clip the extent to be the same as the display?

I've been trying to figure this out for almost a week now. I am creating a tool which first needs the raster to be clipped out to the current display. I have tried all sorts of things. Below is the ...
5
votes
2answers
359 views

Download data via a ftp server using polygon features

The attached script loops through the features of a polygon featureclass and uses that attribute information to download particular files via a ftp server. The script works great for downloading ...
4
votes
1answer
1k views

Finding duplicate records in a field via Python in field calculator

im looking for duplicate records in dbf files based upon the attribute called 'ID'. I have various dbf files from 500,000 records to 1.5 million and I know there are a host of duplicates. I would ...
2
votes
1answer
98 views

How to re-arrange attributes of a polygon based on attributes of polyline file?

I have a polyline (subrivers) and polygon (subshed) shapefile with both of them are shown along with tables. Their FID index don't overlap spatially, e.g. surivers second row attribute doesn't ...
1
vote
1answer
409 views

Why does copying ArcSDE datasets and features in Python give ERROR 000732 & 000735?

Go easy, I'm new to python I keep getting a kick back that says this: ERROR 000732: Input Features: Dataset 'Database Connections\Wyoming.sde\Supporting_MT_DBO_Geology' does not exist or is not ...
9
votes
4answers
226 views

How to determine if point is surrounded using raster processing?

I am attempting to improve a currently extremely cumbersome vector/python process for a natural hazard model. At the moment we have a lengthy script which generates distance/bearing lines from a given ...
0
votes
0answers
105 views

recording pixel value with Python script in ArcGIS 10.x

A scripting newbie question... I'd like to write a Python script for ArcGIS 10.x that would record the pixel value for all pixels in a raster. Furthermore, I'd like to only record a given value once ...
5
votes
1answer
554 views

How to select specific row in attribute table using ArcPy (without iterating through whole table)?

I am using ArcGIS 10.2 and have assumed until now that it is possible to select a specific row in an attribute table. However, I can't seem to find a way to do this. The only available methods seem to ...
0
votes
0answers
43 views

recording pixel value with Python script in ArcGIS 10.x

A scripting newbie question... I'd like to write a Python script for ArcGIS 10.x that would record the pixel value for all pixels in a raster. Furthermore, I'd like to only record a given value once ...
0
votes
1answer
511 views

Arcpy ListLayers function returns only the first sub layer in a group layer (as opposed to the group layer AND all sub layers of that group)

I thought the arcpy.mapping.ListLayers function in ArcGIS 10.1 was supposed to return group layers AND all of their sub-layers, but my script is only outputting the first sub-layer in a group layer. ...
4
votes
1answer
593 views

Generating a multivalue choice list in ArcGIS using Validation [Not availalbe for Standard License]

I'm trying to adapt a model and script combination found on ESRI's blog site titled 'Generating a multivalue choice list'. However, I've concluded that part of the validation used in the embedded ...
2
votes
2answers
159 views

Python Def Query Help for multiple layers

I have Three layers in a .mxd, all three layers have a common value I can use, but a different Label in each Layer. As an example, the Value I want to use is "100" In Layer A, the Value is in [Name] ...
1
vote
2answers
147 views

Copy rasters slow, increases file size

I have a folder with ~1200 aerial photos in both jp2 and tif format, of which I need about 380. I wrote a python script to get the names of the files I need, which works fine. But when the script ...