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

learn more… | top users | synonyms (1)

0
votes
1answer
14 views

Batch Mosaic Rasters: arcpy.MosaicToNewRaster_management (ERROR 000628: Cannot set input into parameter coordinate_system_for_the_raster)

I am trying to batch mosaic rasters using arcpy.MosaicToNewRaster_management in arcpy: #This is for mosaicking a lot of rasters import arcpy from arcpy import env ...
-1
votes
0answers
26 views

Using ArcPy to display result shapefile with layer symbology?

I am using an ArcPy script, and everything is working perfectly except the display of the result shapefile file. What is the best solution to display the result? In the end I would like to share ...
0
votes
0answers
34 views

Creating a custom toolbox and python script to analyze fire data

My goal is to create both an ArcGIS toolbox and an independent python script to do the analysis of fire occurence in the Southwest (by season) through ArcMap as well as independently with python. I ...
0
votes
1answer
23 views

Failed to execute (RastertoPolygon) Syntax error at or near symbol SPACE

I'm converting series of raster to polygon using RastertoPolygon in arcpy. #import the module import arcpy from arcpy.sa import * from arcpy import env arcpy.CheckOutExtension("Spatial") ...
1
vote
2answers
31 views

How to generate random points from FIDs using ArcPy or ArcGIS Field Calculator?

I'm trying to generate a shapefile of random points using FID from the attribute table. My attribute table has 800,000 features and I only need a sample of 240. Is there a way to do it in arcpy or in ...
-2
votes
0answers
42 views

Installing ArcPy on Mac?

I want to use an answer from Batch shapefile merge, with adding and calculating field to create a merge of 50 shapefiles but I only have a Mac. Is there a way to install ArcPy on my Mac so I can ...
2
votes
0answers
24 views

Scripting Address Coder actions in ArcPy?

I am currently using ArcGIS 10.3 for Desktop that comes with the "Address Coder" tool. This tool has some features that I need as part of my geocoding requirements: in specific, the option to append ...
1
vote
1answer
37 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 ...
2
votes
4answers
162 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
52 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
17 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
27 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
2answers
32 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
22 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
40 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
62 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
31 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
42 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
19 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
22 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
39 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
32 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
39 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 ...
1
vote
1answer
60 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
95 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
14 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
22 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 ...
0
votes
1answer
24 views

When using “arcpy.gp.Int_sa” in Arcmap 10.1, what do I need to import?

My Arcpy code is not working 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 error. It ...
0
votes
1answer
89 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
38 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
19 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
23 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
30 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 ...
-2
votes
0answers
12 views

Cannot assign name to resultant terrain using ArcPy so cannot save result? (posted again) [duplicate]

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 ...
1
vote
0answers
14 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
22 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 ...
-1
votes
0answers
40 views

Add layer label using ArcPy

I want to show 'ID' of each polygon in a shapefile using arcpy in data view mode. It should be fairly simple but not been able to figure it out. Any lead would be helpful. mxd = ...
0
votes
0answers
35 views

Why do Python scripts on scheduled task fail intermittently with various exceptions? [on hold]

I have several Python scripts which are set on a task scheduler to run around 7 or 8 times a day between the hours of 1:30PM-5:30PM every half hour. The output from the script is an email with the ...
0
votes
1answer
32 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
23 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
45 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
30 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
113 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
19 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
45 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
20 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
17 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
20 views

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

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
25 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
0answers
10 views

How enable on demand caching in map service publised with arcpy?

I have created a cached service publishing script. I create the cache using the arcpy.CreateMapServerCache_server tool and then the arcpy.ManageMapServerCacheTiles_server. I want to enable on demand ...