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

learn more… | top users | synonyms (1)

6
votes
1answer
279 views

Why does tool take longer to run when in Python script?

I have written a python script that does some euclidean allocation. For that I use arcpy.gp.EucAllocation_sa() method. Now, my python script takes 30-40% extra time than spatial analyst euclidean ...
6
votes
1answer
1k views

Get shape filename in attribute field using field calculator

I apologize for crossposting against the ESRI geoprocessing forum, but it seems like this one gets answers. I'd like to have a modified append tool (ArcToolbox) that takes multiple shapefiles with ...
6
votes
4answers
382 views

accessing the output of a python script tool dialog ArcGIS 10.1

Hi I have a a fairly simple script tool dialog which has been setup to get 6 parameters from the user and return them as the tool output as a list. the aims is that the out put would then be used ...
6
votes
1answer
147 views

Python in ArcGIS: How to add a space between upper and lowercase letters in TOC

I'd like to use python to update the TOC by adding a space (white space) for layer names that are like this: "BoundaryBuffer" or "WaterEdge" and replace them with "Boundary Buffer" or "Water Edge". ...
6
votes
3answers
1k views

Insert points into SQL Server?

I am collecting X and Y values from a web service (Twitter) via a python script. In the long run, this will run over a period of months and I intend on stopping at around the 6 million point mark. ...
6
votes
1answer
342 views

Algorithm to fill the gaps adjacent to parcels

I would like to find a way to fill the gaps between the road and its surrounding parcels, like described in picture below: I have different parcels like A and B , i want to fill the gaps by adding ...
6
votes
1answer
4k views

issues importing arcpy in Python IDLE

Hi I would want to use arcpy in my python code. I am able to import it through the ARCGIS desktop python console. But I am not able to import it into Python IDLE. I get the following error Traceback ...
6
votes
1answer
566 views

Is there anyway to make GPModels with python scripts execute faster?

I do not know if anyone else has this problem but my GPModels that include simple python scripts seem to take way too long to execute. One example is a model I built which is a simple select feature ...
6
votes
1answer
197 views

Is it possible to interrupt Select Layer By Location when first feature selected?

I´ve got a point feature class with some 7.000.000 points and I´m trying to check if any of these points is simply intersected by several polygon feature classes using 'for' loop and ...
6
votes
1answer
317 views

ModelBuilder: How to extract data by date, export to separate tables and interpolate tables to rasters

I've been using ArcGIS for a couple years, but when it comes to model builder I've only worked with very simple models. I'm hoping someone that is much smarter than myself can help me in building a ...
6
votes
3answers
200 views

Are there any open source Python modules compatible with arcpy that will allow complex SQL queries?

I am trying to handle string (non-geometry) duplicates in a large attribute table of a shapefile without having to convert to gdb and back or connect to a postgres db. I need to be able to use a count ...
6
votes
3answers
696 views

Arcpy's replaceDataSource Error

I've checked the other answers here and none of the answers worked for me... It's a "simple" matter of finding a layer by name in a map and changing it's datasource. Here's my script: #-- New ...
6
votes
1answer
521 views

Why are results from Python tool not in Results window?

I am relatively new to ArcPy 10. and I want to return the list of feature class from a dataset. I can see them through the message, but cannot see them from the result window. Actually there are only ...
6
votes
4answers
2k views

How to interpolate points along a line in Python for ArcGIS 9.3?

I am building a Python geoprocessing script for ArcGIS 9.3. In the script, I have a simple LINE feature class with one row, one line. How can I use a linear referencing system to interpolate a point ...
6
votes
1answer
606 views

With arcpy, how do I detect relationship classes in a file GDB (or can't I)?

I would like to be able to detect relationship classes in a file GDB. Because users of my script might have only an ArcView level license, they would not be able to manipulate the schema of a feature ...
6
votes
2answers
144 views
+50

Conflict between ArcPy and GDAL/OGR?

TL;DR I can't get an installation free version of GDAL/OGR to work from within ArcMap 10.0. I get an ImportError: DLL load failed on _mod = imp.load_module('_gdal', fp, pathname, description). ...
6
votes
1answer
85 views

Is setting the env.workspace var necessary for python add-in buttons in ArcMap?

I made a custom add-in for ArcMap (10.2 in my case) and was reviewing my code with a colleague. We're not sure if the setting the workspace is required in the code since the button's script is only ...
6
votes
2answers
2k views

Select and copy features in ArcMap using Python add-in tool

I'm trying to add a tool to an add-in toobar to select features from an existing feature class and copy them across to another feature class. I need two tools, one for a point and one for a rectangle. ...
6
votes
1answer
325 views

How to draw shapes with highest possible decimal accuracy

I am trying to read input of lat and long to draw the shape based on condition.The input is standard array of lat and long with 15 decimal accuracy. I am realizing - I am loosing some decimal accuracy ...
6
votes
1answer
1k views

ArcObjects C#: Create Random Points fails with ERROR 999999: Error executing function

I am having trouble running some ArcObjects C# code that calls create random points. I would not be doing this in ArcObjects, but I am suffering with the same issue using Arcpy as seen here: ...
6
votes
2answers
1k views

Is anyone successfully using arcpy.ExportMetadata_conversion?

I don't know if it is a bug or my lack of python skills, but I keep getting 'ERROR 000816 The tool is not valid' in my python script when I call ExportMetadata_conversion Initially, I was attempting ...
6
votes
1answer
135 views

Handle annotation layers with arcpy

I want to access annotation layers using arcpy (the purpose is to verify few text strings in text annotations). By annotation I mean draw tool annotations, not dynamic labels. These annotation layers ...
6
votes
1answer
711 views

ArcPy script causing python.exe to stop working (memory issue?)

I have a script written in Python that uses ArcPy to create maps of the kernel densities of thousands of datasets. Each dataset is relatively small, but there about 50,000 sets in total. When I run ...
6
votes
1answer
372 views

Using python, how do you “reload cache” an opened Attribute Table

Used python to update a shapeFile through cursors. The Shapefile is updated, but there could be an opened Attribute Table. Manually you can hit "reload cache" to update the Attribute Table and see ...
6
votes
1answer
310 views

How to access a graph in an ArcMap document with arcpy?

I am trying to access an existing graph in an ArcMap document with arcpy. I know how to create a new graph with arcpy, but I cannot seem to figure out how to access an existing graph in an ArcMap ...
6
votes
1answer
469 views

Arcpy hanging on Linux

I am having issues getting arcpy to run correctly on Linux Red Hat. I solved some earlier problems which appeared to be related to permissions on the init_server file. Now that si resolved, when I ...
6
votes
1answer
189 views

Draw middle ordinate perpendicular to chord, out to curve, with arcpy

I've been assigned to find the radius of road curves. My boss found this article describing a pretty straightforward method of doing so: find the start/end points of the curve; create a chord; ...
6
votes
1answer
369 views

ArcGIS Desktop 10.1 SP1: how to install/use additional Python modules?

I'm currently working on a project where I have to identify geomorphological features in a digital elevation model. Since the aim is to have a single ArcGIS Toolbox integrating all processing steps in ...
6
votes
1answer
435 views

How to add layer with ArcPy and retain feature class metadata (like Credits) in layer properties?

I have multiple feature classes in a geodatabase, each feature class has metadata including a Description, Credits, and other information. If I use the 'Add Data' button in ArcMap 10.1 to add one of ...
6
votes
1answer
395 views

Arcpy crashes in loop geoprocessing (general behaviour)

I have several standalone scripts that create a list of shapefiles to process (or coverages in one of the scripts). Sometimes my script crashes after it processes three files, sometimes ten, ...
6
votes
1answer
268 views

Changes in synchronized replica not shown in ArcMap or ArcCatalog without refreshing

I am synchronizing a one-way replica in ArcEditor using Python. I tried adding RefreshActiveView and RefreshCatalog to the code, but I still need to refresh the synchronized database to see the ...
6
votes
1answer
624 views

ArcGIS 10 Linux experience

We have ArcGIS 10 installed on a nice clean Linux box. We have developed scripts to run on the Windows desktop development machines, and modified them to run on Linux. Now, if we run the scripts on ...
6
votes
1answer
188 views

What percentage of ArcGIS users are using version 10.1 already?

I'm planning on building an add-in using ArcPy, but some of the functionality I need is only available in 10.1. I want to distribute this add-in and was wondering if making it 10.1 only would limit ...
6
votes
0answers
342 views

Land Classification with Spectral Python (SPy) [closed]

Does anyone have experience working with the Spectral Python module for land classification? The following k-means clustering example takes an iterative approach to classification through pixel ...
6
votes
1answer
158 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.
5
votes
5answers
365 views

How to divide a feature class into ranges?

I have a shapefile consisting of around 4000 polygons. The polygons are created from buffering around a similar number of islands somewhere in the Norwegian archipelago. Due to an error in the ...
5
votes
3answers
4k views

arcpy.MakeFeatureLayer in-memory layer still exists when subsequent step fails during testing

When I used arcgisscripting to create in-memory output layer with gp.makefeaturelayer, I would put it in a try/except block and delete the gp object in the except piece when the makefeaturelayer would ...
5
votes
2answers
4k views

How does one access a featurelayer in SDE via Python?

I am trying to use Arcpy to run the CopyFeatures_management script so that I can copy a featurelayer in SDE. What do I use for the input (and output, for that matter, since I'll be copying the layer ...
5
votes
1answer
1k views

How do I correctly use 'MultiValue' in Python script parameters?

My script works fine with a single feature class selected for clip_fc = arcpy.GetParameter(0) . However when I set clip_fc to MultiValue in the script properties and then select several feature ...
5
votes
2answers
2k views

Is it possible to access ArcGIS's table operations “Summarize…” and “Statistics…” in python?

ArcGIS has a few nifty table tools, including Summarize and Statistics. Is there a way to access them through arcpy, or will I have to hack my own methods via math and lists?
5
votes
3answers
3k views

Insert Raster to MXD using arcpy.mapping (ArcGIS 10)

What i want to do seems simple. But again i can't even find a workaround... I have got a lot of Raster-files (ESRI-GRID) which i need to insert into a layout mxd-file and then export the map to ...
5
votes
4answers
5k views

Field Calculator syntax

I can't get the syntax correct for a fairly simple if statement. Right now it looks like this: dim Output as Integer If [HECTARES] >= 30 AND [HEIGHT] >= 17 AND [CROWN] >= 59 THEN Output = ...
5
votes
2answers
372 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 ...
5
votes
2answers
918 views

How to implement bivariate Ripley's K function in ArcGIS 10?

The attached image shows a forest gap with red pine represented as circles and white pine represented as crosses. I am interested in determining if there is a positive or negative association between ...
5
votes
3answers
2k views

Does ArcPy have a spatial search function for geometry?

My problem: Using ArcPy I want to loop over buffers and select geometry_features inside each buffer and do something (update) only the objects found within that specific buffer. The code below ...
5
votes
4answers
2k views

Automate Projection of multiple shp files using ArcPy

I have been trying to create a Python script that will convert all shape files within a folder from GCS WGS 84 to Web Mercator. Below is the code I have so far but what I'm struggling with is how to ...
5
votes
4answers
252 views

How to split single address field into 4 fields (House No., Direction, Name, Suffix)

I have to do some massaging of our parcel data to make it usable by a program in sheriff helicopters. The program requires one of the following address formats within the fields: Our addresses are ...
5
votes
2answers
417 views

ArcMap Arcpy scripts: How to handle user password input?

I'm currently trying to write a script that has a username & password input which then returns some data if the user has appropriate access. The script works just fine when I hardcode my own ...
5
votes
2answers
236 views

Exit Python script in ArcGIS 10.0

I have a script with an bail-out function like so: def die(): from sys import exit exit() Occasionally in the script I check a condition and exit if necessary. This works great in 10.1, ...
5
votes
2answers
780 views

Describing a coordinate system in arcpy

I have a python script in ArcGIS 10.1 which takes in a few inputs from the user. One of the inputs is a coordinate system. I would like to test whether the coordinate system the user chose was ...