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

learn more… | top users | synonyms (1)

1
vote
1answer
86 views

Executing tool comes back with an error arcpy.JoinField_management

I have this script snippet, written by Aaron. import arcpy import os #set workspace arcpy.env.workspace = "C:\\Users\\Documents\\Wetland\\New_Folder" #in the folder "New_Folder" is a geodatabase ...
1
vote
1answer
72 views

Intersection of two polyline geometries not returning expected coordinates?

T2B = arcpy.Array([arcpy.Point(1,2),arcpy.Point(-1, -2)]) L2R = arcpy.Array([arcpy.Point(0, 2), arcpy.Point(1, -2)]) L2R_line = arcpy.Polyline(L2R) T2B_line = arcpy.Polyline(T2B) cent = ...
1
vote
1answer
79 views

Python Toolbox (.pyt) Tool Output Layer Name

How can I manipulate the TOC display name of my output parameters when using a Python toolbox (.pyt) Tool class. I tried adding a symbology layer, however this has no affect on the TOC name. Is it ...
1
vote
1answer
47 views

How can I do a definition query on a layer and zoom to it?

I am trying to do definition query to a layer and to zoom to the same layer, but I got an error ("SyntaxError: can't assign to operator") ?? dataFrame = arcpy.mapping.ListDataFrames(mxd)[0] # the ...
1
vote
1answer
83 views

Definition Query then Zoom to Layer Automation?

I'm trying to create something in here. I want to have an automated process of doing a DEFINITION QUERY then ZOOM TO LAYER with one step. the concept is like that, a dialog comes up with one form ...
1
vote
2answers
54 views

Arcpy text strings as gp expressions

I’m using a while statement to count down from x until it = y. Each loop decreases x by 1. This variable (among other variables) is passed into a geoprocessing tool’s expression variable as a ...
1
vote
2answers
61 views

finding the index of a field with its name using arcpy

I wan to extract the index of a field with its name using arcpy. it seems what I have written is so dumb. is there any simpler method with out using for-loop. import arcpy fieldList = ...
1
vote
1answer
32 views

python script in toolbox add a button on the window

I am getting stuck when I want to create a new python script in toolbox. The function I want to develop is to let user to input the user ID, then retrieve from the database the other values to allow ...
1
vote
2answers
91 views

Min/Max values from a feature class

I am very rusty/inexperienced in python and I was hoping someone might be able to give me some pointers on this script. I would like to create a more compact script that prints min and max values of ...
1
vote
1answer
63 views

How to extract time information from a route analysis

I have a script in Python that solves a really simple route analysis problem (optimal way for given stops). I've found in the documentation that one can assign a start date for the analysis and get ...
1
vote
2answers
267 views

How to copy data from one table to another using cursors?

I'm going to be as descriptive as possible. I have a table (TA) with values which are null for some rows, filled out for others. I have a table (TB) with the null values filled out. Dec in TA is the ...
1
vote
1answer
81 views

Merging multiple tables to shape using for loop

I have to join multiple tables to a shapefile using a common field. I want to script this in python (i am using ArcGIS 10.1). Below is the script i am using. My question is As folks might notice, I ...
1
vote
2answers
61 views

Issues Reading a table from Geodatabase

I have scripted a process to read a CSV file into a file geodatabase. Then, I want to read this imported file and work on it by adding new fields and calculating values. However, while using the ...
1
vote
1answer
64 views

Updating MXD layer definitionQuery in arcpy is very slow

The code segment below has been extracted from a larger project. In short, I have an MXD which I want to generate multiple PDFs based on different criteria. The code below works. It loops through ...
1
vote
2answers
44 views

When creating XY Feature in Arcpy, null values resulting in field being text not numeric

I'm trying to create a feature class from a csv / tab delimited file. All the fields in the file are numeric, but some have null values, and those fields are being coerced into "text" types. ...
1
vote
1answer
148 views

Backup several SDE database connections

This question stems from my previous question on how to list databases based on SDE. Now I want to copy them and have it written as a function so I can list out each database connection below it so ...
1
vote
1answer
170 views

Tool or environment <MakeFeatureLayer_management> not found, Failed to execute (AttributeSearch)

I have created a arctoolbox with scripts in it. In the script, I set the source script file (a python file), my question is when I run this python using a batch file, it won't cause error, ...
1
vote
1answer
110 views

Error when dividing a field with a number

Using arcpy CalculateField_management i want to divide a field with a spacific number: arcpy.CalculateField_management(EZG_shp, "IDX_AT_PK", "(!EURO_SUM!/!Anz_Pers!)/1668,4","PYTHON") This works in ...
1
vote
1answer
101 views

ArcGIS10.2 Data Merge error: 000732

I am running python in the ArcGIS python window. ArcGIS shows error message when trying data merge from arcpy. File "", line 1, in File "c:\program files ...
1
vote
1answer
86 views

Managing large number of catchments/watersheds

Does anyone know of an easy way to manage a large number (10,000's) of catchments/watersheds? I have defined a stream network and for each segment, I have a corresponding catchment (in a unique ...
1
vote
2answers
154 views

How to get/set label scale ranges (e.g. minScale) in ArcPy?

For a layer object lyr, one can programmatically set the minScale in arcpy as such: lyr.minScale = 150000 For a label, one can manually set the scale range within a dialog in ArcMap. In arcpy, is ...
1
vote
1answer
206 views

Error getting spatial reference as string in arcpy

I am trying to get the string associated with a spatial reference to print into an xml using arcpy and xml.cElementTree. Using the snippet: ... spatial_ref = arcpy.GetParameterAsText(3) ... Prj = ...
1
vote
1answer
187 views

Python package for processing GRIB data in windows

I would like to know what python packages can be used to process GRIB (Gridded Binary) data on a Windows system. I know there is something called pygrib, but to use that I have to use cygwin windows ...
1
vote
1answer
130 views

How to export Raster to JPEG in Python?

I built a model to import table data, create xy event, kernel density and clip density raster. I would like to export the clipped raster as a JPEG but I am not sure how to write the ExportToJPEG code. ...
1
vote
1answer
79 views

arcpy clip_managment migration from arcpy 10.1 to 10.2

i've created script using arpy with arcgis 10.1. One of the goal is to clip raster via shp file, which contains one feature. it worked perfect. after migration to arcgis 10.2 i've noticed some ...
1
vote
3answers
253 views

Assigning UNC Path to arcpy.env.workspace

For some reason my python script crashes ever time it reaches the following code which attempts to assign a unc path as my workspace. Can any of you please help me solve this problem? Also, I'm not ...
1
vote
1answer
82 views

CAD to GDB import using ValueTable function

I have several CAD files (DWG) that I want converted to Feature Classes within a file GDB. Each feature class will be based on a polyline attribute "LAYER" value, so I have a query filter applied ...
1
vote
1answer
304 views

Out of memory when calculating loop in ArcGIS 10.2 with Python 2.7

I am quite new to scripting for ArcGIS, so don't mind the styling and layout. I am trying to calculate 600.000 routes by looping a network analyst route analysis. The script extracts two pointID's ...
1
vote
3answers
231 views

Append Attribute Table of multiple feature class with same points/ pointID

I used extract by points function to extract values from multiple rasters using a point feature class. The output is a couple hundred point feature classes with values associated with those rasters. ...
1
vote
1answer
6k views

What does ValueError: invalid literal for int() with base 10 indicate?

# Process: Get Raster Properties Max_Aggl = arcpy.GetRasterProperties_management(EucDist_Aggl, "MAXIMUM", "") print (Max_Aggl) print float(Max_Aggl.getOutput(0)) b = int(Max_Aggl.getOutput(0)) c = b/2 ...
1
vote
1answer
121 views

How to use InsertCursor to add points to a point feature class?

I am struggling with a very simple task of inserting "SHAPE@XY" into a point feature class. Following is what I have: xy = [(361087.15436001675, 198747.07296730898), (361530.56426259346, ...
1
vote
1answer
409 views

Why does copying ArcSDE datasets and features in Python give ERROR 000732 & 000735?

Go easy, I'm new to python I keep getting a kick back that says this: ERROR 000732: Input Features: Dataset 'Database Connections\Wyoming.sde\Supporting_MT_DBO_Geology' does not exist or is not ...
1
vote
1answer
223 views

Why does FeatureClassToFeatureClass field mapping create shapefile with no attribute values on local machine from ArcSDE?

I have inherited taking over and supporting and ArcSDE GIS database. We have a process that we must do every 6 months to export certain features from the ArcSDE database into shape files so that they ...
1
vote
1answer
362 views

Using arcpy.GetParameterAsText() or arcpy.GetParameter() to pass datetime.timedelta to script?

I have a function that takes a datetime.timedelta as an argument in a script that I want to use in ModelBuilder. I don't see an option for that as a parameter type, so for now I have a solution that ...
1
vote
1answer
276 views

How to use 'remap' in reclassify tool code in ArcGIS Python Toolbox

I am making a reclassify tool in ArcGIS python toolbox (.pyt) ... I am able to use the remap datatype but am not able to parse the information present in Remap in the Reclassify function's third ...
1
vote
1answer
328 views

How to edit PostgreSQL geodatabase table using ArcPy?

I'm trying to update a table using a python script and it's not working. The table resides in a postgres geodatabase and is versioned. I have also verified my user permissions (I'm the admin). The ...
1
vote
1answer
220 views

Arcpy ERROR 000732 when ApplySymbologyFromLayer

I want to split a shapefile by certain attribute and then apply a symbology layer, finally output it as a KMZ file. R1 = outpath + 'R1.lyr' arcpy.MakeFeatureLayer_management(fc, R1, "WHERE CAUSE") ...
1
vote
1answer
151 views

3D roof polygon creation from polylines in ARCGIS 10.1

I am Working in arcgis 10.1,I would like to create roof polygons from lines, the lines are captured with photogrammetry technique. As per my requirement I have found tool "3D Building Generator ...
1
vote
1answer
172 views

How to add Table View to Data Frame using ArcPy in ArcMap 10.0?

How does one add a table to the current map in ArcMap 10.0? 10.1 has the function arcpy.mapping.AddTableView, but this function does not exist in earlier versions. Must the table be made into a layer ...
1
vote
1answer
133 views

Consuming Forecast.io Radar Data in an API or ArcMap

I want to consume forecast.io's radar data as an ArcGIS Server REST or JSON to use in an API or ESRI's ArcMap GIS Software. MapBox is doing it here. I don't think forecast.io is currently making the ...
1
vote
1answer
345 views

How to convert shapefile to KML file using ArcPy? [duplicate]

Python script that checks to see if a specific layer file exists in the current workspace and, if it does, converts the layer file to a KML file. Does it work with a shapefile? Code so far: for file ...
1
vote
1answer
143 views

How to recode and recalculate Field Values using ArcPy?

I am trying to figure out how to do several calculations through python and the arcpy set. I have an large dataset (7+ million records of individuals), and I am trying to code a value of 1 that ...
1
vote
1answer
294 views

issues with updating data source, script runs but nothing happens, arcpy

I have seen many questions posted that are similar to mine but still havent found the answer so figured I would post my script. I want to change all the data sources found in all mxds in a location to ...
1
vote
1answer
133 views

trouble deleting data in an fgdb using python

I am trying to use delete_management to delete files in a gdb based on whether or not they are in a list. I keep getting an error with the delete_management tool that says the file either does not ...
1
vote
2answers
239 views

How to use ArcPy to iterate through each grid cell and make it the current extent?

I have a topology that covers a big area. I cannot validate all at once 'cause I get errors. So I've created a grid that covers the area. Through a script runned from my .mxd I intend to: 1. itterate ...
1
vote
1answer
311 views

How to zoom to layer with page definition query set in arcpy?

I have data driven pages enabled on a mxd, with a page definition query set on one of the layers to only show features that match the current index feature. This layer looks like this: After ...
1
vote
1answer
669 views

How to create a feature class in memory?

I am trying to create a feature class in memory but I am not sure how to use the syntax. My code looks like this: FC = arcpy.CreateFeatureclass_management("", "in_memory/FC", "POLYGON", "", ...
1
vote
1answer
201 views

How to batch split feature classes using Arcpy?

I want to bath split analysis tool using Arcpy . I have some feature classes in a feature dataset.I want to Split All of feature classes uisng a shapefile but after split two feature classes, the ...
1
vote
1answer
228 views

Select a single entry using SearchCursor and create variable

I am trying to select a single entry of a floating point entry in a dbf table that contains 9 entries (sampled from a raster image), some of which is NULL using SearchCursor. I want to select one of ...
1
vote
1answer
263 views

Python Field Calc for Document Hyperlink

I am trying to create a script that will hyperlink to a .tiff or .pdf. These files are stored in one folder on a shared server. I want the script to look in a field: 'PLAT_IMAGE', which has the plat ...