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

learn more… | top users | synonyms (1)

3
votes
1answer
129 views

ArcPy delete terrain: cannot be deleted

I can't get my ArcPy script to delete a terrain. If it exists, it should be deleted. However it throws an ERROR 000317: {path} cannot be deleted My script is a lot longer than this, but this ...
3
votes
2answers
164 views

Calculate field values using random integer derived from count of like features

I have a feature class which contains features classified by type. What I would like to do in my new field is generate a random number sequence for those like values using a count of the like values. ...
3
votes
1answer
62 views

Does Avenue equivalent of pointPosition exist in ArcGIS 10.2?

There were a couple of awesome methods in Avenue for ArcView: point=polyline.Along(percentage) percentage=polyLine.pointPosition(point) Don't laugh, but one of the reasons I updated to 10 from 9, ...
3
votes
1answer
232 views

ArcPy / ArcMap 10.2: How to report data to user?

I'm developing an arcpy addin with ArcMap 10.2 that outputs a feature layer based on user input. How can I display attributes from this layer in a MessageBox or other reporting mechanism? I don't ...
3
votes
1answer
250 views

AddJoin failing in Python ArcGIS [duplicate]

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) ...
3
votes
3answers
845 views

Why does import arcview/arceditor give gp.setProduct() RuntimeError: ERROR 999999: Error executing?

I am developing a script that will be used in ArcGIS Desktop 10.2 of Standard (formerly called ArcEditor) license level and thus importing arceditor to make sure I don't use GP tools that require ...
3
votes
1answer
356 views

Using update cursor in a while loop to perform analysis on individual polygons gets stuck on first row

I am working through an open courseware project from PSU found at https://www.e-education.psu.edu/geog485/node/145 I am trying to use an update cursor in a while loop to perform an analysis on ...
3
votes
1answer
72 views

Can I access the Error Log in arcpy?

Can the error log created by validate topology be assessed through arcpy? I can validate the following topology - arcpy.ValidateTopology_management(r"C:\WorkSpace\CWD.gdb\FD\FD_Topology") Can I ...
3
votes
1answer
674 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
2answers
146 views

Should Python Add-In installed in map which is packaged be part of *.mpk?

Using ArcGIS for Desktop 10.1 SP1, I just created a map package (.mpk) from a map (.mxd) which had a Python Add-In (.esriaddin) installed. When I unpacked the .mpk the .esriaddin was neither ...
3
votes
2answers
1k views

arcpy Problem with updateRow() when trying to update fields with UpdateCursor

I have a list of values which I am trying to add to an existing shapefile. The field where the values need to be inserted has been added via arcpy.AddField_management and thus the values of the rows ...
3
votes
1answer
708 views

Getting unicode encode error in ArcPy/Python script?

When I am running a script (it checks to which database a mxd is connected) I get the following error: return codecs.charmap_encode(input,errors,encoding_table) UnicodeEncodeError: 'charmap' codec ...
3
votes
1answer
212 views

Debugging TypeError: SearchCursor() got unexpected keyword argument in ArcPy script?

I tried to use SearchCursor(points, fields=fieldname) but I get this error: TypeError: SearchCursor() got an unexpected keyword argument 'fields' I'm not sure why this doesn't work. # Local ...
3
votes
2answers
775 views

How to filter out multipart polygons and then buffer?

I've written a small script trying to accomplish the task described in the question title. It basically looks like: in_fc = '...' # Some shapefile goes here # Get the fields (column names) of the ...
3
votes
2answers
3k views

How do I use python to batch process the reprojection of a group of shapefiles?

My client would like his shapefiles reprojected and I would like to get a script that can batch process all the files located in the same folder. I am new to Python and ArcPy but am very interested. ...
3
votes
3answers
2k views

How do I access a multivalue output parameter from a python script in modelbuilder in ArcGIS 10.0?

How do I access a multivalue output parameter from a python script in modelbuilder, in ArcGIS 10.0? That is, I have a python script that loops through several input layers (working through a script ...
3
votes
1answer
1k views

ArcPy: Feature class “doesn't exist” after MakeFeatureLayer

I was working on a Python script to analyze the geometries of a feature class and write something out. It worked fine the first time, but gave an IOError each subsequent time. I narrowed the problem ...
3
votes
2answers
3k views

Selecting features through arcpy

I would like to achieve the following functionality through arcpy: Querying an existing baselayer on time and create a new layer Apply symbology from an existing layer and add the new layer to the ...
3
votes
2answers
2k views

Customizing label features using arcpy

I have a script that creates symbology for a polyline (contours) and then adds it to a .mxd file. My problem is that it picks the “FontName” as the default field to label on the map (see attached ...
3
votes
1answer
692 views

ArcGIS Select Analysis using Unique Values from Field

I am trying to create separate shapefile using Select analysis with ArcPy by doing an SQL query to create them based on a unique value from the field. I want to create a list of the unique values in ...
3
votes
1answer
1k views

How to change the datasource with python?

How do I change the datasource of all layers in a map document using arcpy and python
3
votes
1answer
101 views

How do I import specific fields from a shapefile?

Using arcpy, how do I import only select fields from a shapefile? Or, if I must import the entire shapefile, how do I delete certain fields after import?
3
votes
3answers
149 views

Error when Projecting Rasters using ArcPy?

Using ArcGIS 10.3 I'm receiving the dreaded 'ERROR 999999' when attempting to project a geodatabase full of rasters from WGS84_UTM_zone_10N to Nad83_BC_Environment_Albers import arcpy InRasterGDB = ...
3
votes
2answers
116 views

Adding descriptions to feature class in a geodatabase using arcpy

I am trying to populate the properties of a feature class in a geodatabase using arcpy. In the past I have been given geodatabases with features classes that already have their property descriptions ...
3
votes
2answers
214 views

Finding the Python script used by a custom toolbar button in ArcMap

I've been asked by somebody at work to design a toolbar add-in that works just the same as an existing one, but with a different set of data. However, the person who wrote the original add-in for him ...
3
votes
2answers
587 views

ArcPy Data Access Insert Cursor not writing geometries to feature class?

I'm running ArcGIS 10.2.1 and am having troubles with the Insert Cursor in the arcpy module. I have an empty feature class in my geodatabase and have created the short script below to try and find the ...
3
votes
2answers
158 views

Importing external bookmark (.dat) files into many MXDs using arcpy?

Does anyone know any python script to use for arcview to import a bookmark (saved as a .dat) that was created and saved externally using ArcMap? I tried with this script but without a result: import ...
3
votes
1answer
259 views

Project point to map with Arcpy using GPS Coordinates

I am trying to create a new layer with just a single point using arcpy. All that is provided is a gps lat and long. It seems like it should be a simple problem but I just can't get it to work. I've ...
3
votes
2answers
1k views

How do I know if I am running 64-bit background geoprocessing on ArcMap 10.2?

I'm running ArcMap 10.2 and just set up 'ArcGIS for Desktop Background Geoprocessing (64 bit)' and now I have both the ArcGIS10.2 folder and ArcGISx6410.2 folder inside my python folder. I have ...
3
votes
2answers
882 views

Converting Vertices of Polylines and Polygons to Points and Maintain Attributes

I'm pretty sure someone has done this before, but I'm having no luck. I'm using ArcGIS Standard version 10.2.1 and I want to convert all the vertices of a polyline or polygon to points. Essentially, ...
3
votes
1answer
240 views

*.lyr to *.style conversion in ArcGIS

Do you know how it's possible to convert a layer symbology or an *.Lyr file to an *.style file? Thanks, Jérôme
3
votes
1answer
681 views

Edit SQL Server table (not registered with geodatabase) with arcpy

I am trying to update some rows in a SQL Server database table (not registered with geodatabase) with arcpy.da.UpdateCursor. However, when running the deleteRow(), I get the error return without ...
3
votes
1answer
1k 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 = ...
3
votes
2answers
918 views

Python script to read coordinate system of an input feature class? [duplicate]

How to read the coordinate system of an input feature class in python script. How we can use "Describe()" function and tool validator for that purpose
3
votes
2answers
241 views

Detecting ring direction of a polygon using ArcPy

I am using ArcPy in ArcGIS 10.1 to process some geometry using the arcpy.da data access module. However I have run into a problem with complex Polygons that contain inner rings/holes. From the ...
3
votes
2answers
587 views

What causes RuntimeError: ERROR 010240 saving after CellStatistics?

I am having trouble saving outputs from CellStatistics but only when I run it on a list of rasters. This was working on python 26 but not 27. I know this example is nonsense, but: env.workspace = ...
3
votes
1answer
295 views

How can I validate a table name on SDE with Oracle backend?

Second title: "Is arcpy.ValidateTableName broken on Oracle?" I have an Oracle SDE database 9.3.1 (service connection). My arcGIS client tools are version 10.0 SP5). I have some names of feature ...
3
votes
2answers
841 views

Using Select By Location to update field in feature class using ArcPy?

I am using Arc 10.1 and I am working on a script that takes a value from a field within one shape file and updates a field in another shape file based on its location. Basically I have smaller parcels ...
3
votes
1answer
1k views

getting the specified geographic transformation, or at least the GCS, of a data frame

First, the TLDR digest: I'm getting a bogus value from dataFrame.geographicTransformations on some machines; how do I get the correct value as shown in the properties dialog? and/or Given a spatial ...
3
votes
1answer
2k views

Batch renaming of feature datasets, and feature classes based on new dataset name?

I need to create a python script (or model) that would first rename all the feature datasets in a gdb. The feature dataset is in a set format and I need to change the prefix of the dataset. For ...
3
votes
5answers
1k views

Having trouble nesting updatecursors

I'm trying unsuccessfully to perform updates on multiple linked tables using updatecursors. The following code works as I would expect: trackRows = ...
3
votes
3answers
625 views

Convert cursor output to list of geometries

I want to convert all the geometries returned by search cursor to a list. import math import arcpy from arcpy import env env.workspace = r"C:\GIS Data\GIS data_for Maeenul vai" desc = ...
3
votes
1answer
1k views

How to create an offset polyline in arcpy?

I am trying to create an offset polyline using arcpy, identical to the function in ArcObjects (constructoffset). After trying to access ArcObjects in arcpy, which I found difficult for those not ...
3
votes
2answers
1k views

Python and Data driven pages - Advanced use

I need to make a number of maps where only one input changes (a layer with the range of a radio tower) and I want to add the layer, apply symbology, zoom to it, change the title to include the name of ...
3
votes
2answers
1k views

Add a .lyr file to multiple mxd's within a specified folder using python

I need to create a python script that will look in a certain folder or workspace, and add a certain .lyr file to each mxd in the folder. I am able create a python script that adds the layer by ...
3
votes
3answers
1k views

Using Python to combine middle parts of two fields into third field

Below is how I used the Update Cursor in my final script. As you can see getValue was used a few times, perhaps there is a cleaner way to do this? But my concatenated field wouldn't populate properly ...
3
votes
1answer
2k views

How do I 'select' using ArcPy?

When using a cursor to loop through an attribute table, is it possible to iteratively select each row? I want to clip a line to a polygon grid (see previous question); due to the size of the grid the ...
3
votes
2answers
665 views

Arcpy: print to PDF with Vector shapefiles, text etc

I have a small python script which exports a set of data driven pages to PDF. This works fine, including appending each page to an 'all' pdf. My issue is that it creates rasters of each layer in the ...
3
votes
1answer
76 views

Match features that are spatially similar with ArcGIS?

I'm hoping there might be a way to match features from one feature class to features of another feature class that are the most spatially similar. I have two datasets representing the same thing but ...
3
votes
2answers
83 views

Displaying estimated computational time when running tools in ArcGIS for Desktop?

I'm almost positive I have set up models to display the estimated runtime/computational time for the models/tools in the past, but I can't seem remember how to turn on this option. I've looked around ...