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

learn more… | top users | synonyms (1)

-1
votes
2answers
116 views

Python script not working after exporting it from ModelBuilder

trying to figure out why my script wont work (I should mention I'm still at an intro level). This is a script I exported from ArcGIS model builder which worked fine using that: # Import arcpy module ...
3
votes
1answer
107 views

Arcpy - What's the best way to check whether feature class has selection? [duplicate]

In a sentence, how do you test in Arcpy whether a feature class has any selected records or not? More info below to explain: I am doing a batch process in which a sampling layer (10km grids) is used ...
16
votes
5answers
483 views

How to buffer raster pixels by their values?

The pixels to the left represent tree locations and their associated crown radii (i.e. pixel values ranging from 2 - 5). I would like to buffer these raster pixels by their crown radius value. The ...
3
votes
1answer
125 views

Use arcpy to connect to database without connection file

It seems like arcpy can only work with connection files. This creates one of two problems: Deployment requires manual creation of connection files. We have to write a bunch of code to recreate the ...
0
votes
0answers
113 views

ArcMap 10.2 SplitLineAtPoint setSplitRule not calculating RATIO

I am trying to set a length field to use the RATION split policy. I set the split policy for the feature layer but when I use the SplitLineAtPoint_management it does not calculate the RATIO length. ...
1
vote
2answers
75 views

Using python to get extent and split coordinates into list

I have the following code: for fc in fcs: desc = arcpy.Describe(fc) ext = desc.extent ext.split(" ") print ext I'm getting error: AttributeError: Point: Get attribute split does not ...
0
votes
1answer
109 views

Error Importing Arcpy - Python

I have written a script and am trying to run it in Python IDLE 2.7.6. I first try to import arcpy, but I get an error message saying "ImportError: No module named arcpy". Why doesn't it work? I'm ...
0
votes
0answers
42 views

How to bulk change the schema name of layer properties in ArcMap

I would like to change the data source location (schema) in layer property in ArcMap. Our data are stocked in an Oracle Spatial database. Recently, the DBA has changed the schema name and then I ...
1
vote
1answer
61 views

ListRasters not recognizing raster files in python

I have 2 rasters in my workspace, one in TIFF Format and the other in GRID format: "C:\ExampleFolder" When I use the python script: import arcpy >>> ...
0
votes
1answer
51 views

Listing Printer names in a Python Toolbox in Arcgis 10.1?

Here's my code for my third parameter in my Python Toolbox. When I run the toolbox and look at the list of printers, it only shows one of them. My print command of 'printerName' lists all of them in ...
1
vote
3answers
78 views

Assigning UNC Path to arcpy.env.workspace

For some reason my python script crashes ever time it reaches the following code which attempts to assign a unc path as my workspace. Can any of you please help me solve this problem? Also, I'm not ...
1
vote
1answer
64 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 ...
0
votes
0answers
187 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
30 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
40 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
44 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 ...
0
votes
0answers
42 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 ...
2
votes
1answer
173 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
63 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 ...
1
vote
1answer
55 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
36 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
94 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
61 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 ...
8
votes
2answers
177 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 ...
1
vote
0answers
45 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
113 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 ...
1
vote
0answers
41 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 ...
0
votes
1answer
146 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
32 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
163 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
120 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
96 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
120 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
104 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
138 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 ...
0
votes
1answer
521 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
167 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
1answer
96 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
181 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
66 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
76 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
136 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
56 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
306 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. ...
0
votes
1answer
72 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, ...
2
votes
1answer
62 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
43 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
65 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
114 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
196 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 ...