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

learn more… | top users | synonyms (1)

1
vote
3answers
381 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
120 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
148 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
86 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
389 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
89 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
195 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
482 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
123 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?
1
vote
0answers
100 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
112 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
634 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
76 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
202 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
271 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
138 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
125 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
45 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
110 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
144 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 ...
3
votes
2answers
152 views

Selecting features to project to different coordinate system?

I've got data from all over Europe in one feature class projected in Web Mercator Auxiliary Sphere. Due to the fact, that length and area values are not usable I'm now working on a python script ...
1
vote
1answer
233 views

Migration from .gdb to .mdb - how to change automaticly all querys at MXD from “ ” to [ ]?

after migration from File Geodatabase (.gdb) to Personal Geodatabase (.mdb) - how to change automatically all field names at query definitions at the MXD from " " to [ ] What's else is important ...
1
vote
1answer
131 views

Need iterator help in create near feature script

I'm having two specific problems with this python script I'm developing. Background: I am trying to generate near_tables from fc's stored in fgdb, join the near table back to target feats, and save ...
0
votes
1answer
1k views

Use arcpy.da.searchcursor to select rows to dissolve

I'm quite new to ArcGIS and hope someone can help me. I have one table that lists which polygons are contiguous with each other called BLPUsCavPlaceContigBLPUs that looks like this: OBJECTID ...
0
votes
1answer
104 views

Code in python for arcgis to select multilines (path) and vertexes

I am learning to write a python code for ArcGis 10.2. Need help! I have some shp poly lines file, need to learn how to write multiple selection of those lines, even if a cursor of mouse pressed not ...
0
votes
1answer
253 views

Copying/Projecting featureclass into a database and featuredataset of the same name fails

I've written a script in Python for ArcGIS 10.1 in order to migrate from an outdated coordinate system to a newer one while at the same time updating from personal geodatabases (.mdb) to file ...
0
votes
0answers
28 views

arcpy.ListFeatureClasses(wildcard, type, dataset) - Help with grabbing from 2 different feature datasets? [duplicate]

I'm trying to join multiple line fcs to their matching named point. (point and lines in same gdb, but separate feature datasets. stand alone python script/arcgis 10.1) My initial line of psuedocode ...
1
vote
1answer
284 views

Arcpy Error 999999: Error executing points to line. Coordinates or Measures are out of bounds

I am selecting two points from a table and then doing a points to line function. I was originally getting this error because they were multipoints with multiple locations. I ran Multipart to Single ...
3
votes
1answer
232 views

Using ArcPy to run Report Layout File (RLF) report and add to layout (for Data Driven Pages)?

I currently have a data driven page template set up which I manually cycle through and for each page run a Report Layout File (RLF) report and then add this to the ArcMap layout. The added element is ...
0
votes
2answers
109 views

ArcPy add point to a FeatureServer Layer

What is the best practice to add a point to a FeatureServer Layer using arcpy? using rest services, write to db, etc? Where can I find a code sample?
0
votes
1answer
436 views

Geographic Transformations using ArcPy vs. Coordinate Systems used by ArcGis online basemaps

I have 3 shape files with undefined projection, but I know which one it was used (Lisboa_Hayford_Gauss_IPCC). I need to 1st Define Projection. It works. I need to transform it from WGS_1984, so I've ...
0
votes
2answers
253 views

Arcpy SelectLayerByAttribute_management where_clause with LIKE not returning like values

I am selecting 2 intersections from a shape file using info from a File Geodatabase Table. The values are very similar as shown in example at the bottom. I am using a LIKE in the statement but it is ...
1
vote
1answer
147 views

pulling an excel sheet with =rand(between) in a Python while loop, and exporting results as .dbf

To preface my question: I am very new to stack overflow, and relatively new to Python. I am working on setting up a sensitivity analysis. I am working with 40 parameters that range from 0.1 - 1. My ...
1
vote
2answers
978 views

How to loop through a list of shapefiles and rename them?

I am trying to upgrade a simple script to list all shapefiles in a folder and if necessary in any folders within and then loop through the list of shapefiles and rename them. import arcpy # Set ...
1
vote
1answer
258 views

How to avoid setting env.workspace and other paths/settings all the time

I have some scripts that are constantly setting env.workspace of arcpy. Usually, I have a caller script(script1.py) that may call some other script (script2.py). I've created a file globals.py with ...
3
votes
1answer
635 views

How do I get the coordinates of my data frame always in long/lat?

I want to determine the coordinates of my current data frame. To do so I wrote this script: def DataFrame (): mxd = arcpy.mapping.MapDocument("CURRENT") df = ...
0
votes
1answer
208 views

Python workspace

I wrote a simple script to rename about 15 shapefiles in a folder on our local server. When I tested it I was working on a workspace on the C:\ and it worked fine. All our data is on a local server ...
1
vote
1answer
339 views

ArcGIS 10.1 Python script to snap points to lines

I have 2 Feature Datasets in a geodatabase. One dataset contains bus routes and the other contains bus stops for each route. I want to create a script that will snap the bus stops to the vertex of the ...
1
vote
1answer
287 views

Help with formatting ArcGIS text elements with Python

I'm struggling with a formatting issue that comes from inserting text into a Text Element object in ArcGIS using Python. I want to print a table of values of which all but the last column are numbers. ...
0
votes
2answers
80 views

Is it possible to rename a field with the current date

I'm trying to figure out if it is possible to rename a field with the current date. What I am trying to accomplish is a table to table conversion, dropping a dozen fields, leaving only two fields, ...
0
votes
1answer
288 views

Why does arcpy.mapping.Layer give Runtime error: CreateObject Layer invalid data source?

I want to connect an existing .lyr file to a variable defined as lyr2. lyr2 = arcpy.mapping.Layer(r"C:/Iso100Red.lyr") Although its a .lyr file I´ll get this Errorcode: Runtime error : Object: ...
1
vote
2answers
750 views

Importing ArcPy taking many seconds and code is really slow for GeoProcessing Tools 64-bit (ArcGIS 10.1 SP1)

I've installed ArcGIS10.1 SP1 and whenever I import arcpy (on Pywin console or Eclipse PyDev) it takes aprox. 15-20seconds. Is this normal? I don't think so... I had Python 2.7.3 64-bit previously ...
1
vote
1answer
1k views

arcpy.env.overwriteOutput = True, not working for some reason

AOI_test = "AOI_test.shp" arcpy.env.overwriteOutput = True for i in loc_list: AOI = "AOI_" + i + ".shp" arcpy.Select_analysis("locality", AOI, " \"LOCALITY\" = '%s'" % (i)) ...
0
votes
1answer
67 views

Looping on the Select_analysis tool

Im trying to perform a loop on the Select_Analysis tool in Arcgis. Code looks like this: inputfile = open("locality.txt", 'r') # locality.txt is a txt file of locality names loc_list = [] for line in ...
2
votes
1answer
303 views

Generating sequential numbering for duplicate values in a field sorted by ObjectID

I am trying to figure out a solution to an field calculation problem. What I'm trying to do is automatically (using either ArcPy or the Field Calculator) generate sequential numbers, beginning at 1, ...
1
vote
1answer
196 views

Updating the value of a field with pre-defined values

I am trying change the value of a row for a field whose type is "short" in arcmap using a python script. with arcpy.da.UpdateCursor(FILENAME, FIELD) as cursor: for row in cursor: row = ...
1
vote
1answer
48 views

Deleting the cursor object

Can someone explain why you need to delete the cursor objects and the iterator when you use for example: arcpy.UpdateCursor(blah) I've checked the esri docs and there doesn't seem to be an ...
1
vote
1answer
139 views

Stuck updating one field based on the condition of another using Acrpy or Field Calculator

I have a shapefile with 5,000 city points. I need to populate a new field, "cls_pop", based on each cities population, so that cities with a population > 2,000,000 will have "cls_pop" = 1, cites with ...
2
votes
2answers
481 views

GROUP BY clause in the UpdateCursor arcpy.da

I need to specify a "group by" clause for UpdateCursor arcpy.da. From here I found out that it's possible to do using an optional pair of SQL prefix and postfix. But there are no examples and I'm ...