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

learn more… | top users | synonyms (1)

1
vote
1answer
134 views

ArcGIS, Edit Layer Extents with Python script

I would like to read and edit the Extent Values of each Layer in a MXD-file. My code: import arcpy mxd = arcpy.mapping.MapDocument(r"D:\Work\myInFile.mxd") for lyr in ...
1
vote
1answer
473 views

Copy features from feature class to an existing feature class with arcpy

I see CopyFeatures_management, but this creates a new feature class. http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001700000035000000 Is there a way to copy features from a feature ...
1
vote
1answer
193 views

Read layer symbology class color with ArcPy

I am using ArcPy within ArcGIS 10.1 and attempting to read symbology from a *.lyr file created by a raster dataset within ArcMap. My goal is to be able read out the RGB (color) values assigned to the ...
2
votes
2answers
70 views

Accessing features via arcpy

i try to use arcpy to accessing the features of a shapefile. I tried to use a searcheCursor, like that: cursor = arcpy.da.SearchCursor(Points, ["SHAPE@XY"]) for row in cursor: x, y = row[0] ...
2
votes
0answers
281 views

How to programatically set default Geodatabase and Workspaces for a map document?

I have a QC process that has a bunch of models that need to be sequentially run, and then the results manually inspected between each model. I know how to manually set the default GDB for the Map ...
2
votes
1answer
175 views

How to check if a shapefile is empty with arcpy

I have a bunch of shapefiles in a folder. But some of them are empty, i.e. there are no rows within the shapefile. Is there a simply to find those empty shapefile out?
1
vote
0answers
138 views

New python GIS Programmer : Fundamentals of the Python Language for ArcGIS [closed]

I am new to programming and I'm trying to learn "Fundamentals of the Python Language for ArcGIS" and then I've been trying to compile an example code but python GUI keeps throwing throwing this error ...
2
votes
0answers
72 views

Convert absolute file path to raster databaset [closed]

I wrote a simple python script that outputs an absolute path as string to a GeoTiff file. So this file can be treated as Raster. In a Model, the GeoTiff file is to be the input raster of a CopyRaster ...
0
votes
1answer
922 views

Problem adding a join to a table via Python using addJoin_management

I am currently building a script for a script tool that will join data from a multitude of tables into a single table based on a common join field. Now, I have attempted to use ...
3
votes
1answer
353 views

How to convert all shapefiles in folder into KML using ArcPy?

I was trying to convert all the shp in a folder into kml. featureclasses = arcpy.ListFeatureClasses() for fc in featureclasses: # Set Local Variables composite = 'COMPOSITE' pixels = ...
3
votes
1answer
240 views

Small script crashes Python

I'm running a rather simple script with ArcPy, which extracts values of raster to points of a shapefile: def raster_overlay(input_files): for raster in input_files: in_shp = ...
2
votes
0answers
132 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 ...
2
votes
0answers
58 views

Copying an entire column between layers (tables)

I have a raster layer with probabilities as values and I process them using the Spatial Analyst extension. After the processing the values are modified, however I would like to also have the original ...
2
votes
3answers
486 views

How to release locks to temp files after ArcPy script crashes in ArcMap?

Sometimes when I'm testing an ArcPy script and it ends with exception, ArcMap is still holding locks to some temp files (I run my scripts through ArcMap). I cannot run the script any more, because it ...
2
votes
2answers
232 views

Trying to use Python code and user defined inline parameters to build a SQL expression

I am trying to build a tool where the end user can run a model and make a selection from a feature class based on 3 different fields, calculate the total shape length, & export the results to a ...
3
votes
1answer
154 views

How can I make my python script results appear in model builder

I have a model (model builder) and within I added a python script to calculate a field. My problem now is, that I don't know how to make the output appear in my model as it is the same as the input ...
0
votes
0answers
23 views

Possible to automate Buffer Wizard in ArcGis 10.x by working in the Shell? [duplicate]

I'm trying to automate the Buffer Wizard since I have several large sets of the data that I need to buffer at multiple distances. Doing it by hand will take a long time and be quite tedious, but I've ...
3
votes
2answers
367 views

Using ArcScripts

I use ArcGIS 10 I want to use an arcscript to compute an index of ruggedness for each cell of my map. For this purpose, I found, Evan's TRI.aml script here: ...
0
votes
0answers
74 views

Select By Attribute sql problems [duplicate]

Having trouble with this python code. I keep getting a ERROR 000358: Invalid expression" code for the select layer by attribute management statement towards the end of the code. Moved the data to ...
1
vote
0answers
95 views

Get values from select by location to append to table

I'm trying to calculate the road frontage of polygons by converting polygons to lines and splitting in their vertices, then using select by location to find lines that are within 7.5 meters of the ...
2
votes
1answer
58 views

arcgisscripting in CGI script

I'm trying to write a Python script that imports arcgisscripting (stuck on 9.3.1 here) which is then run as CGI by a web app. It runs fine from the Windows command line but as soon as I drop it into ...
1
vote
0answers
72 views

Convert polygon feature to line feature

I have a polygon shape-file i need to extract the line segments where the polygon features intersect each other and also the segment where they don't. Can we automate this process or can scripting ...
1
vote
1answer
495 views

Subquery a list in select layer by attribute management using python

I am new to python and having trouble with my script. I want only the records from the COMTRS field (of the pur_dbf_view) that match values from the ComtrsList to be selected; however, I am getting ...
1
vote
0answers
131 views

What is a good way to cluster point data by item counts in ArcGIS?

I have point features that have as an attribute an asset count. For instance, point A may have 3 assets whereas point B may have 300 assets. My goal is to have each point be in two categories: ...
2
votes
1answer
75 views

Is it possible to display two categorical symbolizes for two different attributes in one layer alongside each other in ArcMAP 10.1?

I have a road layer that I would like to display attribute_1 = "speed" on top of the line segment and attribute_2 = "traffic_volume" below the line segment. For each attribute I would like to setup ...
6
votes
1answer
202 views

Generate ArcGIS spatial bookmarks from feature envelope

Curious if anyone has some code that would rip through a feature class and generate a spatial bookmark for each feature's envelope. You could define a field in the feature to be the bookmark's name.
1
vote
3answers
384 views

Does arcpy.SearchCursor function support field indexing?

Does the arcpy.SearchCursor function support field indexing? In the sample script below, can I sent my cursor to loop through the values in the first field by setting an index to search the first ...
3
votes
1answer
107 views

Join is deleting fields in arcpy

I'm working on a script to automate the conversion of CAD .dwgs of rooms to feature classes, I'm nearing completion and am now working on the second portion of the script (I've seperated it into two ...
4
votes
1answer
390 views

Problem: Arcpy Graph function empty graph output

Background: I have some python code that I need help with parameter passing into the MakeGraph_management arcpy function. I would like to create a two-series vertical line graph for every pair of ...
1
vote
3answers
424 views

Is the FME Extension for ArcGIS required in order to use arcpy scripts in FME?

Is the FME Extension for ArcGIS required in order to use arcpy scripts in FME? I dont think it is but when i run a simple startup/shutdown script in FME I am getting these error messages. This ...
2
votes
2answers
133 views

'DEFeatureClass' vs. 'IFeatureClass'

I'm writing an ArcGIS 10.1 .pyt toolbox to accept a feature class as input (not a shapefile). Referencing ESRI's online guide to 'Geoprocessing Data Types of Parameters and Environments' [PDF ...
0
votes
0answers
157 views

Arcpy - change layer from sde connection to file geodatabase

We are copying data from our corporate office to field offices and we are creating a file geodatabase at these field offices. We are copying the layers that point to sde and they need to point to the ...
0
votes
1answer
96 views

Arcpy & ARCGIS10: Make netCDFRasterlayer, error attribute not found

I am trying to create a raster layer from a NetCDF File using Python. If I am using the Arcgis 10 Python window it works without issues. But executing the same script in Pythonxy gives the error: ...
5
votes
2answers
419 views

How to create an oriented buffer using arcpy?

I would like to create an oriented buffer for every polygon in my shapefile using arcpy. By oriented I mean that I have two angles a1 and a2 that constraint the direction of the buffer. This is ...
0
votes
1answer
97 views

ArcMap toolbox script with draw geometries parameter

I have an arcpy script in toolbox, that need one additional parameter to draw geometry(ies) which will work as a filter. I have done something similar using arcobjects using ...
1
vote
0answers
217 views

Change ArcGIS Server mapservice properties programmatically

I am weekly caching my ArcGIS Server mapservice tiles with help of a python script using the arcpy.ManageMapServerCacheTiles_server() command (ArcGIS 10.0, SP5). For whatever reason, this script fails ...
0
votes
1answer
555 views

nested SearchCursors to loop through two tables whilst adding rows and calculating fields

I'm trying to loop through each row in table "Sites_Copy" and look at "OID1" and "OID2". Then take these and loop through "BLPUs_PolygonNeighbors" and compare these to "src_OBJECTID" and ...
0
votes
0answers
132 views

Why would arcpy.Delete_management give ExecuteError: ERROR 000317: …dataset cannot be deleted?

arcpy.Delete_management(r'..dataset') returns ExecuteError: ERROR 000317: ...dataset cannot be deleted But it works in python interactive window... Anybody run into the same issue before?
3
votes
0answers
110 views

Use ArcPy to identify annotation reference scale?

I would like to retrieve the value of an annotation feature class reference scale using ArcPy (under ArcGIS 10.1). I cannot find where this property is stored (tried to access using the describe ...
2
votes
0answers
115 views

How to call ArcPy script from Windows Service? [closed]

I'd like to call arcpy script from Windows Service. Here (Calling arcpy/python from .NET?) I read that I can load python script. What do I need to load arcpy script?
3
votes
1answer
60 views

How to select among overlapping linear features by create date?

I have a table which has overlapping linear data; for example: A----------C and B---------C. Of these two records I would only like to return the record with the latest create date; in other ...
2
votes
2answers
718 views

arcpy.da.updatecursor to delete duplicate rows where values switch columns

I'm trying to dissolve polygons using polygon neighbors in arcgis 10.1, but don't want to use duplicate rows. However, the field values will switch when they're duplicated. If I run this: ...
2
votes
1answer
79 views

How to reference path to file that is in edit session from Python AddIn?

I am creating a Python addin button and I would like to reference the path to the layer that is currently in an edit session to the code in the addin button. This way users will be able to use the ...
0
votes
2answers
229 views

Arcpy Insert Cursor

The below code quits at the "cur = " line. Is it an error with arcpy module, my other scripts have worked with importing arcpy. I cannot determine if it is not recognizing the 'InsertCursor'. Any ...
0
votes
2answers
311 views

ArcGIS 10.1 - Using Polygon Neighbors with dissolved polygons

I've used polygon neighbors to find all neighbors of a polygon layer, which I then use to look up all possible neighbor combinations and dissolve the polygons into all possible combinations of two ...
0
votes
1answer
143 views

Cursor not working in ArcGIS 10.2

I just simply tried print arcpy.SearchCursor(...) A 'None' was printed. But arcpy.da.SearchCursor works. Has anyone run into the same issue, or is arcpy.SearchCursor deprecated in 10.2? Thanks
0
votes
0answers
136 views

Error in Select Numeric type column in pyodbc with ArcCatalog

I created a python script that uses "pyodbc" plugin to connect a SQL Server database and write out data. It was imported in an ArcGIS 10.1 tool and run from there. try: arcpy.AddMessage('FLAG 0') ...
0
votes
2answers
47 views

Updating a Field in the Current Selection [duplicate]

I have some address points selected for which that I want to update the address field based upon the row in the selection. How do I figure out the name of the selection taable to pass to ...
0
votes
1answer
119 views

How to get cell value from one raster within a raster catalog using ArcPy?

I need to be able to obtain the cell value of one cell in one specific raster that is stored withing a raster catalog in a file geodatabase. The Get Cell Value tool doesn't appear to be able to do ...
0
votes
1answer
151 views

Dissolve multiple rows straight into one layer and add OIDs into table

I am currently running this script to direct multiple dissolves of a polygon layer FC = "BLPUsCavPlace" TABLE = "BLPUsCavPlaceContigBLPUs" FIELDS = ["blpuid", "contigid"] with ...