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

learn more… | top users | synonyms (1)

0
votes
1answer
78 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
39 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
119 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
215 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
128 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
80 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
755 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
94 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
147 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
170 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
59 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
45 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
34 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
74 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
141 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 ...
1
vote
2answers
168 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
85 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
2answers
284 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
25 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
102 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
118 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
685 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
29 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
92 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
90 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
70 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
202 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
1answer
189 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
131 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
267 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
80 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
171 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
101 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
374 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. ...
1
vote
1answer
99 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. ...
4
votes
1answer
369 views

call Sql Server stored procedure form arcpy

Is there a way to execute a SQL Server stored procedure with arcpy or Python and retrieve the results returned by the stored procedure? There is a very similar question posted on ArcGIS forum with ...
0
votes
3answers
35 views

Minimum ShapeLength using arcpy.Polyline?

Please, i am creating lines using arcpy.array(point1,point2) --> arcpy.Polyline...but my ArcGIS create lines only with shape lenght 0.0002 and longer...why ?? I want to create also shorter lines cause ...
2
votes
1answer
49 views

How to check how much of a line (percentage-wise) is covered by a polygon in arcpy?

I'm searching for an efficient way to check if a line is covered by a polygon (see image, this case should return 2x "true"). Right now I only check wether a line is within a buffer with ...
0
votes
1answer
26 views

Multiple vertices after editing giving wrong start and end x, y co-ordinates

I have a small problem which I have been fighting to solve but in vain. Initially I generated some polylines across the river at various locations. I found some of them are smaller in size and not ...
-1
votes
2answers
179 views

Export to PDF in python with parameters

I need to export to PDF with some parameters, and I went through the help and it only explains the data frame portion. When I need the entire map or layout view. Here is what I need: 1.400 dpi ...
0
votes
1answer
68 views

How to get a kml from stored in a blob file of oracle with arcpy

How to get a kml from stored in a blob file of oracle with arcpy? i try get data or kml files contains in a database oracle in a field of a table, using cursos options of arcpy. import arcpy, os ...
1
vote
1answer
64 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 ...
0
votes
1answer
45 views

Add a field to output feature of a geoprocessing tool?

I am running the Watershed tool and RasterToPolygon tool in a loop for a number of points: flowdir = "flow.tif" flowacc = "flowacc.tif" pnts = [arcpy.PointGeometry(arcpy.Point(x=0.0, y=0.0, ID = ...
2
votes
0answers
135 views

arcpy export - unable to set exact extent of dataframe

I am trying to use arcpy's ExportToPNG function to produce tiles for Nasa WorldWind, which will require very specific extents of outputted tiles. Pretty simple code - abbreviated below: mxd = ...
0
votes
0answers
71 views

arcpy.mapping.Export creates some labels but not others

I've created a simple python toolbox (pyt) to export map layouts to multiple formats. My problem is that some labels which are defined in the layout are exported, but others are not. For example ...
1
vote
2answers
545 views

How to count number of feature classes in geodatabase using ArcPy?

I would like to count the number of feature classes in a geodatabase. Some of the classes are in feature datasets as well. I have tried get count management, but that returns the number of rows in ...
2
votes
3answers
117 views

Create in memory polygon with RasterToPolygon

I need to create a number of polygons in a loop from a raster. Essentially, the loop will call a function a number of times which needs to convert it to a polygon: def myfunc(raster): #do some ...
1
vote
2answers
101 views

Calculate field based on most frequently occuring text/value in other fields in attribute table (ArcGIS)

I was wondering if anyone knows if it is possible to calculate a field based on the most frequently occurring value in other fields. What I have is 5 fields with crop information over 5 consecutive ...
0
votes
1answer
146 views

How to add several layers to the table of contents in ArcMap using Python in one shot?

I am already able to add individual layers to ArcMap table of contents using the following codes: # Adding the layer to the table of contents mxd = arcpy.mapping.MapDocument("current") df = ...