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

learn more… | top users | synonyms (1)

1
vote
1answer
163 views

Why does this SQL syntax produce empty feature class with ArcGIS Select_analysis?

I'm working on a script that involves an arcpy.select_analysis function. The problem I have is that when I run the script it produces an empty file. I've verified that the whole thing works when in ...
0
votes
1answer
195 views

ArcPy: Error in For loop panToExtent + export to Tiff

I'm trying to trouble shoot a script, which has the objective of allowing a user to input a query for selected field, use the panToExtent function to pan the data frame at the specified scale to that ...
1
vote
2answers
2k views

What is causing - Arcmap errors (010302/010067) while using 3D analyst/CutFill? [closed]

I'm using the Cut/Fill tool in 3d analyst to measure the volume of a feature, but I'm getting the following errors: ERROR 010302: Unable to create the output raster: C:\Program Files ...
5
votes
5answers
746 views

How to add Radio Buttons to Python Script tool dialog?

I have 3 Point shapefiles for 3 species that contains the accession points of each. The user needs to specify only one species at a time. I need to write a script tool for adding the selected Point ...
2
votes
1answer
127 views

how to calculate raster layer statistics using arcpy?

I'm trying to write a script that will, in part, calculate statistics for a raster layer in an Arcmap mxd, but when I run the script I get an "invalid parameter" error (Error 000840), saying that the ...
6
votes
4answers
2k views

How to convert geometry to WKT using ArcPy?

I would like to be able to convert a single feature (or potentially many features) in an ArcGIS layer into Well Known Text (WKT) format during a geoprocessing operation using Python and ArcPy (no ...
1
vote
1answer
109 views

Arcpy CreateUniqueName usage: keep original input names

This is a continuation of the question I asked here: At this point I'm really just trying to get everything in one place and keep the original shapefile basename. I'll tackle merging like-named ...
2
votes
0answers
47 views

Difficulty in running the script

I have developed a script tool for adding a layer in the current map document. It did not work.. The message is "Completed script addlayer...". But there were no layers added in the TOC. Another issue ...
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 ...
4
votes
1answer
164 views

Why do ECWs go missing when exporting MXD to PDF with ArcPy?

I'm trying to export some MXD maps to PDF with arcpy (ArcGIS 10.1). Everything works fine and dandy except for ECW images, which don't appear in the PDF. However, when I execute the same code from the ...
3
votes
2answers
574 views

ArcPy Report syntax error

I'm working on trying to use arcpy to automate the creation of a report, but I'm running into a problem. >>> ...
1
vote
1answer
132 views

How to query and display layer using ArcGIS Python script tool? [closed]

I have database which contains point shapefiles and raster files for 3 species. My aim is to develop a script tool that should have a search tab to enter the species name. also, a check box to select ...
3
votes
1answer
227 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
208 views

How can I validate a table name on SDE with Oracle backend?

Second title: "Is arcpy.ValidateTableName broken on Oracle?" I have an Oracle SDE database 9.3.1 (service connection). My arcGIS client tools are version 10.0 SP5). I have some names of feature ...
2
votes
1answer
182 views

Evaluate minimum points required to define polygons based on an error threshold

I need to build a model or write an algorithm to do this, which I would like you to share your ideas with me. here is my cadastral problem: I have plenty of polygons and I need to make a report of ...
0
votes
1answer
326 views

Dissolving shapefile python script not working, syntax help please

I do not understand why this simple script won't work. I can get it to dissolve in model builder but not from a script that I run from inside the map document. My output results are 4 polygons, just ...
1
vote
1answer
93 views

Custom Model should be used with ArcMap or ArcCatalog?

I have one basic question , when you create custom model using model builder in ArcGIS. It should be used with ArcMap or ArcCatalog? Reason I am asking this question is I have created a model and I am ...
2
votes
1answer
136 views

How to change VB syntax to Python in Field Calculator?

I want to calculate a field, this is my working example in VB: "C:\Users\Admin\Desktop\Data\" & !Work! & "\1000_\" & !Data! & ".pdf" I'm slowly changing all my scripts to Python, ...
1
vote
2answers
237 views

ArcPy- AddJoin-function struggles using Table of PersonalGeodatabase

Hey, I am doing some arcpy -functions and afterwards I'm trying to add the calculated results from one table to another table. I'm using the arcpy.AddJoin_management() function. As input table I'm ...
0
votes
1answer
515 views

Where Clause problems when all parts are user input variables

I have written some generic user ipnut code for a toolbox script (ArcGIS 10.0) but because everything is a variable I don't know how to write the SQL whereclause. Please can someone help and suggest ...
0
votes
1answer
65 views

How can I hide custom model from mytoolbox in ArcGIS

I am created model in ArcGIS using model builder and python script. To build main model I have created some submodel and script in the same toolbox. I just want to show main model in the toolbox and ...
2
votes
1answer
351 views

Error 999998 in Arcpy 10.1

I found an RuntimeError: ERROR 999998: Unexpected Error when lunching Arcpy in my ArcGis 10.1 such as this: Runtime error Traceback (most recent call last): File "", line 50, in File ...
1
vote
0answers
299 views

How to transfer the attributes of features based on their spatial relationship?

I'd like to check if a point feature class is placed on a line feature using python in ArcGIS 10.0. I have created a set of point features and placed them directly on a group of line features at ...
4
votes
2answers
228 views

Moran's I z-score in ArcPy

I have a ArcPy script to calculate Moran's I several times (50 to be precise). However, I am not interested in the Moran's I value, what I need is the z-score returned by the tool. Even though the ...
4
votes
1answer
91 views

How to return text from GP service?

So I've got a website that I want to extend by letting people look up postal/zip codes for an address they enter. I've already got all the addresses (with their postal codes) for the city in an ...
1
vote
1answer
180 views

Arcpy Update Cursor error [duplicate]

I'm trying to take a field calculator equation and do it in arcpy directly through IDLE, but am running into a problem where the process runs correctly, but the results in the field show up as 0. I've ...
45
votes
6answers
3k views

When to use ModelBuilder over Python scripting and vice versa?

I am new to Python scripting in ArcGIS but not new to ModelBuilder. I would like to know the benefits of Python vs ModelBuilder. When should we write Python script for GIS automation rather than ...
2
votes
2answers
1k views

Possible to add multiple fields in single arcpy statement?

I'm trying to add multiple fields to a table using arcpy and am wondering if it's possible to have multiple fields declared in the AddField management, and their values, separated by commas or ...
2
votes
2answers
223 views

Arcpy how to conduct addition in a script, function needed?

I'm trying to work on my first arcpy script and am running into some troubles. The objective is to create a new field, check several existing fields (Cnt1,2,3 and Pop1,2,3) for missing data (-99 ...
1
vote
2answers
530 views

SearchCursor (arcpy.da), accessing data on joined tables

Can you access joined tables through a da.SearchCursor? I've found documentation to do this with SearchCursor (arcpy), but nothing for the 10.1 data access module.
5
votes
1answer
574 views

Using ArcPy to batch merge based on shapefile name?

ArcGIS 10 SP4 Python 2.6.5 I have quite a few shapefiles that are in many different directories. I'd like to pull out groups of like shapefiles, merge them, and move the results into a FGDB. I've ...
1
vote
0answers
248 views

Why does a geoprocessing service fail every other time it is run?

I have a ArcGIS Server 10 geoprocessing service right now that takes in a string and runs a parameterized query to SQL Server 2008R2 through pyodbc. The service works, but only every other time. I can ...
3
votes
3answers
773 views

SearchCursor() fails to read feature class

First of all, I would like to apologize if this problem is trivial for you guys since I am very new to ArcPy and Python in general. I want write a script to read attribute table from a feature class ...
11
votes
1answer
420 views

Teaching Python to Land Surveyors

Does anyone have any good examples of using Python to automate or simplify common surveying tasks? I'm teaching a Python/ArcPy lab this week for a GIS class. There are a number of surveying ...
13
votes
1answer
734 views

How can I utilize NumPy arrays to optimize big data geoprocessing?

I'm interested in learning how to utilize NumPy arrays to optimize geoprocessing. Much of my work involves "big data", where geoprocessing often takes days to accomplish certain tasks. Needless to ...
-2
votes
1answer
193 views

How to write Process Dialog log information to text file in ArcGIS?

I have created a custom model. When this model is run, it shows a process dialog which has some log information. I want to write that log information into the text file for further analysis. Does ...
4
votes
1answer
104 views

Arcpy error message: 'Layer' object is not subscriptable?

What the code does successfully so far, is gets a list of the layers in the first data frame of the current map. What it doesn't succeed in doing is, joining the layer names to the gdb location using ...
2
votes
1answer
231 views

Calculate field result is float with Arc tool, integer with arcpy script

I am trying to calculate a field for some points within a python script using arcpy functions. (This is calculating the percentage visibility from a cumulative viewshed, if that matters.) # Process: ...
1
vote
0answers
198 views

Why does Clip analysis generate (some) empty output?

I am running a script that is working (see below) - it pulls a file from a folder, clips from that file based on an intersection with another file, and creates a new shapefile in a new folder. It has ...
2
votes
1answer
396 views

Why might Python Script be Crashing Inconsistently on ArcPy Batch LayerToKML script?

I put together a script to take a TIGER shapefile of all census tracts in a state, select the census tracts by each county, and export them into individual county-level kml files. The problem is that ...
1
vote
1answer
177 views

Database Connections folder is empty when viewed with ArcGIS tool

I'm trying to create an ArcGIS tool which accepts an SDE connection file as an input. I made a new interface with an input parameter and set the type to Database Connections. When I open the tool and ...
5
votes
3answers
4k views

Why can't I import arcpy?

>>> import arcpy Traceback (most recent call last): File "<interactive input>", line 1, in <module> File "C:\Python27\lib\arcpy\__init__.py", line 21, in <module> ...
1
vote
0answers
174 views

arcpy ArcGIS Server

Could someone please help me by giving me an example on how to make/connect/Add ArcGIS Server connection via python/arcpy? Thank you in advance. I'm using ArcMap 10.0 I desire to "Use GIS Services" ...
4
votes
2answers
354 views

Python Script to convert a mass of KMLs to a single fGDB

I have a mass of KML files, approx 350+ that I need in a single fGDB. I lifted a string of code from ESRI help to attempt to do this - I got it working to the point of creating all the individual ...
4
votes
1answer
1k views

Cast arcpy result as an integer instead (arcpy.GetCount_management)

I am trying to get a number by counting how many points are in a shapefile. And this works (I think), except I then am running into trouble using that number somewhere else. Eventually, I'll be using ...
0
votes
1answer
85 views

SpatialJoin with “closest” option ok in python script but not when in arcmap toolbox

I have the following problem. I want to create a toolbox to obtain the distance between a polygon (Bldg.shp) and a point (pts.shp). I have started with a simple following python script: import arcpy ...
1
vote
3answers
525 views

How to create a spatial reference file

I am using python, arctoolbox and arcpy 10.0 I am running a script that is tied to an arctoolbox. The toolbox serves to enter in my parameters. I have a feature layer as an input. The feature layer ...
1
vote
1answer
227 views

ArcPy error: Add Feature Class to Terrain. [closed]

I'm writing a script to convert lidar data (in .las format) into a terrain without going through all the clicking and so I can send it out to neighboring states with similar programs (I'm using ArcGIS ...
0
votes
2answers
710 views

Execute multiple process in parallel of Arcpy script

I have seen some difficult ways to do parallel processing, but I wonder if it is possible to simply execute multiple process of the same ArcPy script at the same time. My script makes some changes to ...
5
votes
2answers
422 views

ArcMap Arcpy scripts: How to handle user password input?

I'm currently trying to write a script that has a username & password input which then returns some data if the user has appropriate access. The script works just fine when I hardcode my own ...