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

learn more… | top users | synonyms (1)

5
votes
2answers
831 views

Making Buffer like Offset in ArcPy?

I would like to make a buffer for a polyline and get as Output a Polygon with the same angles as the polyline, having not arcs, like in ordinary buffers. i tried the FLAT option in ArcPy, but it's ...
3
votes
1answer
77 views

Is there a quick way to see the fields in a table via arcpy?

I frequently find myself in Python debug mode, trying to examine the fields of a layer or table. arcpy.Describe(lyr).fields returns an array of <geoprocessing describe field object> which isn't ...
2
votes
3answers
37 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 ...
2
votes
2answers
131 views

Script to buffer 2 shapefiles within each folder of root folder?

I need some help with ArcGIS python script My folder tree is like this: /Testing location C1 POIS.shp STREETS.shp C2 etc, etc I'm trying to make a script to run from arcgis that would ...
1
vote
0answers
209 views

Composite bands produces a single band image

Running this produces a single band tif and not a three band image. Has anyone seen this before or can suggest ways to trouble shoot it? Input_Rasters = path + parentdir + "/" + dir + "/" + ...
1
vote
1answer
124 views

Python Stand Alone ArcGIS toolbox output feature class becomes input feature class within same tool?

Developing a script in toolbox. I have a table that I use to make X Y layer (input 1) I am saving that created layer as a point feature class. (output 1) I then want to run kriging on that newly ...
0
votes
0answers
12 views

How to publish the Manage map server cache tile (Server) tool as an arcGis geoprocessing service?

I need to publish the Manage map server cache tile on the arcgis server as a geoprocessing service. As a result I will be able to update the tiles of a tiled service through a service call. I face ...
0
votes
0answers
6 views

Problem with schema synchronization using Import Replica Schema (Data Management)

I want to synchronize the schema of replica. The steps I am following is documented in ArcGIS Resources: Export the geodatabase_1 replica schema using Export Replica Schema (Data Management) tool. ...
0
votes
1answer
149 views

How to automatically generate least-cost paths between several polygons?

What is the fastest way to automatically generate least-cost paths (LCPs) between several polygons with ArcGIS ? I created a python program to do this by using the functions "CostDistance" and ...
1
vote
1answer
40 views

gdal RasterizeLayer gives different extent to arcpy PolygonToRaster

I have an existing arcpy script which uses PolygonToRaster_conversion to convert a polygon shapefile to raster (tiff). I am now exploring GDAL/OGR and have used the cookbook approach to carry out the ...
1
vote
2answers
47 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
2answers
129 views

Python Script tools for ArcGIS 10.2 is very slow (get raster properties)

I am using python script tools for ArcGIS 10.2, under Windows 8.1 64bit. When I am using the arcpy.GetRasterProperties_management() command, it's very slow to process the data. For example. I tried ...
2
votes
1answer
139 views

Choosing specific ArcSDE version to create replica geodatabase from?

I'm trying to automate the process of exporting a replica geodatabase using the geoprocessing tools and eventually a Python script. I can't figure out how to create the replica from a specific ...
-3
votes
0answers
85 views

Getting value from arcpy.GetParameterAsText?

I have a point shapefile with the following columns mosaic hypo result condition 2000 1700 1500 1000 980 . . AND i want to write a script that will do the following: ...
2
votes
1answer
196 views

Is it possible to run a search cursor on a multipart feature class?

I have a multipart feature class of cities. I want to run a search cursor on a cities feature class where: one city is selected and a select layer by location is run to select all parcels that are ...
0
votes
1answer
54 views

How to automate ArcGIS map production using Python?

I have this layout; it's a map that I divided it to 25 parts using FISHNET from arctoolbox. I want to prepare only one layout and then using a Python script I want to be able to automate the ...
1
vote
1answer
56 views

Print webmap to geospatial pdf

I am looking for a solution for this with no success using: result = arcpy.mapping.ConvertWebMapToMapDocument(Web_Map_as_JSON, templateMxd) AND arcpy.mapping.ExportToPDF(mxd, Output_File, ...
1
vote
1answer
44 views

How do you use Windows folders as acrpy Parameters

I am having problems trying to perform simple folder management operations in an ArcGIS python toolbox. First here's some code snippets (I have left out all of the stuff that does not pertain to this ...
0
votes
0answers
21 views

Find the next number within field [duplicate]

I have a massive point feature class with a string field of a unique value. The string has 2 unique letters and 5 numbers starting at 00001. Every time a point is added I need to find the last number ...
2
votes
2answers
741 views

Clip_management to raster extent outputs larger raster than raster extent

Using Python and ArcMap 10.0 SP5, I'm trying to reproject and clip a large input raster to exactly the same grid as a smaller target raster (same extent, pixel sizes and projection). The problem is ...
0
votes
1answer
15 views

Repairing a broken data source for a single layer in multiple map documents

I am a Python newbie and I'm trying to repair the data source for an aerial raster in close to 50 individual map documents. My supervisor deleted the 2014 recently and uploaded the 2015 in its ...
0
votes
1answer
23 views

Re-Calculating Rows in File GDB Feature Classes

I run the script that I created below, but when it is completed and I check the FC tables, nothing has changed. The script iterates through each feature class of a database and then iterates through ...
1
vote
1answer
24 views

why there is no attribute like 'GetNAClassNames' in my arcpy

I want to do a network analysis, when I want to load a layer as a barrier using arcpy.na.GetNAClassNames, the message is like this: AttributeError: 'module' object has no attribute 'GetNAClassNames' ...
0
votes
1answer
22 views

ERROR 000157: Input and target dataset should have the same number of bands. Failed to execute (MosaicToNewRaster)

This is just a continuation of my former post:Batch Mosaic Rasters: arcpy.MosaicToNewRaster_management (ERROR 000628: Cannot set input into parameter coordinate_system_for_the_raster) --where I batch ...
1
vote
0answers
35 views

ESRI arcpy - Automating the creation of a ServiceDefinition from a python toolbox - missing data

Summary: I can create a ServiceDefinition through ArcCatalog or ArcMap, but when I try to generate the ServiceDefinition through python, it does not copy the /data folder with it, thus the script ...
0
votes
1answer
19 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 ...
3
votes
1answer
218 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 ...
0
votes
1answer
38 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") ...
3
votes
1answer
698 views

How to access all mxd files in a folder?

I'm a beginner to Python and am trying to figure out how I can access several mxds in a folder. For example, when I want to use the AnalyzeforMSD function in ArcGIS: import arcpy mxd = ...
2
votes
1answer
203 views

How to add Oracle database connection to AnalyzeforMSD script?

I use this script right now: import os, arcpy directory = r"C:\Project" for root, dirs, files in os.walk(directory): for myFile in files: fileExt = os.path.splitext(myFile)[1] if (fileExt ...
-1
votes
0answers
30 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 ...
3
votes
0answers
51 views

Field Calculator convert text to integer then populate new field with sum [on hold]

I have a .dbf with about 50 text fields containing numerals, I would like to convert those to integers and then sum them all in a new double field I created, is there an easy field calculation that ...
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 ...
0
votes
0answers
40 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 ...
2
votes
2answers
204 views

Why is arcpy.StackProfile_3d -> arcpy.SaveGraph_management creating empty graph?

In a python script I'm trying to save a graph to a .png file with graph output from arcpy.StackProfile_3d but the .png file shows an empty graph. The table created from arcpy.StackProfile_3d shows ...
1
vote
3answers
46 views

Create Statewide Hydrologic Soil Group Map

This may be better for Engineering? Not sure. Background: Previously I have downloaded SSURGO soil data for the state of Pennsylvania by downloading each county and merging the shapefiles. I then ...
3
votes
4answers
172 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 ...
-2
votes
0answers
46 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 ...
3
votes
1answer
670 views

Getting unicode encode error in ArcPy/Python script?

When I am running a script (it checks to which database a mxd is connected) I get the following error: return codecs.charmap_encode(input,errors,encoding_table) UnicodeEncodeError: 'charmap' codec ...
1
vote
1answer
45 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
0answers
28 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
2answers
54 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
19 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
42 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 ...
5
votes
1answer
270 views

Renaming 1,200 rasters in File Geodatabase using ArcPy?

I've been tasked with renaming a large amount of raster files within a file geodatabase (ArcGIS style). I'm taking weather data which has a name format as such: "G"mmddhhhh I'm trying to add a year ...
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. ...
1
vote
1answer
24 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 ...
1
vote
1answer
127 views

Esri Python Toolbox(pyt) corruption in ArcToolbox.dat

Symptoms: Open ArcCatalog and all tools within Python Toolbox(pyt) have a red-x error next to them claiming that "Arcpy module has no attribute Parameter" Close ArcCatalog Delete ArcToolbox.dat file ...
0
votes
1answer
30 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.
0
votes
0answers
23 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 ...