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

learn more… | top users | synonyms (1)

5
votes
1answer
227 views

Adding kernel density output to map with ArcPy

I am trying to emulate the behavior of the Kernel Density tool from the ArcMap 10 GUI in a script; in other words, I want to calculate the density of a dataset, and add the visual result to a map. If ...
2
votes
1answer
240 views

Python script for Data Driven Pages to run a series of DDP at once?

I have a several different polygon shapefiles that I am using to create individual maps for each polygon within the shapefile. The layout is the same for each map, the only thing that changes is the ...
10
votes
2answers
229 views

Count raster value in a bounding box (spatial extent)

I have simple question: given a bounding box, how can I count the number of specific values (say, I am interested in the number of value == 1 ) in a raster in 1) arcpy, or 2) raster package in R?
2
votes
1answer
238 views

Python add-in won't buffer from output layer

I have a simple add-in script for Arcmap 10.1 to create a toolbar, select a layer from a drop down list of the current layers in the project, buffer that layer four-miles, then use the resulting ...
3
votes
1answer
747 views

How to write a python script to give multiple buffers of different sizes in ArcGIS?

I want to write a loop that will cause the output to be multiple buffer shapefiles. For example I want a circle buffer of 50ft, 100ft, 150ft..... Can anyone help? I'm new to this and am trying to ...
1
vote
1answer
71 views

Change printer for a specific map document from Arcpy

Is it possible to change the printer for a particular map document from ArcPy? The mxd is saved with the default printer settings, and I know with the PrintMap() function one can specify the printer ...
3
votes
2answers
707 views

Trouble finding YMin and YMax of a shapefile in ArcMap 10 and Arcpy

I want a python script that tells me the Xmin, Xmax, Ymin, and Ymax of a polygon. (I guess this is finding the extent of a polygon?) My current script gives me the correct the Xmin and Xmax, but it ...
2
votes
1answer
582 views

Move TEXT_ELEMENT using arcpy.mapping and data driven pages

I'm customizing an automated mapping solution using arcpy.mapping and data driven pages. Using a looping statement, I'm hardcoding the position for the mapping elements (legend, north arrow, inset ...
1
vote
0answers
272 views

using copy parallel in arcpy

I'd like to use copy parallel tool with Arcpy . i tried to access copy parallel with GUID in Arcpy but i couldn't use the property and methods of this tool . i used comtype to import Arcobjects to ...
1
vote
1answer
387 views

How to calculate field as cursor name?

First time dealing with cursor. I have lines intersecting polygons, I want to get a table with all attributes of the lines, add a field and calculate the field as the name of the polygon. I was able ...
1
vote
2answers
461 views

Python scripting for ArcPad Checkin

I can use ArcGIS Desktop model builder to leverage the ArcPad Check In Tool. When I run the model it executes successfully. When I export the model as python I get this code: import arcpy # Local ...
1
vote
1answer
436 views

How to drop ArcSDE connection using Python scripting?

I want to be able to control connections to ArcSDE via python. Here is my script so far using ESRI's example. import arcpy from arcpy import env env.workspace = r"SDEConnection" fcList = ...
1
vote
1answer
121 views

Substitute for SpatialJoin tool?

I have to write a script in Arcgis which I would like to use the SpatialJoin tool (arcpy) but I do not have the appropriate extension. It may be a tool (or example of scripts) for doing the same ...
2
votes
1answer
684 views

Convert MapInfo - MapBasic Script into Python

I have a mapbasic script that divides an irregular polygon into smaller polygons of 1 hectare each. Would anyone help me to convert the following into an arcpy python script. ' This program ...
8
votes
2answers
548 views

How to bypass errors in arcpy for/while loop?

I have a handy script tool that loops through a workspace and renames and copies shapefiles to a feature dataset. However, if there is a corrupted shapefile somewhere in the workspace the script ...
0
votes
1answer
153 views

How to populate Unique ID field after sorting?

I am trying to create an new unique id field in a feature class. I already have one field called "SITE_ID_FD", but it is historical. The format of the unique value in that field isn't what our current ...
0
votes
1answer
572 views

ArcGIS/arcpy: Can a variable be set to reference an in_memory workspace object?

This is an offshoot question related to a question I posted earlier. I have the following arcpy code that inputs a Python list of polygon geometry objects to the Union_analysis tool, which then ...
0
votes
1answer
326 views

Looping Dataframe in Python doesn't Return Expected Results

I'm creating a python addin script to be used on some mxd's I have created as templates. Each map contains 2 dataframes. I need to loop through each dataframe and do some processing on each. I set my ...
0
votes
1answer
757 views

ArcGIS/arcpy: Input of in-memory geometry object to Dissolve tool in arcpy script throws Error 000732, input doesn't exist or is not supported

In an arcpy script, I run a Union on a list of geometry objects. The output is set to an empty geometry object. The Union runs fine. What I am trying to do is then feed that output into the ...
1
vote
3answers
178 views

Why do I get a no module error when I try to batch process in Arc10?

I was trying to batch reproject a set of shapefiles and I kept getting the error No OS Module As the set was relatively small I just did it individually, however I want to be able to batch process in ...
3
votes
1answer
2k 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. ...
12
votes
1answer
1k views

How do you write a Python script for repairing data sources in ArcGIS 10

So, I have about 50 mxd's with all broken layers that I have been going through and manually resetting. The data was moved from another computer and the folder structure was changed so it isn't just ...
2
votes
1answer
207 views

How do I write a script to list those layers with broken data sources?

In my SHP to GDB toolbox, I create a list of layers in MXD, then I check for those not broken I move them. Despite using ListBrokenDataSources I have errors like this: Runtime error : [Error 3] ...
1
vote
1answer
603 views

Modify dataframe extent using data driven pages and arcpy.mapping

I'm customizing an automated mapping method using arcpy.mapping and data driven pages. Essentially I have a script that loops through each page, and modifies the location of the inset map, legend, ...
3
votes
1answer
158 views

ArcObjects/VBA to python Network edge to junction lookup IEdgeFeature equivalent in arcpy

In an effort to migrate a script that transfers attributes from a geometric network to a feature class (on a given network edge segment, what are the up and downstream junctions?) I would like to ...
1
vote
0answers
110 views

How can I draw an ellipse filling the dataframe with ArcPy?

I need to modify one of my template scripts to draw a circle from the centre of the (inset) data frame to the edge of the data frame. This will then be used to clip the data frame to shape. I'm using ...
8
votes
5answers
757 views

How to split points by polygon?

I am looking for a way to split points by a county polygon feature class. The attached image shows two feature classes: one composed of points and the other a county polygon feature class. The split ...
0
votes
1answer
324 views

Parse attribute table value to export filename using data driven pages and arcpy.mapping

I'm trying to customize a data driven page looping statement workflow and want to set a better filename to the final export. Currently the file name uses the page index (pgIndex), but I would like it ...
4
votes
2answers
2k views

Create temporary files as intermediate output to be used as input in concatenation

Q_PART_I I need to merge many (MANY) tables in one unique output table by means of the arcpy.Merge_management. Anyway, I'd like to avoid the creation of tons of intermediate files as my script ...
1
vote
2answers
272 views

Cannot get arcpy.MosiacToNewRaster to work with list

Below I have a snippet of a much larger code that I cannot get to work and I am not sure why. It seems that I always have trouble using arcpy functions with rasters. Can anyone help me get this code ...
3
votes
1answer
77 views

> - operator and “Shape_Area” field in a geodatabase

this might be a pure python problem or a problem with arcpy. please help me out: min_area = float(GKPROZ_functions.min_of_field(out_name,"Shape_Area")) print area_max if min_area > ...
2
votes
2answers
964 views

Help with ListFields and CalculateField_management syntax

I need some assistance with the syntax for a CalculateField_management calculation as I have still yet to master all the python syntax rules. What I am trying to do is find the max value in a ...
6
votes
3answers
1k views

How can I select vector features that overlay raster in arcpy?

I have two datasets: point feature class and raster (stored in file geodatabase). The spatial extent of the raster is smaller than the point dataset. Is there a way I could select (or create new, ...
1
vote
1answer
200 views

Project layer with custom projection

My ultimate goal is to know UTM and UTM Northing and Easting. The data can be anywhere in North america. I calculated UTM using arcpy tool (arcpy.CalculateUTMZone_cartography) and I tried to truncate ...
4
votes
1answer
263 views

String format for geodatabases in ArcPy scripts

Several ArcPy functions take strings as geodatabase identifiers. I've looked through the ESRI docs, but can't find a good reference for the various acceptable formats. I'm looking for examples of ...
5
votes
4answers
2k views

explode overlapping polygons to new non-overlapping features

Given multiple polygons that overlap in multiple ways, I would like to export from this feature all polygons that don't overlap with others iteratively. The product would be a number of features with ...
3
votes
3answers
1k 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 ...
2
votes
1answer
148 views

Import 3D Analyst Functions With ArcPy

This really seems like I should be able to do this, but I am running into some problems. I want to import 3D Analyst with python, in the same way I import Spatial Analyst, but it returns an error. ...
1
vote
1answer
186 views

AddLayer method does not add all bands of .tif image (3 bands total)

I am currently having trouble getting 3-band raster's to display correctly when I call the arcpy.mapping.AddLayer() method. It should be said that I am using a pre-existing mxd template to automate ...
4
votes
1answer
665 views

How do you add a long list of rasters together in Python?

If you have produced a long list of rasters (lets say 50) and want to add them together, is there any shorter way to write in python rather than typing all the inputs, like so: outRas = inRas1 + ...
5
votes
1answer
202 views

Is it possible to install ArcPy on a server for use in a geoprocessing web application?

I have a website on my intranet and would like to add some geoprocessing tools to it with Python. Many Users will not have Arc installed on their machines, so I think I need to have the scripts set ...
3
votes
1answer
442 views

Create a new Dataframe using Arcpy in 10.1

Does anyone know if there is a way to create a new empty dataframe in ArcMap 10.1 using Arcpy? Thanks
7
votes
2answers
2k views

How to find the mid-point of a line in arcpy

How can the mid-point of a polyline be calculated using the geoprocessing framework, eg in a Python script? The polyline.centroid property returns The true centroid if it is within or on the feature; ...
2
votes
1answer
177 views

arcpy Tool works in debug mode but not in normal model

When I try to run the following simple script from arcmap it fails but when run using right--click debug and then F9 (debug) in python scripter it works fine. I don't understand why??? # Modified ...
0
votes
1answer
352 views

Failed to open raster - ArcGIS 10 SP2, Python 2.6.5, Windows 7

I have an arcpy / python script that is working fine with ArcMap 10 no Service pack (Build 2414) on windows XP, but consistently failing on using ArcMap 10 SP2 (Build 3200). Getting the ESRI 99999 ...
17
votes
5answers
5k views

Ways to Speed Up Python Scripts Running As ArcGIS Tools

This is a pretty general question. I just wondering what tips and tricks GIS programmers have used to speed up arcpy scripts that you import into the toolbox and run. I work most everyday writing ...
5
votes
3answers
3k views

How do I retrieve start and end point coordinates with Python/arcpy?

How do I retrieve start and end point coordinates with Python/arcpy for a polyline feature class? I expect to pass a segment identifier to a subroutine and have it pass back start and end coordinates. ...
6
votes
1answer
307 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 ...
4
votes
2answers
2k views

How to create reports in ArcGIS using Python?

Does anyone have experience in creating reports from your ArcGIS data (geodatabase, map exports) using a python reporting engine? In my current project, we are using Jasper Reports in the following ...
0
votes
2answers
345 views

Why does TableToTable give ERROR 000732 when published to ArcGIS Server?

I have a python code that uses ArcPy command "arcpy.TableToTable_conversion" to convert a database table to a dbf file. arcpy.TableToTable_conversion The input table is from a SQL Server database ...