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

learn more… | top users | synonyms (1)

1
vote
1answer
55 views

Add and Calculate Field in Table with ArcPy?

I have written the following script to iterate it as a tool for all my tables with ModelBuilder, but i have a problem wth my codeblock. I want to add a field FID to all my tables and to add the values ...
3
votes
4answers
196 views

Removing first and third zeros of a fieldname in label expression

The fieldname only has three characters. I dont want to display zeros in the first and third values. example below. 010 = 1 100 = 10 01Y = 1Y 10Y = 10Y I have figured out how to strip out zeros ...
1
vote
2answers
69 views

How do I tell if arcpy is installed?

I have a user that recently received a new machine with a fresh install of 10.2. We have a python / arcpy application that worked in 10.1 on the old machine but does not work on the new machine with ...
0
votes
1answer
34 views

How does GIS detect the error causing field in “ExecuteError: ERROR 001156”

I always get all types of errors, and would like to know if i can use the information in these error messages generated by arcpy to fix the issue and repeat the step where it occurred. for example in ...
0
votes
1answer
52 views

How can I add a custom toolbox to ArcMap, and see its script?

I'd like to add a custom toolbox to ArcMap, and also see the script it's written in. To do the latter, I'm trying to open it with my python editor, but it doesn't open it.
2
votes
3answers
48 views

Skipping an iteration in modelbuilder

So I've been assigned to clean up someone else's model. Here's the situation. The model is supposed to iterate over a few hundred folders containing feature classes and convert the contents into ...
1
vote
1answer
30 views

ArcGIS 10 ToolValidator - Empty feature class and feature class within declared feature dataset

I'm new to ToolValidator for a script tool and I'd like to make two checks which then adds an error if either rule is violated. I need to make sure parameter 2 and 3 (feature classes) are within ...
0
votes
1answer
52 views

Batch merging field mapping

I made the following script to merge shape files of different format types (poly,line, points): def main(): import arcpy from arcpy import env import globalpath import os ...
2
votes
4answers
71 views

How to create new feature classes from rows in a polygon feature class

I'm trying really hard here to get an arcpy equivalent for ARCGIS' ModelBuilder's Iterate Feature Selection. I need to export the individual polygon rows in a feature class as new feature classes. ...
0
votes
1answer
43 views

AttributeError: __exit__ when trying to use arcpy.UpdateCursor

I'm trying to populate a field from values of an existing field in a feature class using arcpy.UpdateCursor. I'm getting this error: AttributeError: __exit__ Here's the chunk of code I'm ...
0
votes
0answers
45 views

Why do I get 0 with calculate field in my script?

My Script: #Define parameters input = sys.argv[1] major_axis = sys.argv[2] minor_axis = sys.argv[3] azimuth = sys.argv[4] #Add XY to point data arcpy.AddXY_management(input) #Add major axis, minor ...
1
vote
1answer
23 views

Multiply two lists of raster from two subfolder

I have two subfolders, which contains rasters for each country but which express different variables. I am trying to figure out a way to Loop a multiplication of each raster into a folder with its ...
0
votes
0answers
38 views

Error 000192 in Make VRP with Python scripting in ArcGIS 10.3

I've written a piece of python code in ArcGIS 10.3 for applying VRP. pretty similar to sample code in Esri resource website. But, it gives an error: ERROR 000192: Invalid value for Time Impedance I ...
2
votes
2answers
50 views

Reading next row of *.txt column inside ArcPy for loop for batch process?

I'm not sure how to approach this problem with python, but in plain english, I'd like to rename rasters with the names given in the *.txt file (see screenshot) and concatenate the basename given by ...
0
votes
2answers
48 views

How do I change the color and trasnparency of a layer using arcpy?

I would like to create an arcpy script to change the color and transparency of a collection of layers. The color and transparency would be based on wildcards such as "_dog" or "_chicken". The layer ...
0
votes
1answer
65 views

UnicodeDecodeError: 'utf8' codec- arcpy

I work with arcmap 10.3 and python 2.7.8. I have more than 500 shapefiles that located in many folders and subFolders. All Sub Folders are located in one large directory. I try with arcpy to detect ...
2
votes
1answer
83 views

Simple Folder to folder batch python script

I am writing script to take shape files from a folder to Buffer it to given distance to Output folder with same name as input files. Here are block of codes. # Name: Buffer_multiple file.py # Usage : ...
0
votes
1answer
110 views

Using Python function in ArcPy script?

I have an script to transform DN into Reflectance of each band of several images. The unique variable of the equation, apart of the Band itself, is the Divisor: (B1 - 1) / 508 (B2 - 1) / 254 (B3 - ...
0
votes
1answer
16 views

Auto adding map elements using ArcPy? [closed]

I am very new with Python scripting in ArcGIS Desktop. Just wondering if there is a way to auto add in map elements?
0
votes
1answer
27 views

Valid input for ArcPy raster to polygon in 10.1?

I'm experiencing some strange problems with this code starting from files with *.tif.tif to what seems should be *.tif.tif.shp according to the code. The code is not working because of the ...
-1
votes
1answer
33 views

Using arcpy.gp.Int_sa in ArcMap gives Error 000824: The tool is not licensed?

My Arcpy code is not working in ArcMap 10.1 because an error with the last line: Error 000824: The tool is not licensed. I have all my extensions turned on, so I don't know why I would be getting this ...
1
vote
1answer
107 views

Using Python script tool in ModelBuilder?

i have created the following tool to add two fields in a table and do a calculation in order to put the tool to ModelBuilder. For some reason when i am going to put it as an input in an another tool ...
0
votes
2answers
42 views

Geoprocessing tool default path access every one?

I am using Geoprocessing tools i have face one problem with default gdb access in my system (default gdb means C:\Documents and Settings\\My Documents\ArcGIS\Default.gdb ) how can access different ...
0
votes
1answer
37 views

Debugging AttributeError: 'Result' object has no attribute 'save' from ArcPy script?

I Keep getting this error message when i run the code below, can anyone tell me why? Error message: Traceback (most recent call last): File ...
1
vote
1answer
49 views

How apply error messages to a python toolbox that prevent my tool from running with bad parameters?

This is a continuation of my question here: Point and Polyline I tried making this question easier to follow. My tool accepts two main parameters - a continuous centerline and a table (or a feature ...
-1
votes
1answer
38 views

I want to reclassify a raster in one folder, rename it and put it in new folder using Python

I've been combing stack exchange and I cannot figure it out. I have a raster "slope_tif_18TXK030910", I want to reclassify it, rename it and put it into a new folder. this is what I have and it works ...
1
vote
0answers
21 views

ArcPy arcpy.gp.ExportMapServerCache invokes error: A secure connection with this site cannot be verified

What worked last week on many computers no longer works this week. My great ArcPy script gets a users current display extent and invokes gp.ExportMapServerCache to copy a web cache locally. It was ...
0
votes
0answers
44 views

UpdateLayer & ApplySymbologyFromLayer_management doesn't seem to be working

I have been trying to update the symbology of my raster layer file but nothing is happening. I don't get any error messages from using updateLayer or ApplySymbologyFromLayer. It also printed ...
0
votes
1answer
33 views

Populating an attribute inside a loop

New to python scripting. One of the issues I have been working on is trying to get a script to calculate the elevation gained in each stream section based on a single input and the knowledge of the ...
1
vote
1answer
29 views

Loop through multi-input list/selection?

I'm back with a script I've previously posted about that I'm constantly improving. Below is a working script that is connected to a database with 52 feature classes on a server that, when having user ...
0
votes
1answer
84 views

pythonaddins module

I've posted this question on GeoNet 4 days ago. At the moment I've received no answers and no comments so I thought I'd try here as well. https://geonet.esri.com/activity#nPLoc=/inbox I have a tool ...
0
votes
1answer
43 views

How to convert date field value returned by REST API to correct date? [closed]

I performed a query on this USGS feature service of Airport locations: Click for query And the value for the field LOADDATE is: LOADDATE: 1411380301000 However, when I pull the layer into ArcMap, ...
2
votes
1answer
138 views

Using Python to select random location from shapefile?

I have multiple shapefiles with bars names and location attributes and I want to create a script which asks the user for the area or shapefile name where they want to go and then prints a random ...
2
votes
1answer
22 views

Creating PolylineZ in arcpy

The script below is slightly modified "Polyline example" from ArcGIS help http://resources.arcgis.com/en/help/main/10.1/index.html#//018z00000008000000 import arcpy # next 3 lines are new from arcpy ...
0
votes
1answer
56 views

How to get arcpy to access attributes of a geometry?

As a novice python programmer I am struggling mightily with my code. What it is supposed to do is Buffer a bunch of points with four distances (100, 200, 300, 400meters) Calculate zonal sum for ...
0
votes
1answer
36 views

Batch reclassifying rasters in folder using ArcPy?

I am very new to python. I am using ArcGIS 10.0. I am trying to batch reclassify rasters in a folder and put the outputs into the same folder but with a new name(trying to do this using outputPrefix). ...
-1
votes
1answer
24 views

Load multiple layers into multiple maps - python

import arcpy import arcpy.mapping import os import sys from arcpy import env #import string env.workspace = r"G:\GIS" mxds = arcpy.ListFiles("*.mxd") lyrs = arcpy.ListFiles("*.lyr") for maps in ...
2
votes
0answers
31 views

Converting points using FeatureClassToNumPyArray to interpolate cross-section with scipy “interpolate” [closed]

I'm trying to plot elevation cross section and extract elevations along a cross section using scipy's "interpolate" function. I'm converting a point feature class of profile elevation points to 2 ...
-2
votes
1answer
37 views

Python Graduated Symbols [closed]

I am currently struggling with creating graduated symbols via Python. Based on ArcGISHelp 10.1 - GraduatedSymbolsSymbology (arcpy.mapping) I am doing as follows: import arcpy mxd = ...
0
votes
2answers
40 views

Simple text Field Calculation In Arcpy [duplicate]

the function is very simple: arcpy.CalculateField_management (fc, "DFDD", "aaa", "PYTHON") and I want to calculate DHDD field with simple text "aaa", but I get error: name 'aaa' is not defined. ...
0
votes
1answer
24 views

Stacked with “expected a raster or layer name” error

I am using the following python script snippet but I get a TypeError: expected a raster or layer name on the commented line below. I could not find a solution about how to convert the A1 raster (that ...
1
vote
2answers
45 views

Check shape orientation

I have a shapefile with many minimum bounding box (envelope) polygons and I need to find out, if the boxes are rather landscape or portrait format. (See pic below, one of the selected boxes should be ...
3
votes
1answer
73 views

Using arcpy to find geometry within another feature

In Arcpy, I would like to start with a point and then using its geometry method to find out if it is inside my polygon feature (Urban Areas) deeper than the buffer distance. This is a follow up to ...
0
votes
1answer
25 views

How to Print the Labels of a Unique Value Classification Using ArcPy? 10.2

I have a layer where I have symbolized the features on unique values. I have also grouped several features together. EX) Layer: Land Use; Value Field: Type of Land Use; Unique Values of different park ...
1
vote
1answer
45 views

arcpy.da.Editor undoOperation(): does it actually work

Ok, so I have looked over the ESRI documentation thoroughly and I'm still baffled by the arcpy data access module and the function undo operation. So far I have tried: workspace = pathtofile ...
3
votes
2answers
71 views

Accumulated value from many rasters python/arcgis10

I need to calculate an accumulated value of temperature (as an additional raster) from many rasters. Is there any option to do this in ArcGIS 10 or any hints for a python script?
0
votes
0answers
22 views

ArcGIS Server throws an exception

I have a script in Python, that works well when I ran it in ArcMap. When I tried to execute it in ArcGIS Server as a service I got error this error: Failed to execute. Parameters are not valid.  ...
0
votes
0answers
43 views

Cannot assign name to resultant terrain using ArcPy so cannot save result?

Question of python in ArcGIS: I can not assign a name to the resultant terrain, thus I can not save the result. I'm new to arcpy. By a piece of script using SetNull() in Raster Calculator, I want to ...
0
votes
1answer
37 views

Arcpy to append results of pivot table

Good Day All, So I have a script that does some processing but the main part are two things run a multiple ring buffer using arcpy.MultipleRingBuffer_analysis and four rings do some zonal ...
3
votes
2answers
121 views

Efficient ways to read table data from a large feature layer?

I have a feature layer that contains about 460,000 records and it currently takes about 20 minutes to read that table using the arcpy.da.TableToNumPyArray() tool. Is there a more efficient way to read ...