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

learn more… | top users | synonyms (1)

1
vote
1answer
22 views

ArcPy Label Class object returning unexpected value for expression property?

import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") for lyr in arcpy.mapping.ListLayers(mxd, "TestFile_LineToPoints13_Prod"): if lyr.supports("LABELCLASSES"): for lblclass in ...
1
vote
2answers
110 views

Split a string column into 2 columns in python [closed]

I have a csv file and this is the structure of that file. It has only one column with number of strings. I want to split this one column into 2 columns at the character \. Can anyone please tell me ...
1
vote
1answer
60 views

Conditional drop-down menu list in a python script tool

I have created a script tool from some python code, and in a previous question, I learned how to enable a drop-down list in this tool by changing the Validation code - see link and image below: ...
1
vote
1answer
77 views

List all Feature datasets & feature classes from a single geodatabase into CSV

I have prepared a python code and I got the following errors: "Parsing error IndentationError: expected an indented block (line 11)" and "Runtime error Traceback (most recent call last): ...
-1
votes
2answers
83 views

arcpy.Delete_management(“”) not working

I've written a script in a python toolbox. That script creates a folder in the user defined workspace for all the output files that are created during the script process. When the script is done, I ...
1
vote
2answers
38 views

Script fails when executed from toolbox but not in command window (MakeFeatureLayer)

I am able to run the below code in the Python command window in ArcMap 10.2.1 without issue. However, when I run this as a toolbox script, it fails at line 15: newLyr = ...
1
vote
0answers
50 views

Python coding problem - unicode string passed from dictionary to AddField

I tried all possible hints but I´m still stuck. I want to write a script that can be executed from a toolbox in ArcMap/ArcCatalog. It should rename fields (build lists with old fieldnames, new ...
1
vote
1answer
77 views

Export to SHP with ArcPy with query

I have a shapefile with table with area code (field areacode). How can I export with ArcPy each unique area code so I get a SHP file for each one? It takes too long to select the layer and query ...
0
votes
0answers
40 views

Arcpy Export To PDF exporting same PDF instead of changing

I have been trying to run a loop that would change a layer in an .mxd during each iteration and then export it to a PDF. When I run it, the exported PDFs are all exactly the same as the .mxd in the ...
4
votes
1answer
109 views

Setting up a Drop-Down list in the Parameters of a python script tool from a large list

I am trying to create a tool from a python script I have written that will take a list I have created and use it as a drop-down menu in the finished tool as one of the inputs (see attached image for ...
4
votes
0answers
145 views

Concatenate features in one feature class by the unique ID

Is there a way to concatenate features in ArcGIS by using ArcPy, or field calculator, to produce the following output? I am aware of the concatenate tool that Esri created, however it doesn't keep ...
2
votes
2answers
35 views

Assigning a vector to a field in feature class (UpdateCursor)

I don't know if my mistake is of a general nature. I come from R where it is very easy to store a vector in a matrix column. So now I (new to coding with arcpy) am desperately trying to do the same ...
5
votes
1answer
109 views

Calculate the common area between polygons using python?

I am trying to calculate the common "empty" area between the neighbouring polygons in order to calculate the porosity volume (the red area in the image) My idea was, first to use Convert ...
1
vote
1answer
65 views

ArcPy FieldMappings syntax using Merge tool

I'm working on script that takes several table results from the Zonal Statistics As Table tool and merges them into a single table. When merging I encounter the issue that the exported .dbf files have ...
1
vote
1answer
67 views

Is the MakeFeatureLayer temporary location the same as “in_memory”? [duplicate]

From the ArcGIS Desktop Help: The layer that is created by the tool is temporary and will not persist after the session ends unless the layer is saved to disk or the map document is saved. ...
0
votes
0answers
36 views

ArcPy PointToRaster memory locking error solution?

RasterToPolygon ArcPy tool fails on generated raster (PointToRaster) with large(?) dataset. Not sure the size threshold, but fails on 78559 x 33544 raster, completes on smaller datasets so I know ...
1
vote
1answer
47 views

ArcPy script stops running randomly with no error returned

I am doing a batch watershed and analysis process on 135 points. This script worked great the first time I ran it. Ever since the first time, however, I have had the script stop at random moments. ...
0
votes
1answer
47 views

Can FieldMappings be used to drop all attributes?

We have a script that regularly copies a bunch of feature classes out to shapefiles, keeping only the most important attributes (e.g. customer category) and dropping useless/private information (e.g. ...
1
vote
1answer
58 views

How to print log from FME when run from python script?

I created a Spatial ETL ToolBox in ArcCatalog. When I run the tool from ArcCatalog I see log massages. But when I run this tool from a python script, the logs do not print to the python console. ...
1
vote
1answer
37 views

Programmatically access HTML Popup in Layer Properties ArcGIS 10.2

Is it possible to access HTML Popups (found in layer properties) programmatically in ArcGIS 10.2? I can't find any reference but thought I'd ask to double check.
0
votes
0answers
32 views

What is the most efficient method for deleting row/features from a versioned FC in python?

I'm trying to delete all records from a feature class in SDE and then append new data using python. My dataset is versioned in SDE. I've tried Truncate Table (doesn't work with versioned tables), ...
1
vote
1answer
30 views

Creating fishnet from template feature class using ArcPy?

I can’t use the tool arcpy.CreateFishnet_management because define the parameter “templateExtent” with a shapefile it is not filling automatically the parameters “originCoordinate” and ...
2
votes
3answers
140 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
141 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
9 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
47 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
28 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
50 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
119 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
55 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
110 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
50 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
59 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
87 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
50 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
26 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
78 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
46 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
33 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 ...
2
votes
2answers
130 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
45 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
36 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
38 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
33 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
53 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
77 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
42 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
109 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
75 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
45 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 ...