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

learn more… | top users | synonyms (1)

5
votes
1answer
194 views

Arcpy Pythonaddins Equivalent of arcpy.GetParameterAsText

I've build a neat little search arcpy script. The user opens any mxd, zooms to a location, chooses a corporate fGDB, and runs the tool. The user gets a list of all the populated feature class that ...
0
votes
0answers
45 views

Arcpy Closest Facility script not running correctly

I am running a script in ArcGIS 10.2 to automate the Make Closest Facility tool, as below, to identify the nearest chemist. This works fine. However, I then want to run it for another facility (a ...
2
votes
0answers
81 views

How to detect broken hyperlinks with arcpy?

I have zero experience with python but am trying to search for broken hyperlinks in a large gdb (temporarily converted to a shapefile)- Used code from a previous question (Hyperlink broken path - ...
0
votes
1answer
52 views

unable to modify records from one shapefile to another

I am trying to update the atrribute data of a feature class with respect to another one by matching a common field. But it is returning an error for the setValue command. My code looks like: import ...
0
votes
0answers
22 views

How to update attribute table of a shapefile on display automatically? [duplicate]

I have a shapefile attribute table on display. After some processing, I have to right click click Refresh to get updated version of table. I am wondering if there is a way using arcpy to update it ...
2
votes
1answer
116 views

How to get output value from Feature Compare (schema) and append to existing csv?

I am working on a data integration project and am trying to single out feature classes which have a schema that varies from two base feature classes (one for point, one for polyline features). I've ...
0
votes
1answer
131 views

Creat point and update featuers spatial join

I have the following code that is in a tool. The tool creates a point on click, then auto sequential populates the "AddressID" field and also populates X_Coord, , Y_Coord. This part of the tool works ...
0
votes
2answers
298 views

Arcpy zoom to selected features not working

I'm writing a python script to automatically take some snapshots of my ArcMap in 10.2, but I can't get the zoom to selected features tool to work properly. I have a layer called carereport, which I ...
0
votes
1answer
74 views

AddLayer method failing when script in ArcToolbox is run from ArcCatalog

I need a 2nd set of eyes to do a sanity check, as I am not been able to figure out why a script that runs fine in pywin, does not run properly as a tool in a toolbox. Below is the script that runs in ...
1
vote
1answer
162 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 = ...
3
votes
3answers
439 views

Intermediate Data in Python Code

Is there a way to incorporate intermediate data (so that I do not have to select an output save location) in a python script that I turned into a tool? import arcpy, os from arcpy import env ...
1
vote
1answer
220 views

Query Layer not found ERROR 000229

My code executes in three steps: create FeatureLayer, create QueryLayer and join QueryLayer to FeatureLayer: arcpy.MakeFeatureLayer_management(**{ "in_features":features.get_dataset_fullpath(), ...
0
votes
1answer
81 views

Best Way to Get a List of Selected Rows for a Specific Layer using Layer Object in ArcGIS

What is the fastest/cleanest way to get a collection of rows that are selected in a certain layer? For some background, I am trying to hide selected features in a specified layer. The solution ...
1
vote
1answer
87 views

Arcpy scripts fail on big datasets - anyone has experienced similar behavior?

Here a question that is not extremely specific but maybe someone has had similar experiences... I have a few Arcpy scripts that work perfectly when used with small datasets but that silently fail ...
0
votes
1answer
45 views

How to restrict read only *.mxd file?

I have an *.mxd file and I don't want to save any edits to it after each session. Is there a way in 'arcpy' or python in general to restrict edit of *.mxd file? Any suggestions would be appreciative.
0
votes
1answer
100 views

Use a variable to calculate a field with arcpy as a script in a toolbox?

stringvariable = "banana" arcpy.CalculateField_management("c:\point.shp", "SUBDIRECT", "stringvariable", "PYTHON") I get an error saying stringvariable is not defined what's the deal? I check ...
1
vote
0answers
44 views

What causes “RuntimeError: DataFrameObject: Error in setting extent”?

I'm having a problem whilst trying to set extent on a python script. mapDoc is created using Web_map_as_Json string. Appreciate if anyone can help. result = ...
1
vote
1answer
137 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 ...
2
votes
2answers
259 views

What is the most efficient way to iterate through folders and geodatabases?

I am looking at cataloging some data, and I have code that works, it just seems to take a lot of time to run through all of the items. The way this data is structured is a bit of a hindrance, ...
0
votes
1answer
143 views

How to use for loop to add and calculate new field?

I am trying to use for loop to add and calculate a newfield for 2 shapefiles and a different new field for 2 other shapefiles. When I tried to do these 2 loops as one, it did not work so I separated ...
2
votes
2answers
93 views

python add fields that may have NULL values

I would like to use python to calculate a field (short integer) using other fields (short integer) present in the table. In some cases these fields may have NULL values for one or more of the fields. ...
3
votes
3answers
883 views

Calculating X and Y of line start and line end using ArcPy?

I have a series of polyline shapefiles and I am trying to automate the process of calculating the X and Y coordinates of the line start and line end using Python. I have added the 4 fields (startx, ...
3
votes
0answers
107 views

How to extract zipped shapefile and check its shape type using arcpy module without writing on disk

I have a zipped shapefile saved on my disk. I want to extract it in memory and check the shape type. I'm using arcpy module and want to stick to only default modules comes with python installation. I ...
0
votes
2answers
153 views

How to pass expression to where clause in ArcPy? [duplicate]

I want to pass a user defined variable into a where clause Syntax SelectLayerByAttribute_management (in_layer_or_view, {selection_type}, {where_clause}) #user input MTRsel = ...
0
votes
1answer
196 views

how can I add all feature classes of the same name to an mxd in python

I have a bunch of folders which all have (almost) identical folder structures and file geodatabases of identical structures which in this folder structure. I need to add all of the same type of ...
2
votes
1answer
64 views

Arcpy Calculate Field Formatting Syntax

I am trying to field calculate a double field (PID) to a new string field (PIN). Using: qry = '"139-{}".format(!PID!)' arcpy.CalculateField_management(out, "PIN", qry, "PYTHON") Given a PID = ...
0
votes
0answers
47 views

Visualizing Layers with lyr-files in ArcGIS API for JavaScript

I do have a probably very simple question. I'm currently running a Python-Script on my Desktop-machine. In the end of this script the different layers that I've created will be visualized according ...
0
votes
1answer
35 views

Copying extents between features

I have a Building feature class whose individual building footprint extents I want to match to associated Level feature classes. Unfortunately, the Level data was converted from DWG files with only ...
0
votes
1answer
83 views

name 'AddressLocator' is not defined, Python created Address Locator

When I run this tool, I get the error 'name 'locator_AddressLocator_n_' is not defined'. My guess is that this is an issue with the path where the locator is trying to save to? So, I am assuming I ...
0
votes
2answers
165 views

How to use Field Value from arcpy.GetParameterAsText()?

I want to to is have a user select a feature class, which then populates the fields that can be selected (this works), create a new field in that feature (works), and then populate the new field with ...
2
votes
2answers
195 views

Run a model from python problem

I am using arcGIS 10.0 SP5 I have the following code : import arcpy arcpy.ImportToolbox(r"C:\Documents and Settings\Derek\FRAME\FORTEST.tbx", "Derek") arcpy.TEST_Derek() The model is names TEST ...
0
votes
2answers
94 views

Add value to a field Python

I was wondering if anyone can help me with some Python? I have a featuers Class with the columns KOMMUNE and GKR and some other columns.. Both columns are string. In the column KOMMUNE I have the ...
3
votes
1answer
331 views

Multiprocessing issues with ArcPy

I am using ArcGIS 'watershed' routine in a script which makes use of multiprocessing. This works fine, but during execution I get the message: Unable to remove directory. Possible causes: 1- Not ...
0
votes
0answers
29 views

Is it possible to scale an ArcGIS feature in a multipatch feature class using Arcpy?

I've imported a number of features in Python using the following method: - Import3DFiles_3d Unfortunately they are all extremely large so I would like to scale them using arcpy. I have seen that ...
2
votes
2answers
110 views

Is there a way to do a python batch script for Analyze and Compress on SDE Databases?

I created and modified python scripts based off of ERSI's example (http://resources.arcgis.com/en/help/main/10.2/index.html#//003n000000v7000000), however, what would be great is to be able to batch ...
3
votes
1answer
138 views

AddJoin failing in Python ArcGIS

My AddJoin operation is failing: arcpy.CopyRows_management(lup_file,out_dir+'lup') try: # Perform copy rows on merged csv file print 'start' aa = arcpy.Raster(SEIMF) ...
-1
votes
2answers
887 views

How to compare values from a column in attribute table with values in Dictionary{}?

I am just entering to the python world, hence the level of my question. Can anyone tell me what Python function should I use to compare values stored in one column in an attribute table with values ...
2
votes
1answer
30 views

How to merge (append) ArcInfo coverages that are inside folder structure using ArcPy?

I'm having a bad time trying to create a script capable of merging a list of arcinfo coverages located inside a folder structure. My goal is to merge the coverages named "car" that are inside each of ...
0
votes
1answer
93 views

Duplicating Features To Create A Pattern

I'm currently trying to take the 'Shifting Features' script from ArcPy Cafe and this SE response and apply it to a similar script that will one by one, through all the features in a feature class, ...
0
votes
0answers
115 views

UnicodeEncodeError when using arcpy.gp.TraceGeometricNetwork_management() [closed]

I am creating a python tool (run through ArcMap) which will eventually go through a feature class selected by a downstream trace and use the obtained values to do some function. I am trying to follow ...
0
votes
0answers
80 views

arcpy.SearchCursor strangely throwing IO Error

I've been trying to use arcpy.SearchCursor on an xls file. Something I've done countless times before. I had a script running and then yesterday it started throwing: IOError: ...
2
votes
3answers
255 views

How to create a geodatabase feature class using a geodatabase table schema with ArcPy?

Is there a way in ArcPy to create an empty polygon geodatabase feature class that will acquire the schema of a geodatabase table? I know that it's possible in ArcCatalog (New -> Feature Class and ...
2
votes
2answers
242 views

How to generate dynamic legend using ArcPy?

I used this example to produce printing service. As the result I get map with too many elements in the legend. Is it possible ti show classes that are visible in the current map extent using python ...
0
votes
0answers
39 views

Unable to Import 3D Files with real-world position

The following link identifies a method of importing one or more 3D models into a multipatch feature class. http://resources.arcgis.com/en/help/main/10.1/index.html#//00q900000097000000 Test Case I ...
1
vote
1answer
153 views

ArcGIS arcpy reprojecting raster issue

I have a raster which I want to reproject from GCS_WGS_1984 to GCS_NorthAmerican_1983. I am using the following code: try: spatial_ref = ...
1
vote
1answer
320 views

How do I copy polygon features with a WHERE clause using ArcPy.da

This question is similar to Copy a polygon geometry in Arcpy, except within the context of using Arcpy.da instead. I want to copy the geometry from one feature class to another using ArcPy.da (I'm ...
0
votes
1answer
87 views

problem with SelectLayerByAttribute management in script

hello my problem is that this tool works perfectly in IDLE or PyScripter programs, but if I use in the script in ArcGIS desktop this problem occurs: arcgisscripting.ExecuteError:ERROR 000582... why ...
1
vote
1answer
185 views

Multiply a raster list with a field value list in a FOR loop in ArcPy

I'm trying to create a simple map algebra calculation not managed by ModelBuilder, but writing it in Python is trickier than I thought. I have a list of raster in a GDB and I must multiply them by ...
2
votes
3answers
107 views

Best way to find points outside state boundary that are supposed to be within specific State

I have a nationwide featureclass called bakeries. In the bakeries FC, there is a field called "State" and the field is populated with state abbreviations(AL,NJ,CT,etc). I have another feature class ...
5
votes
1answer
467 views

How to do a separate Python installation with ArcGIS?

I see a lot of threads asking how you can have a separate Python installation (e.g. the Anaconda or Python XY distribution) and get it to work with arcpy, while not 'breaking' ArcGIS at the same time. ...