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

learn more… | top users | synonyms (1)

0
votes
1answer
1k views

Runtime error <type 'exceptions.TypeError'>: 'unicode' object is not callable

I'm working on a script to replace a layer datasource, and I'm getting an error I cannot figure out. When I run the following code in a python window inside ArcMap, I get a "Runtime error : 'unicode' ...
5
votes
2answers
932 views

Merge Spatially Coincident Features in the Same Feature Class

I need a way to programatically merge grid cells (polygon 15x15m) that are directly on top of each other and add together some of their attributes. I am working in ArcGIS 10.1 with the data stored as ...
4
votes
4answers
196 views

How to determine if all points on a map are identical in arcpy?

My eventual goal is to automate kernel density calculations for a large corpus of point data; however, if all points are identical (for example, if there are 7 points all stacked on top of one another ...
1
vote
1answer
314 views

arcpy JoinField_managment RuntimeError

So, I've been banging my head against the wall the last few days trying to figure out what's wrong with my script. It's suppose to pull weekly flu data from a department of health website, parse it ...
4
votes
1answer
145 views

How to stack rasters for ecological analysis?

The attached image shows two different forest openings. Each opening has the following layers associated with it: Point shapefile 1 = A red X which represent a large "legacy" tree in the gap Point ...
1
vote
1answer
757 views

Error code 500 at REST Endpoint of published geoprocessing service - Problem with output parameter type?

Using ArcGIS 10.1 (Server and Desktop) I've been trying to publish a geoprocessing service based on a python script I wrote. Of course, it all works flawlessly from ArcGIS Desktop but I run into all ...
4
votes
1answer
142 views

convert a dbf into a raster image using python? work around for arcpy

ArcGIS' arcpy does not have a function to add a table to a layout. I was thinking that maybe taking that table (e.g. a dbf), there may be some python script command to turn it into a raster (e.g. do ...
8
votes
2answers
2k views

How to reclassify a very large land cover dataset?

Consider the NLCD2001 Land Cover dataset for Alaska (download link). I need to reclassify this dataset so that only pixels of value 41, 42, and 43 are preserved; all other pixel values should become ...
0
votes
1answer
215 views

Problem with Extend Line tool in Arcpy

I have a problem with Extend Line tool in Arcpy, it cannot extend some lines, i tried to get around by erasing the edges of lines that i want to extend without failure, but despite this some fewer ...
5
votes
1answer
97 views

Is there any restriction on file size while using arcgis tool box or arcpy methods

I am working with ArcToolBox's tools and their python supports. I found there is some restriction on file size of shape files/feature classes etc. It makes me interested to know about is there any ...
2
votes
0answers
257 views

Problem with SplitLineAtPoint tool in arcpy

I have a problem with Split Line At Point and polygons which have been dissolved using arcpy.Dissolve_management. When I try this model to get polygon contour split at some points. ...
5
votes
2answers
1k 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 ...
4
votes
1answer
101 views

How to detect densely labelled areas?

I'm trying to detect densely labelled areas for a given scale like explained below. so dense labelled area is the area having high rate of overlapping labels. I'd like to detect densely labelled ...
4
votes
4answers
913 views

Arcpy add and calculate fields for features in a list

I have a script I am working on and am hitting a runtime error. I am attempting to create a list of all of the shapefiles within a root directory, then add a field to each shapefile and calculate it ...
1
vote
0answers
297 views

Algorithm to place the minimum of rectangles to cover a polygon

I'm trying to cover a polygon with the minimum set of rectangles like explained in the picture below, the used rectangles have the same size a*b (a != b) , the rectangle could be rotated by ...
9
votes
2answers
4k views

How to get list of selected features in ArcGIS for Desktop using Python code?

I have a question regarding selections in ArcGIS for Desktop. Assumed I have one layer in ArcMap and I have selected two of five features. Is it possible to get a list of all selected features by ...
4
votes
1answer
146 views

Map automation, create and populate inset maps for densely-labelled areas

I would like to know if it is possible to automate the example in the picture below, unlike the picture below i'm using vector data. I would like for a fixed scale generate map, but when labels are ...
4
votes
3answers
1k views

How do I access an attribute table within a shapefile and replace values?

I would like to find a Python script that will access an attribute table within a shapefile and either update or replace records inside a field column. More specifically, I would like to use the ...
4
votes
1answer
659 views

How to write values from arcpy statistical output to table?

The attached script is my stalled attempt to perform the following workflow: Create a table and create fields Loop through a folder of point shapefiles and perform average nearest neighbor analysis ...
3
votes
1answer
475 views

Zoom to Shapefile attribute table row feature

I am working with the python code below in ArcGIS to zoom into a shapefile's attribute table row features without selected until the end of table one by one. I am trying to use this code but this one ...
11
votes
4answers
5k views

How to manually break statement execution in python console of ArcMap

How does one break the execution of a long-running process in the python console of ArcMap? For example, how do you break a long iteration like the one below once it is started? for i in range(1, ...
3
votes
0answers
101 views

Why aren't a layer's serviceProperties exposed if the data source is broken? [closed]

In ArcObjects you can get the service properties of a map layer by looking at its IWorkspaceName.ConnectionProperties property set, even if the layer is currently invalid due to a broken connection. ...
4
votes
1answer
274 views

Getting buffer wizard-like speed in Python (vs using MultipleRingBuffer_analysis)

I've got a script that takes a single input polygon feature, throws 10 buffers around it at tenths of a specified input distance, and then symbolises the output based on an existing layer file. ...
0
votes
1answer
669 views

Using arcpy to set field values for all features within each polygon of a separate feature class

I am trying to set a field value in one feature class (TRU) based on the value of a field in a separate feature class (DerivedBoundaries) that contains the first, using python in ArcGIS 10.1. I have ...
2
votes
2answers
287 views

arcpy.mapping.AddLayer invisible layer

I'm having a bit of a problem with a script on a particular machine. ========================================================== import arcpy,sys class AddLayer(object): ''' classdocs ...
4
votes
1answer
1k views

How to List field name aliases in ONE shapefile/layer using ArcPy?

I want to use arcpy/python to print out a list of all the field name aliases for a specified shapefile. So far I have been able to hack a script I found to list all the field name aliases associated ...
4
votes
1answer
2k views

How to find and delete identical points?

I recently performed Integrate on a merged point feature class in ArcGIS 10.1. I specified "1 meter" XY tolerance for the Integrate command. The resulting point feature appears to be what I want ...
8
votes
1answer
170 views

The role of '#' in a python 'if':

I recently exported an ArcGIS model to python and was reviewing the script and am confused by the following line: if TRU_W_DatableFeatures == '#' or not TRU_W_DatableFeatures: I can't seem to find ...
3
votes
2answers
548 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 ...
5
votes
1answer
169 views

Why Can't ArcPy Search the Newly Created Feature

I'm running the following tool in ArcGIS 10. I have an ArcPy Script like this: import arcpy from arcpy import env env.workspace=r"C:/sde/lcimrl.sde" fc="SDE.ATTACHMENTS\SDE.attachment_points" fcRows ...
0
votes
1answer
656 views

ListFields (arcpy) not reading from layer

I have a very simple python script that opens an mxd from a folder and then loops through each layer, and finds a ObjectID field and changes the alias name. #setup import arcpy from arcpy import env ...
1
vote
0answers
85 views

Why does the method partCount in ArcGIS always give back a value of 1?

Does anyone knows why method "partCount" in arcgis version 10.0 always gives me back value 1, even when I have object with interniorring or multipart object? partnum = 0 partcount = feat.partCount ...
5
votes
1answer
1k views

How to Make a New Shapefile Based on Attributes of an Existing Shapefile?

In my last post I had an issue where I wanted to create multiple shapefiles based on only one attribute field (years). How to do it was answered in that post. I want to make that tool more dynamic so ...
2
votes
1answer
106 views

How to get empty gdb using python

I have one gdb with lots of layer (~500) and to receive empty gdb I delete all records from layers. I Use deleterows / TruncateTable but for one layers take abaut 1-3 minuts. Is better way (faster) ...
1
vote
1answer
90 views

sa.fill creates NoData raster in standalone script ArcMap 10.0

I am trying to put together a geoprocessing workflow in Python, and I've hit a stumbling block with sa.fill. When run as a standalone script, the tool produces a raster composed entirely of NoData ...
0
votes
2answers
234 views

How to create a route and add that route as layer to map using ArcPy?

I wrote a little script for ArcGis, and when I make it run by GUI it happens that it seems to create routes but the routes do not appear in the TOC. Consequently, when the script tries to execute ...
3
votes
1answer
322 views

How to best organize files for a large arcpy script tool?

I am writing a lengthy arcpy tool and am working with multiple python scripts, simply for organization's sake. Everything runs well when I run it from the command line, but now that I am starting to ...
4
votes
3answers
2k views

Why does arcpy.ImportToolbox() not work in ArcGIS 10 (SP5) when calling custom model for topology?

I have an arcpy/python script using ArcGIS10 and using a custom toolbox and model. The toolbox has an alias of defaultTopo and my model within the toolbox is called AddRuleToTopologyModel. This model ...
2
votes
1answer
392 views

arcpy.AddMessage and codepage problems

Some times in my tools I need to output Cyrillic text via arcpy.AddMessage function. Previously in 10.0 it was very easy. I had .py file of the tool saved in UTF8 codepage. This code wrote messages ...
6
votes
3answers
216 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 ...
4
votes
3answers
339 views

Is there anything faster than a cursor in ArcGIS to calculate records?

What is the most efficient (fastest) way to calculate records in a layer in ArcGIS? Is there anything faster than the Cursor in ArcGIS?
7
votes
1answer
1k views

Guidelines for organizing Python Toolboxes (.pyt) in ArcGIS

For one of my tasks I need to create a Toolbox with three tools (python scripts). Instead of ordinary tbx I've decided to write it as Python Toolbox (pyt). Everything is clear except the "good" way ...
1
vote
2answers
496 views

Arcpy (10.0) and centroids/points shapefile

I'm trying to create a point shapefile from a grid index polygon shapefile I created using arcpy. I know this is simple, but could anyone give a few pointers out there. Here is what I've done now: but ...
2
votes
1answer
344 views

How do I select * rows of multiple columns in one query using Select by Attributes within ArcMap?

I am trying to convert a psql query string into arcpy formatting for an UpdateCursor where expression parameter: '''SELECT ...
5
votes
2answers
1k views

How to replace arcpy.CalculateField_management with an update cursor?

I'd like to replace this expression arcpy.CalculateField_management(bufferFile, "Shape_Area", "float('!shape.area@squaremeters!')", "PYTHON") with an arcpy.da.updatecursor. The reason for this is ...
0
votes
0answers
143 views

Can I do full SQL expressions through the “WHERE” clause in UpdateCursor?

Run as a standalone python script for a shapefile in a toolbox on ArcMap. For example: psql_url_pop = '''SELECT shapefile.NAME_# + shapefile.WIKI_URL FROM public.shapefile''' rows = ...
5
votes
1answer
352 views

Good practices for storing connection info while deploying geoprocessing tool on Server

I have a geoprocessing tool written in python. It will be deployed on ArcGIS for Server 10.1 as a GeoProcessing Service and it's processing workflow includes some manipulations with data in SDE ...
4
votes
1answer
304 views

Is it possible to run an arcpy execute SQL method without connecting to any database or server?

I want to simply process a layer by writing a tool script in a toolbox without having to connect any database, so I think I may have to set up a workspace environment in ArcMap, but I'm not sure if I ...
1
vote
1answer
556 views

How to use python to export ArcGIS Server Map Service Properties?

What arcpy module can I use to write a python script to mine for fields of my map service properties and export them to a .tx file? I assume we need to tap into GIS Servers within the ArcCatalog ...
4
votes
1answer
255 views

How to join MySQL data with GIS data using arcpy?

Here is my problem, I have a MySQL database with table in it that has 4 columns: ID, Owner, Address, Legal. And I also have an ArcGIS GDB that has a parcel layer that has in it a PID field. I am ...