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

learn more… | top users | synonyms (1)

5
votes
1answer
547 views

Determining ESRI File Geodatabase release version?

Is there any method in Python, ArcObjects, or the File GDB API for determining the release version (9.3, 10.0, etc.) of a file geodatabase? There is a need to find all of our shared 10.0 version file ...
5
votes
1answer
2k views

Is there a way to delete a raster using arcpy / ArcGIS 10.0?

I'm trying to find a way to delete a raster dataset (in any format) using arcpy. As it is now I have been writing custom functions for each file type (eg, delete directory and pyramids for grids, ...
5
votes
1answer
125 views

Pause ArcPy script until feature class lock goes away

My script needs to copy data into a feature class to an SDE geodatabase that might have a lock on it from another application. I shouldn't break the lock (that app has priority over a data update), ...
5
votes
1answer
387 views

Is there a way to use ArcPy module in the python shell that is not with ArcGIS?

I have ArcGIS 10.2 installed on my machine. When ArcGIS was installed, python 2.7.3(32 bits) was also installed. I need python 2.7.5 64bits for some gdal functions. So I installed python 2.7.5 64bits ...
5
votes
1answer
569 views

How to select specific row in attribute table using ArcPy (without iterating through whole table)?

I am using ArcGIS 10.2 and have assumed until now that it is possible to select a specific row in an attribute table. However, I can't seem to find a way to do this. The only available methods seem to ...
5
votes
2answers
204 views

Using newly created features in the next part of a python script

Good Afternoon I am trying to write a python script which buffers a large number of features from a geodatabase (but not all) and then dissolves the newly created buffer shapefiles together. ...
5
votes
1answer
2k views

Copy a polygon geometry in Arcpy

This to me sounded very simple so I am probably missing something basic here. What I need to do is to create a copy of a polygon shapefile to a new shapefile with slightly different attributes. Where ...
5
votes
1answer
3k views

How to programmatically add shapefile to data frame in Arcmap

I have a toolbox with python script which creates a shapefile from JSON txt file, but it does not show the generated shapefile in arcmap, i have to add it from the output location. What code shall I ...
5
votes
2answers
1k views

Calculating slope cell-by-cell in ArcPy

I am relatively new to the ArcGIS-Python environment and want to calculate elevation raster slope. But it says "ValueError: setting an array element with a sequence". Below code is what I have. Any ...
5
votes
4answers
6k views

How to use Arcpy UpdateCursor to update a field?

This should be simple but I've spent days trying everything to get it to work. I need to update a field in a layer based on two other fields. I can't even get it to update based on one field. Could ...
5
votes
2answers
2k views

How do I calculate a weighted centroid with respect to a raster, e.g. population weighted centroid

In ArcGIS 10.0, how do I calculate the weighted centroid of a collection of polygons, where I want the weight to be a raster layer. In particular I am using a raster of population counts and would ...
5
votes
2answers
167 views

Arcpy: Names and distances of nearest intersecting roads in layer 1 to end points of a road segment from layer 2

As shown in the image below, I'd like to return a new field in layer 2 that for each segment stores a string:"Road C, 1 km from Road A to 0.5km From Road B". Calculation of the distances could be ...
5
votes
2answers
1k views

How to get sum of table column values into Python variable?

Im creating a script to calculate some new fields in Arcgis10.1 using the arcpy library. I need to sum the total of a table column in order to calculate a new field. I wanted to ask if it is possible ...
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 ...
5
votes
1answer
360 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 ...
5
votes
2answers
673 views

Problem with the where clause in ArcGIS when dealing with variables

I am writing a python script for ArcGIS. I have an input feature class which contains multiple pipelines which is saved as a variable InputPipeline. I would like to iterate through the pipelines and ...
5
votes
2answers
2k views

Clipping raster by multiple datasets or polygons?

I would like to clip a DEM using a grid of polygons. It's probably easier to use multiple polygons in one shape file, but I haven't managed this so I'm trying to use a for loop so I can loop through ...
5
votes
3answers
3k views

How to create lines from points pair coordinates with arcpy?

I've got some points pair coordinates (start and end points) which I have to transform into lines. Until now, I used an append of both the coordinates in a pippo.Point(), a pippo.CalculateGeometry() ...
5
votes
2answers
896 views

How to check if domain already exists?

I am trying to check the existence of domains in my file geodatabase which contains 4 domains (automatically populated after I created some annotation feature classes). My code is as follows: import ...
5
votes
2answers
727 views

Create a polyline buffer with Arcpy

I'm trying to write a python script with ArcPy that draws arcs and I've achieved something with creating a buffer and then clipping it with a bounding box so I only keep the length I need (I thought ...
5
votes
2answers
2k views

Using SearchCursor to access & export values in a raster table

I am desperately trying to export the values in a raster table to a .txt file. I've seen some other folk post about this, but for some reason can't get the code to work in my case. I have a raster, ...
5
votes
1answer
4k views

Arcpy cursors, WHERE clauses, and date/time fields

I'm having trouble making a selection of rows that meet certain date criteria using my arcpy.UpdateCursor(). I need to update records in a field in a geodatabase table with an ascending value based on ...
5
votes
1answer
2k views

Create a definition query for groups of layers: Is it possible?

I have a large number of groups created, with each group having many layers. I have looked for a way to set a definition query for all the layers in each group but haven't found anything. Is it even ...
5
votes
2answers
173 views

What are the alternatives to ArcMap's Report Wizard?

I have a polygon layer which has lots of attributes, and I'd like to create a report template which summarises these attributes for individual polygons. That is, the user will select a polygon from ...
5
votes
1answer
265 views

Arcpy Pythonaddins Equivalent of arcpy.GetParameterAsText

I've build a neat little search arcpy script. The user opens any mxd, zooms to a location, chooses a corporate fGDB, and runs the tool. The user gets a list of all the populated feature class that ...
5
votes
1answer
283 views

data driven pages format

I have an issue, but I don't even know the terms needed to search for an answer. I'm exporting the pages to png files. The pages are divided by lots. Each page has a label with the lot number. In ...
5
votes
2answers
588 views

How to create Network Dataset for Network Assistant using ArcPy?

Is it possible to create a network dataset with ArcPy to be used with the network assistant? In the documentation I found the Build Network and Dissolve Network functions, but it looks like both ...
5
votes
5answers
919 views

How to add Radio Buttons to Python Script tool dialog?

I have 3 Point shapefiles for 3 species that contains the accession points of each. The user needs to specify only one species at a time. I need to write a script tool for adding the selected Point ...
5
votes
1answer
655 views

problem with “Con” conditional expression

I created a python script where I use Con (Spatial Analyst). Till now I passed the where clause value as value>1000 and it worked fine for me. But recently I found some raster on which Con ...
5
votes
2answers
3k views

How to clip/export multiple selected vector layers in a map to extent of another raster/vector layer in ArcGIS?

Is there a way to clip/export selected vector layers (more than one) in a map to the extent of another raster/vector layer at a time?? in Arcgis or any other software. I am using Arcgis10. I am ...
5
votes
3answers
533 views

How not to Copy Features when too many would be output?

This question has already been posed to the ArcGIS Geoprocessing forum but I have had no responses there. I have a 3.5 million polygon layer (cadastre) stored in Oracle via ArcSDE. I use a polygon ...
5
votes
3answers
4k views

Select Layer By Attribute using loop

I have 273 features in the feature class and i want to select them one by one and use the statement in the following code. At the line: *arcpy.SelectLayerByAttribute_management ...
5
votes
1answer
771 views

arcpy.mapping.ListLayoutElements() takes longer in a tool than in ArcMap

Has anyone else noticed that accessing elements from arcpy.mapping.ListLayoutElements() through a tool script takes longer than within ArcMap? Whether using a specific name, wildcard or nothing, the ...
5
votes
2answers
2k views

(New at Python Scripting) Creating a Loop so i can replace text in page layout in multiple mxds instead of one mxd at a time

I found some code on a website that will perform a search and replace on page layout text elements. Currently you can only do it one MXD at a time. I was hoping to change the code so I can do a search ...
5
votes
2answers
237 views

Creating numpy.array with variable number of fields to test arcpy.da.ExtendTable performance?

There was an ArcPy Café blog posting entitled Adding Fields: Performance Tips which advocated: Two approaches to help increase performance when adding numerous fields to a table or feature ...
5
votes
1answer
619 views

How to automatically generate useful scales for data driven pages in ArcGIS desktop

I have been tasked with creating several hundred maps of properties that intersect a long pipeline. The maps will zoom to the part of the property which shows the intersection. The lengths of ...
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 ...
5
votes
2answers
329 views

Error 000725 message from output workspace when using Python (ArcPy) script tool?

I am having trouble running a script tool that I just created in Arc 10.1. The script runs fine in PythonWin, but when I create a script tool with it, the tool seems to not want to accept folders or ...
5
votes
1answer
287 views

What is the most efficient way to get a list of featureclasses from a large ArcSDE database?

I have a SDE DB which consists of 40 feature datasets and around 300 featureclasses. I need to get the full list of all featureclasses whose name does not contain "ARCHIVE". It takes several minutes ...
5
votes
3answers
612 views

Convert polyline with Left ID and Right ID to polygons with ID

I have a polyline shape file which contain Left Id and Right ID information and struggling in converting this polyline layer to polygon with ID via arcpy. I am using ArcGIS(editor) license so feature ...
5
votes
1answer
61 views

PySAL natural breaks from Numpy array

I am attempting to extract natural break values from a raster using Python. The intended process goes: Arcpy raster object to NumPy Array (using RasterToNumPyArray) to natural break values (using ...
5
votes
1answer
117 views

Calculate the common area between polygons using python?

I am trying to calculate the common "empty" area between the neighbouring polygons in order to calculate the porosity volume (the red area in the image) My idea was, first to use Convert ...
5
votes
1answer
114 views

Is it possible to drive one mxd (pan) using a different mxd with python?

I have 2 mxd's. mxdA and mxdB They both show different data, but are both in the same coordinate system. I want to be able to sync mxdB with mxdA, so that if I pan / zoom in mxdA, I can then, with ...
5
votes
1answer
309 views

How to get the editor's current layer in ArcPy?

In ArcObjects, it is possible to retrieve the currently selected editable layer using IEditor3.CurrentTemplate.Layer, or IEditLayers.CurrentLayer. Is it possible to do the same thing in ArcPy? In ...
5
votes
2answers
203 views

How to check if Waste-Water Manhole connect to lines with the right flow direction?

I have a waste-water geometric network with flow direction throw digitize direction. I want to check if each manhole have a line flowing in and a line flowing out. Is there an attribute of line vertex ...
5
votes
2answers
1k views

How to copy an SDE geodatabase to a file geodatabase using Python?

I would like to make an exact copy (domains, feature datasets, feature classes, etc.) of an SDE database to a file geodatabase. I have tried several possibilities, including: using the Copy (Data ...
5
votes
1answer
680 views

How to arcpy.Describe() a layer when script is run from outside of ArcMap?

The following code will work if I run it from the ArcMap Python dialog, or from a GP tool, but not from PyScripter IDE: import arcpy mxd = ...
5
votes
1answer
183 views

Why do ECWs go missing when exporting MXD to PDF with ArcPy?

I'm trying to export some MXD maps to PDF with arcpy (ArcGIS 10.1). Everything works fine and dandy except for ECW images, which don't appear in the PDF. However, when I execute the same code from the ...
5
votes
2answers
374 views

SelectLayerByLocation not Selecting

I have been trying for some time now to create a script to extract the polygons within an extent, but am unable to get the same result as when I use the user interface manual method. Maybe someone ...
5
votes
3answers
2k views

Table to table script using Excel sheets (not workbooks) arcpy

So what I'm trying to do is to create feature classes from the sheets in an Excel table. I can get it to work if I save each excel sheet as its own workbook, however this isn't really what I want. I ...