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

learn more… | top users | synonyms (1)

0
votes
0answers
18 views

Type Error with ArcPy Update Cursor

filter = 'LinkID IS NOT NULL' cur1 = arcpy.UpdateCursor("ODDS_Links", filter) high_id = 0 for row1 in cur1: if high_id < row1.LinkID: high_id = row1.LinkID filter2 = 'LinkID IS NULL' cur2 ...
2
votes
2answers
43 views

How to check whether an optional FeatureSet parameter was set by the user in a geoprocessing script tool?

I have created a custom geoprocessing script tool which contains an optional FeatureSet parameter. When unpacking the parameters in the script, the FeatureSet is defined as a RecordSet object, even ...
1
vote
2answers
34 views

Raster' object is not iterable

I'm trying to calculate the percentage of cell counts in new raster and the new raster is created from an old raster based on the Value > 14. In my code, 1st for loop is for original raster and ...
1
vote
0answers
12 views

Updating records in a table using GetCount and an Update Cursor

What I have is a buffer which is then used to select a number of point features which intersect the polygon. I would like to take that number and add the value to a table. The row where the value will ...
0
votes
1answer
55 views

How to write output from subprocess to disk (using multiprocessing)

This code was developed from another question I posted about how to kill an arcpy tool if it takes longer than a specified time. See How to cancel tool execution in python. Using the multiprocssing ...
0
votes
1answer
13 views

Using TauDem Tools in Python (like Arcpy)?

This may be a completely ignorant question so have some patience. But is it possible to use TauDem tools within an Python (Arcpy) script as per the other tools in ArcGIS? When you look at the help ...
3
votes
4answers
132 views

How to split single address field into 4 fields (House No., Direction, Name, Suffix)

I have to do some massaging of our parcel data to make it usable by a program in sheriff helicopters. The program requires one of the following address formats within the fields: Our addresses are ...
1
vote
1answer
17 views

Using update cursor with list of shapefiles

I'm still pretty new to using cursors. What I'd like to do is create a list of shapefiles. Within those shapefiles I would like to populate a field "NAME" with the shapefile name less the .shp ...
0
votes
1answer
38 views

Updatecursor returns with 'variable not defined'

I am fighting a bit with the cursor function since this morning. Thanks to the help of the people here and some tutorials I found I got this far import arcpy arcpy.env.workspace = ...
2
votes
2answers
88 views

Loop with arcpy.ListFiles

I'm super new on here and have also not much experience with Python but I really like to learn to work with this language. I'm tying to write a script for this: I think I need a for loop instead ...
0
votes
2answers
11 views

Error 000865 when using arcpy.ASCIIToRaster_conversion

I don't know what I'm doing wrong. I always get the error 000865 when using arcpy.ASCIIToRaster_conversion. I'm new and do not have much Python experience right now – so sorry for that. >>> ...
0
votes
3answers
67 views

UpdateCursor 'is not defined' Python

I have several files (shapefiles). Table 1 has only one row with several fields whereas Table 2 has several rows. What I want is to take a value from Table 1 and populate all rows in Table 2. I used a ...
1
vote
2answers
43 views

Set parameter of field from number to string with python

since I realised python is a very useful tool in ArcMap I dont want to do any workarounds anymore. I have a field with is numeric, but I want to perform this calculation in the field calculator on it ...
6
votes
2answers
123 views
+50

Conflict between ArcPy and GDAL/OGR?

TL;DR I can't get an installation free version of GDAL/OGR to work from within ArcMap 10.0. I get an ImportError: DLL load failed on _mod = imp.load_module('_gdal', fp, pathname, description). ...
7
votes
3answers
859 views

How to determine on which side of a line a polygon feature falls?

I have parcel data intersecting line data. In the parcel data there are some parcels that don't intersect the line. How could I programmatically figure out if the non-intersecting parcel is on the ...
-1
votes
0answers
16 views

How to Add Polyline ID when it is created from points pair coordinates with arcpy?

The following link provide me the solution except i need to add Line ID from "Line_ID" field in same Excel. I could not make comment directly on that link to "Chad Cooper" as I am a new user here: How ...
5
votes
2answers
4k views

How to clip a vector feature to the extent of an existing raster dataset using arcpy

I have a clipped raster dataset with polylines (from the contour tool) overlayed (see attached). I am trying to clip the polylines to the extent of the raster dataset, which seems simple enough, but ...
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 ...
2
votes
1answer
33 views

Using get count with if statment

Pretty simple question though I am struggling with how to operationalize this, I want to rename a shapefile based on the number of features it contains. My initial thoughts are that I would need to ...
0
votes
3answers
370 views

arcgis python attribute error, object has no attribute [on hold]

So I am very new to python and working through my first online course. Does anyone know how I can fix this error: ...
1
vote
1answer
30 views

Import arcpy using PyScripter or IDLE gives No module named RuntimeError?

I'm trying to figure out this problem. Yesterday I installed PyScripter and since then, scripts doesn't work. When I run any script (in PyScripter or IDLE) which uses "import arcpy", I get this error ...
4
votes
2answers
69 views

ArcGIS Toolbox, parameters for python script not as positional arguments

I have an ArcGIS Toolbox with a bunch of parameters. A python script is used to perform some raster operations, based on this parameters. I am using Python argparse in the script to get the ...
4
votes
1answer
91 views

How to cancel tool execution in python

I've written a python function that calls a tool (Import CAD to GDB) in a loop. When I run it I have seen that it hangs sometimes, and I have to force the script to quit. I am wondering if there is a ...
0
votes
1answer
12 views

Understanding arcpy.Describe IOError?

I am trying to find out if an mxd contains any schematic diagram layer through a python script tool. I am looping through all the mxds those are added to the python script tool and in each mxd ...
1
vote
1answer
52 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 ...
3
votes
2answers
31 views

ArcPy Data Access Insert Cursor not writing geometries to feature class?

I'm running ArcGIS 10.2.1 and am having troubles with the Insert Cursor in the arcpy module. I have an empty feature class in my geodatabase and have created the short script below to try and find the ...
1
vote
2answers
74 views

How to merge dbf files(zonal statistics as a table) in GIS environment.?

I am not very savvy at using Python. Actually I have around 1000 output files from using the tool zonal statistics as table in ArcGIS. The names of the files are jan_60, feb_60......dec_13. These all ...
4
votes
5answers
319 views

Dissolving polygons fails on computers with small amount of RAM

When I'm trying to dissolve a polygon through an arcpy script the operation fails with the 999999 error on computers with small amount of RAM [~3 GB] (known issue). Unfortunately neither this, that ...
0
votes
1answer
405 views

ArcPy SelectLayerByAttribute Error and how to control GP output layer name

I have a rather long script that first references an SDE feature class (non-versioned) to perform an attribute selection based on a SQL selection. I've been unable to figure out why the script will ...
0
votes
0answers
32 views

Fileinput error - input already in use [on hold]

I have a short script I'm using to create a feature class and then populate from a text file to create a polygon. I can create the fc ok but it hangs up on the latter part of the script with the ...
0
votes
1answer
32 views

Split a line from point but with a certain distance [duplicate]

I am using ArcGIS 10.2. I need some suggestion about this problem, maybe there is a certain tool, but I think no. I think some python code... but I do not know from where to start :( I have two ...
5
votes
1answer
2k views

Exporting map to jpg (multiple times with python)?

I set symbology and exported each raster in my mxd (one by one) to jpg file. My script is ok and it works (it is shown at the bottom). The question is: how can I customly set my legend? Now I have ...
2
votes
1answer
29 views

ArcGIS Spatial Statistics: Distance to 3rd/4th/5th closest feature

We have an algorithm which requires us to produce a score based on the distance from any given cell in an output raster to a score calculated from the distances of the 3rd closest, 4th closest, and ...
2
votes
3answers
101 views

Iterating using search cursor and layer selection performance?

I'm trying to use the results of a search cursor to iteratively make selections on a feature class and then create new feature classes (so you get a new feature class or shp for each unique value in a ...
0
votes
1answer
31 views

How to create polygon feature class from UTM coordinates?

I am working to create a polygon from UTM coordinates. The script I am using fails with a "must be a sequence, not float" error: Traceback (most recent call last): File "F:/sample/clipTiles.py", ...
0
votes
1answer
130 views

Dissolve multiple rows straight into one layer and add OIDs into table

I am currently running this script to direct multiple dissolves of a polygon layer FC = "BLPUsCavPlace" TABLE = "BLPUsCavPlaceContigBLPUs" FIELDS = ["blpuid", "contigid"] with ...
1
vote
2answers
31 views

How to find the minimum pixel value within a region of interest?

I am working on a Python script for dark object subtraction, a radiometric correction method for remotely sensed data.To accomplish this, I need to find the minimum band pixel value of a waterbody ...
3
votes
1answer
176 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 ...
2
votes
1answer
84 views

ArcPy Clip Data Frame To Geometry

I have made an ArcPy add-in that assists a user by adding layers from a nominated fGDB to their map based on a nominated extent. I wish to add a button that changes the data frame properties to clip ...
0
votes
2answers
31 views

Export Raster Data to TIFF, BMP, or PNG File Using Python

I am writing a Python script to export a Raster Dataset to a TIFF, BMP, or PNG file, as I would manually by right-clicking on the layer, choosing Data | Export Data, and then make my choices in the ...
1
vote
0answers
19 views

arcpy fieldmappings: can't set output field name for fieldmap

I am testing out some code in the Python window of ArcGIS so that I can insert it into a standalone script later. I want to create a copy of a table and add a new field that is the result of ...
2
votes
1answer
71 views

How would I group values in a field based on range of number using python, and then update the attribute table?

An example of what I'm trying to accomplish is described below, however they don't describe how to use the data update cursor to update the attribute column. data - Group values based on range of ...
3
votes
1answer
911 views

insert cursor “Row contains a bad value”

I'm having a problem copying data from a shapefile to a feature class using an insert cursor. Here is the part that is causing trouble: newRows = arcpy.InsertCursor(Target) sourceRows = ...
0
votes
1answer
47 views

ArcPy script error - NoneType object has no attribute X

I'm familiarising myself with using scripting in ArcMap 10.2 and as part of this I'm using the following to extract vertices from some polygons. ... ... import arcpy ... from arcpy import env ... ...
1
vote
1answer
40 views

Calculating fields using a list of features

I've written some basic code which creates a new .dbf and adds two fields to it: 1 for today's date, another which should contain the names of shapefiles located in another folder. What I'd like to do ...
0
votes
1answer
60 views

Summing column values in table using arcgisscripting?

I need to create a python script that sums a column's values in a table. Thereafter, the script is supposed to get the percentage of each individual row in that column and populate this percentage ...
0
votes
1answer
26 views

List index out of range error

I've been writing a script that clips large datasets based on a selected feature. It works fine when I run it in a test workspace where only related layers are active and running. However, when I run ...
10
votes
2answers
517 views

Is there a compelling case to learn/use Python Toolboxes (new at ArcGIS 10.1) over Python Script Tools?

I've written a few Python Toolboxes (which are new at ArcGIS 10.1), but am yet to decide whether/when I should write them rather than Python Script Tools in a standard toolbox. I thought the Online ...
1
vote
1answer
163 views

Select a single entry using SearchCursor and create variable

I am trying to select a single entry of a floating point entry in a dbf table that contains 9 entries (sampled from a raster image), some of which is NULL using SearchCursor. I want to select one of ...
0
votes
1answer
29 views

sum of raster counts

I'm trying to get the sum of "counts" in a raster. I have the code below which can successfully read the counts of each row in raster attribute and stores the counts in a list provided below. ...