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

learn more… | top users | synonyms (1)

5
votes
2answers
1k views

What is Quickest way to Copy Single Selected Polygon from Very Large ArcSDE Feature Class?

I have selected a single polygon, which is large but not massively complex, from an ArcSDE 9.3 for Oracle feature class with 3.5 million polygons using ArcGIS Desktop 10.0 SP3. I would simply like ...
5
votes
1answer
62 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
127 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
116 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
136 views

Can ArcPy fill forms in Add-in interface?

I'm trying to build an ArcPy tool, which will ask the user to input some information (ID, Name, Address, Zip, etc.) first. My add-in interface is shown below, and hope to implement that once the user ...
5
votes
1answer
333 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
205 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
717 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
188 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
382 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 ...
5
votes
3answers
318 views

What's the centerline of a peninsula?

Given a peninsula stretching north south and the two coast lines connecting in the south, I want to find out which is the place, or rather line, which is furthest away from both coastlines on the ...
5
votes
1answer
1k views

How to update shapefile data source in multiple dataframes and mxds using lyr.replaceDataSource and Python dictionary?

After reorganizing the file structure for some of our GIS base data files I need a script to update the data sources for ~ 100 shapefiles in about 50 mxd files. Some of the mxds have multiple data ...
5
votes
2answers
947 views

How to improve Python script processing speed (performance)?

I've been working on a script which essentially reads in a large amount of point and polygon data and generates frequency values for a featureclass of 2.5 acre hexes covering California. I have found ...
5
votes
1answer
2k views

Exporting map to jpg (multiple times with python)?

I set symbology and exported each raster in my mxd (one by one) to jpg file. My script is ok and it works (it is shown at the bottom). The question is: how can I customly set my legend? Now I have ...
5
votes
3answers
1k views

How to repair paths of an unmanaged raster catalog in file GDB?

I'm using ArcGIS 9.3.1 and I have an unmanaged file geodatabase with raster catalogs in it. Tiles are loaded inside the catalog and each tile has a "Full Path" property which is environment specific. ...
5
votes
1answer
607 views

Is there a way to get layers from a .msd using arcpy?

I need the name of each layer in an .msd, but I could not find support using arcpy (ArcGIS 10.0). Is there a method I missed? In the current workflow, since I am publishing the document, I use the ...
5
votes
2answers
409 views

ArcMap Draw Camera Range with ArcPy

i am working on some camera data. I have some points which consist of azimuth, angle, distance, and of course coordinate field attributes. In arcmap I want to draw shapes like this: The shape is ...
5
votes
2answers
2k views

Efficiency of python script using SAGA and arcpy

=== SUMMARY === I have created a process to import a LAS point cloud, clip it, select the ground points and save the output as an XYZ.txt for clients to use. This uses a python based script (will ...
5
votes
2answers
3k views

Cannot get rid of lock on file geodatabase and feature class created in Python script

I have a python script, (for ArcGIS 10), that creates a new file geodatabase, creates a new feature class in that file geodatabase and then reads data from an SDE feature class to populate the new ...
5
votes
1answer
197 views

Is there a way to find out which pixel values are around the current pixel?

I would like to write a cycle which takes a current pixel, look at the surrounding pixels, choose the pixel with max/min value and skip to that pixel...and so on. Is there in arcpy such a function ...
5
votes
1answer
324 views

Does arcpy have a method for accessing related records within a cursor?

I have a line feature class that represent sampling segments. I have a data table of field notes in the same Geodatabase that is connected to the feature class with a Relationship Class. Is there a ...
5
votes
1answer
743 views

Using ArcPy to batch merge based on shapefile name?

ArcGIS 10 SP4 Python 2.6.5 I have quite a few shapefiles that are in many different directories. I'd like to pull out groups of like shapefiles, merge them, and move the results into a FGDB. I've ...
5
votes
2answers
226 views

Is there a way to increase the search radius of nearest neighbors for the Nibble tool?

I am working with a raster map vegetation types. I have about 20 types with unique raster code values that can be sorted into three classes: 1 - vegetation types I want to expand using the nibble ...
5
votes
1answer
2k views

ArcGIS 10.1 ERROR 000824: The tool is not licensed in arcpy

I try to run the Zonal Statistic as a Table through arcpy and it gives me: ERROR 000824: The tool is not licensed. Here is the doc for the function: ...
5
votes
1answer
198 views

parallelization of raster mosaic

I would like to create a raster mosaic of the national USGS NED 30m DEM (~50 GB). I'd like to leverage parallel processing using python multiprocessing module where possible. I'm using ArcGIS 10.0. My ...
5
votes
1answer
178 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 ...
5
votes
1answer
80 views

Is there an arcpy equivalent to IPixelBlock in ArcObjects?

Trying to figure out a way of doing this via arcpy, but don't see anything remotely related to this. My raster dataset is a GRID. 'pPixBlock is an IPixelBlock 'sets raster to be one column ...
5
votes
1answer
262 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 ...
5
votes
3answers
1k views

Using arcpy what is the most efficient way of projecting a selection from a large data set?

I have a large data set X(x1-xn) from which I must select consecutively the attributes A(a1-an) from X.fieldsSRC or X.fieldDST and project the selections. I have a functioning arcpy script that does ...
5
votes
2answers
121 views

Efficient way to use a CSV to Define a Feature Class

I was provided an Excel Spreadsheet which had the definitions of fields for a feature class. There were several worksheets in the file, each containing field definitions for different feature ...
5
votes
1answer
304 views

Can ArcPy 10.1 be used to generate true curve elliptical polygons in a file geodatabase?

As background, this question arose from trying to answer a question on How to generate overlapping polygons from lines output from Table To Ellipse tool? Using the ArcMap GUI it is very easy to ...
5
votes
3answers
1k 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 ...
5
votes
1answer
742 views

Stop an arcgis model until all values are collected and then continue

This is similar to Modelbuilder - If precondition is false, continue iterating next input but I want the iterate tool to run to collect all the values and only then continue to the merge. Any ideas? ...
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
2answers
766 views

In ArcPy, how can I save a clipped raster dataset to memory (not to file)?

I've been trying to clip a larger raster dataset by a polygon extent, where the resulting clipped raster dataset is saved in-memory. So far, my attempts produce vague errors. >>> ...
4
votes
3answers
628 views

How can I have ArcGIS not automatically add raster clip output from Python window to the current map

I have a collection of rasters that I'm writing code to automate clipping based on a user defined shapefile. I am currently doing this in the Python window using the following as the main processing ...
4
votes
4answers
496 views

How to rename a file in the output (ArcGIS python)?

raslist=arcpy.ListRasters() for ras in raslist: arcpy.ProjectRaster_management(ras,outfolder2+ras+'_Albers',spatialref2) print ras+' has been reprojected' I was using the above code for ...
4
votes
3answers
360 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?
4
votes
2answers
806 views

Python - Check for number of shapefiles in a directory

I want to test: to see whether or not ONE AND ONLY ONE shapefile (which will be based on a filename wildcard) exists in a directory. Add these shapefiles to a list Use this list variable as an ...
4
votes
3answers
5k views

ArcGIS 10/arcpy: Help needed with syntax for CalculateField_management in Python script

I need to use CalculateField_management in a Python script, and the calc expression needs to concatenate a runtime variable, a string, and a field (string) value. I have searched all over for ...
4
votes
2answers
5k views

Change Symbology of layers from within ArcMap

Cheers, In an active Arc Map session - I want to change the symbology of a layer which is repeated multiple times in the mxd. Can I do this? The basic code I have for getting the layers is below. ...
4
votes
3answers
524 views

Checking if python script is run from ArcGIS (arcmap or on server) or a stand alone python script

For debugging purposes I have created a hardcoded conditional that checks it the script is run as stand alone or as an ArcGIS tool. Is there anyway to fugure this out at run time? e.g. some ...
4
votes
2answers
1k views

How to get an extent for Raster using python

I have to get an extent of a given raster so that I can save it and use the same to clip another raster with that extracted extent. As of now I am stuck in the extent part. import arcpy from arcpy ...
4
votes
2answers
1k views

Python method for finding a substring within a string

I converted a KML to a feature class and no longer have access to the symbology set in the original KML. I'm trying to re-create this by creating a new field that stores identifying information ...
4
votes
2answers
107 views

Selecting points on one side of the road

I am a newby in python scripting in GIS. I have 2 shapefile: first one with roads and second one with points that contains address number and street name. I want to select these points from right ...
4
votes
2answers
220 views

Is it a bad idea to convert a File Geodatabase table to a dictionary?

First, what am I trying to do? I am building a Python script that should be called from an ArcMap 10.0 toolbox. This scripts uses (among other inputs) data contained in huge gdb tables. It processes ...
4
votes
4answers
646 views

How to convert all values in all fields of table to upper case using ArcPy & Python?

Does anyone know how to use the .upper() in a stand alone python script so it can be used to change all characters in a table into UPPER case? I don't want to use the field calculator since I have ...
4
votes
2answers
1k views

How to copy selected (targeted) features to new shapefile using ArcPy?

I'm trying to copy specific attribute table rows from one shapefile to a new shapefile that will contain only the specified rows in its attribute table, that is, if a field GDP_TOP10 = 1. I'm using ...