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

learn more… | top users | synonyms (1)

2
votes
3answers
235 views

How to use ArcPy to Check if Search Cursor Returns Anything

How can I use arcpy to check if a search cursor returns anything and then do something based on the answer. So far I have this and it recognizes the positive - i.e. when i pass the query for 001 it ...
0
votes
1answer
377 views

'List indices must be integers not tuple' Error

I'm using an insert cursor to write rows to a destination feature class where the input Shapefile field names do not match the destination FC names. To accomplish this, I'm trying to use the indices ...
0
votes
1answer
10 views

How do I not specify a CustomerWeightField when scripting CustomerDerivedTA_ba?

When you run the Business Analysis toolbox wizard for creating a Customer Derived Trade area, you have the option of weighting each customer by count or for specifying a field (such as sales or number ...
1
vote
2answers
70 views

Automate Select and Export to PDF using Arcpy Search Cursor

I'm trying to automate a process to select each feature of a feature class one by one, zoom to it and export as pdf. using the code below, the first feature is selected and the pdf is exported, and ...
1
vote
1answer
30 views

Update row with another not None row

I'm working with an attribute table in ArcMap 10.2 where there are some 30 fields mainly consisting of NULL values. I don't want to display to users a table full of NULL values as it'll be difficult ...
1
vote
1answer
114 views

Create a fishnet in a 'for' loop with Arcpy

When running the following script, I get the error saying that I need a value for “origin_coord” and for “y_axis_coord”. So is it not enough to define a template dataset? But how can I fill the ...
2
votes
2answers
189 views

Join Field works in ArcMap but not in Python

I am trying to join a field of values found within a DBF to a multi-polyline shapefile. They share a common field name (filename) and the values found within each are identical. I was able to run Join ...
3
votes
1answer
64 views

Create conditional to check if raster has value

I have a problem with this code: ac = ExtractByMask(raster, "area.shp") arcpy.RasterToPoint_conversion(ac, "point.shp", "VALUE") The problem is that sometimes the raster has no value. (It's a flow ...
5
votes
1answer
116 views

Is it possible to drive one mxd (pan) using a different mxd with python?

I have 2 mxd's. mxdA and mxdB They both show different data, but are both in the same coordinate system. I want to be able to sync mxdB with mxdA, so that if I pan / zoom in mxdA, I can then, with ...
1
vote
2answers
59 views

Why does arcpy.sa.Sample give TypeError: Sample() takes at least 3 arguments (3 given)?

I'm building a script where I'm taking a standardized CSV that one of our data processing packages consistently exports and turns it into a z-aware shp after running through Sample as well. Along the ...
1
vote
0answers
82 views

SQL Prefix for arcpy.da.SearchCursor

Does the sql prefix - DISTINCT work well on SDE tables? http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000011000000 Syntax: SearchCursor (in_table, field_names, {where_clause}, ...
1
vote
2answers
209 views

Concatenating text and string in Field Calculator expression (python)

I'm trying to copy an attribute value from one field to another (sum of raster values), but I'm having issues in writing a functioning expression for a Calculate Field script. I'm adding a field ...
2
votes
1answer
66 views

Python loop with address locator

I was given a list of addresses without any zip codes, and I'm trying to write a python snippet that will loop through a set of possible zip codes and make a set of geocoded shapefiles that I will ...
1
vote
1answer
28 views

Short list of .prj options in .pyt

I'm tasked with creating a .pyt to distribute across our office and field computers (state geological survey) for converting .gpx to features but constraining the choice of projections/datums to seven ...
3
votes
0answers
97 views

How to change text legend orientation from right to left reading with arcpy

I working on mxd with ArcMap 10.2.2 . The default in legend properties-Layout is left to right reading (Marked with a red ellipse) : when it unmarked i get this legend: i want to know if there a ...
1
vote
1answer
66 views

Error on FeatureClass To FeatureClass conversion arcpy

I am currently working on a python script where I am trying to copy selected features into a feature dataset. Basically I have an mxd containing some layers, and for each layer I select features by ...
1
vote
0answers
38 views

How to write in only a file .csv (or .txt) the values contained in several rasters?

I am an beginner in Python programming but I would like to write in only a file .csv (or .txt) the values contained in several rasters. For example, I built several rasters by using a loop. The ...
3
votes
2answers
248 views

Zonal statistics for millions of overlapping polygons

I am running ArcGIS 10.1 with 64-bit GP on Windows 8.1 x64. I want to calculate the zonal statistics of buffer polygons based on parcels and a kernel density raster. The 4.7 million polygons overlap ...
1
vote
1answer
88 views

Syntax error: keyword can't be an expression with the function “Con”?

From How can I reclassify an integer raster to a float raster?, I would like to reclassify an integer raster "cpraster3.tif" to a float raster. For example, I would like to reclassify "Value" = 1 into ...
2
votes
1answer
41 views

Raster statistics along polygon edges

I would like to summarize raster statistics along the edge of each parcel/polygon in a shapefile. For each parcel shown below in yellow, I would like to calculate the average, min and max value of ...
1
vote
1answer
41 views

Python Function for Altering shapefile's attribute datatype

I want to merge a few hundred shapefiles depending on geometry type, which are in several directories and subdirectories. i have written a python script and i am using mainly arcpy for the routines. ...
0
votes
1answer
41 views

Looping Summary Statistics on changing field name

I am trying to calculate summary statistics for a number of shapefiles, which is easy enough, but the field name for each shapefile is different. The field name is identical to the file name if that ...
1
vote
1answer
63 views

Extract Values to Points between rasters and point shapefiles of the same name

I have a task of extracting raster values to point shapefiles, which is simple enough, but only where the raster filename is identical to the shapefile. For example, I have shapefiles "G1", "G2", ...
3
votes
2answers
89 views

Create a buffer with a pre-defined area?

I have a road (line) system and need to create a polygon from it to show the right-of-way area. The right-of-way area is calculated in the field from taking measurements from the road centreline. From ...
1
vote
1answer
48 views

Problem with variable for arcpy.select_analysis whereclause

I have a problem with the whereclause on python for arcpy.Select_analysis. I try to use a variable for condition: for row_stat in rows_stat: % for calculated the variable"maxi" ...
2
votes
3answers
119 views

Randomly shuffle values from a column into a series of new columns in a feature class in ArcGIS for Desktop?

I am trying to run a Monte Carlo simulation on a point feature class. In order to do so, I am trying to take the values from a column of observed data and randomly "shuffle" them between the points ...
2
votes
3answers
84 views

Break down geoprocessing operation (Buffer) into smaller subsets

I have a feature class with 790,000 points (and it is constantly increasing). I need to select some of them (approx. 350,000), and then buffer that selection. Currently, the process runs like this ...
2
votes
1answer
62 views

Cannot read CSV-file from ArcMap

when trying to import a CSV from my hardtrive to my map-document using "add Data"-dialog I get the error "Selected element could not be added to map. Generic error" (or something similar, I am using ...
1
vote
1answer
36 views

Standard SQL with ArcGIS

Is it possible to use Python to run actual standard SQL on an enterprise geo-database? Think about batch deleting, joints, etc moving beyond just the cursor objects in Arcpy. Note that one can ...
1
vote
1answer
56 views

Intersecting two shapefiles from different folders based on their name using scripting in ArcGIS Desktop?

How can i script for intersecting the two shape files from two different folders based on their names? i have two folders which contains the shape files with same name i want to intersect the ...
3
votes
1answer
45 views

Creating individual points from count field in point feature class using ArcGIS for Desktop?

I have a point feature class with a count field associated with each of the points. I would like to create a new feature class where each of the points are duplicated by the value of the count ...
0
votes
1answer
24 views

Detecting Runtime Errors in Arcpy Loops [duplicate]

I am looping over a feature in Arcpy and doing several geoProcessing tasks on each feature/iteration. The loop runs pretty well but crashes on some of the features. I dont really know why but its ...
2
votes
1answer
83 views

Basin numbering according to Pfafstetter Method?

I would like to divide my basin into subbasins and numbers according to the Pfafstetter method. Is there an easy way to implement this in Python using ArcPy? Or are there some freely available ...
0
votes
0answers
55 views

ArcPy loops/cursors faster without background processing?

I am running loops via cursors and raw Python in Arcpy. Within the loop several processes take place, selecting shapefiles and converting to raster, clipping, running euclidean distances, extracting ...
5
votes
1answer
135 views

Pause ArcPy script until feature class lock goes away

My script needs to copy data into a feature class to an SDE geodatabase that might have a lock on it from another application. I shouldn't break the lock (that app has priority over a data update), ...
0
votes
0answers
76 views

Arcpy Table To Table Conversion Error

I am running a script that uses an excel spreadsheet to define and output maps, kinda like my own data driven pages set up. The only input into the tool is the path of the spreadsheet. When I run ...
2
votes
1answer
66 views

Is it possible to create a data frame graphic using arcpy?

I'm interacting with an MXD using arcpy, and wish to create a graphic within a data frame - as with the Draw toolbar when working manually. The GraphicElement page says... The GraphicElement ...
1
vote
1answer
56 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
84 views

How to set workspace from input Feature Class?

How to set workspace from input Feature Class ? is there an attribute of the source GDB for a feature class ? some times the FC is in a dataset and some time it isn't, How can i get the path of source ...
1
vote
1answer
65 views

Calculation of a text value, The value of which is separated by a special character

How can I calculate a text value, the value of which is separated by a special character? For example: dog | duck, I would like to keep the first value: dog or elephant | cat, I want to keep ...
0
votes
1answer
126 views

D8 algorithm to get the flow direction in ArcGIS

I am using ArcGIS 10 for the get the flow direction from DEM. I wonder about the algorithm they have used while calculating flow direction. It is mentioned there that it is using D8 model. D8 model ...
2
votes
1answer
59 views

Intersect shapefile with raster, then determine proportion of each raster value?

Using the arcpy module in Python, I want to find the proportion of each pixel value within the boundary of an overlaying polygon. (The polygon is in a shapefile.) For example, there are 10 possible ...
3
votes
1answer
103 views

ArcPy delete terrain: cannot be deleted

I can't get my ArcPy script to delete a terrain. If it exists, it should be deleted. However it throws an ERROR 000317: {path} cannot be deleted My script is a lot longer than this, but this ...
5
votes
3answers
113 views

Is it possible to calculate statistics across multiple fields in arcpy?

The summary statistics command can be used in arcpy to calculate statistics - this tool runs against a single field, eg: SUM—Adds the total value for the specified field. Is there an ...
0
votes
0answers
27 views

How to make a loop to MakeNetCDF Table View?

I was trying to write a code to extract grid point data from the NetCDF file. I am able to view and save the table data extracted as follow #Import system modules import arcpy # Set local ...
3
votes
1answer
119 views

Using Python Add-In to delete/remove ArcMap layers that are turned off?

I have made a python addin button which removes layers that are turned off in an MXD. The strange thing is that I get different results depending on whether I run the python commands in the python ...
1
vote
0answers
57 views

Creating symbology by category in python?

I'm trying to create a python script that creates color-coded symbology by county for multiple maps with different data. I've never created a layer file for the purposes of symbology before, but I ...
4
votes
1answer
76 views

Arcpy Cell Statistics - maximum number of input rasters

I am running cell statistics in arcpy. Essentially I am summing together a folder of grd files to create a new grd representing their sum This will eventually take place on a folder of 20,000 raster ...
1
vote
1answer
78 views

Model Builder or a python script for pulling SDE data in a single GDB file

Would like to know if Model Builder or a Python Script would be better for pulling dozens of fc from ArcSDE into a single .gdb file ? The tool will need to be run on a regular basis.
3
votes
1answer
35 views

How to find the distance between start of line and start of raster with arcpy/python?

I'am creating a python script tool for ArcGIS Desktop 10.1 to extract profiles. I’m using stack profile to extract values to a table but stack profile only outputs values where the line and raster ...