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

learn more… | top users | synonyms (1)

5
votes
1answer
163 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
270 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
667 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
219 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
168 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
79 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
251 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
1answer
3k views

Lidar - Automated building extraction (Improve Process)

I have the following process for automatically creating building outlines/footprints from Las files and was wondering if anyone can help improve it or has suggestions for other processes to use? ...
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
105 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
277 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
2answers
924 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
3answers
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
1k views

arcpy: Compare extents of rasters

I am writing a script that takes an input of an Area of Interest (AOI) and then walks through the base directories to find any file that has an extent that intersects with the AOI, clip it and ...
5
votes
1answer
629 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
6answers
2k views

How to move / offset point locations using ModelBuilder or ArcPy

I have a number non-georeferenced CAD layers (see this question) that have text annotation features. I have created a model to convert the text to points, but after converting the annotation to a ...
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
711 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
4answers
434 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
336 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
763 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
4k 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
941 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
3answers
564 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
2answers
192 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
479 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 ...
4
votes
2answers
1k views

How to programmatically work with featureclasses from multiple geodatabases?

I have produced a Python script which creates multiple buffers of specific (listed) featureclasses within a geodatabase. This is achieved by running each feature through a for loop. I would like to ...
4
votes
1answer
173 views

Determining Shape Area Field Name

I'm dealing with a varierty of spatial polygon files (shapefiles, file/personal gdb feature classes, sde feature classes (some with spatial views)) and depending on the file type, I get a mulittude of ...
4
votes
3answers
461 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
1answer
2k views

How to Export Selected Feature to New Shapefile Using ArcPy?

I currently have a search cursor iterating through a shapefile in ArcGIS 10.1 that selects a feature and runs a viewshed analysis on that feature (and only that feature). What's the easiest way to ...
4
votes
2answers
440 views

Does ArcPy leak memory when importing CSV files?

I'm trying to import a great number of csv files of about 250MB each. I wrote a python script for that as follows: import gc import glob tables = ...
4
votes
5answers
747 views

Python loop Polygon to raster not working

I want to convert a large number of different shp polygons to raster in ArcGIS 10.1, using an existing field column "class" for the new raster classes. I am not very fluent in python but I thought ...
4
votes
3answers
999 views

How integrated can an IDE get for arcpy scripting?

I am looking to develop arcpy scripts (ArcGIS 10.1) in an IDE that is more "integrated" than Pythonwin. I would like an experience that is analagous to programming ArcObjects in Visual Studio ...
4
votes
2answers
962 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 ...
4
votes
4answers
2k views

Export list of Feature classes to CSV

I am successfully using the follow script import arcpy from arcpy import env import os env.workspace = ("WORKSPACE") fcList = arcpy.ListFeatureClasses() print fcList to export feature class names ...
4
votes
3answers
2k views

Why would “import arcpy” hang Python script run from DOS/cmd prompt?

I have a very small test script (test.py) that I use to see if Python is installed and ready to use ArcPy. All it contains is: print "Starting" import os print "OS imported" import arcpy print "ArcPy ...
4
votes
2answers
148 views

Using Spatial References with ArcPy after *.prj files no longer installed by ArcGIS 10.1 for Desktop?

I'm writing a python script that uses the CreateFeatureclass_management tool, without a template. One of the required parameters is a spatial reference. I used to be able to point to the system *.prj ...
4
votes
1answer
299 views

Switching between background 64 bit processing and 32 (so I can use 3rd party ie XTools)

I often run scripts now with 64 bit background processing enabled but when I want to use certain tools like Xtools table to text I have to turn it off as these tools are 32 bit. Is there a way to ...
4
votes
2answers
309 views

How to pass an output stored in a single variable into another script using arcpy

I am running set of processes each with different outputs in a python script. Is there a way to set a variable as global so that just the output of that single step can be accessed from other scripts? ...
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 ...
4
votes
1answer
814 views

Is it possible to sort an arcpy.da.UpdateCursor()?

I have an ArcPy Data Access update cursor that I would like to sort before making updates to it. The cursor makes updates if I don't sort, but if I add a sort to the cursor I get an error, ...
4
votes
2answers
2k views

Check if shapefiles exists in folder

In ArcGIS modelbuilder I want to check if a shapefiles exists, if not I want to create the shapefile in that folder. I guess the calculate value tool within ArcGIS modelbuilder can be used, but I need ...
4
votes
2answers
83 views

How to access raster NoData value?

I am trying to programmatically access the NoData value in a raster dataset as shown in the screenshot. Two tools that come to mind to describe raster properties do not seem to be able to describe ...
4
votes
1answer
115 views

How to SUM field and then insert into NULL column?

I am only in the beginning stages of learning Python. I have a column, 'QUANTITY_SOLID', that I want to take the sum of all of its rows. I understand I can do this with 'SUMMARY_STATISTICS', but i'm ...
4
votes
5answers
364 views

Dissolving polygons fails on computers with small amount of RAM

When I'm trying to dissolve a polygon through an arcpy script the operation fails with the 999999 error on computers with small amount of RAM [~3 GB] (known issue). Unfortunately neither this, that ...
4
votes
1answer
516 views

call Sql Server stored procedure form arcpy

Is there a way to execute a SQL Server stored procedure with arcpy or Python and retrieve the results returned by the stored procedure? There is a very similar question posted on ArcGIS forum with ...
4
votes
1answer
199 views

Where can I find ArcGIS logs when I execute a python script using arcpy?

I'm executing a python script locally on my computer where ArcGIS Desktop 10.0 is installed (Windows 7). The script uses functions from the arcpy library installed with the ArcGIS Desktop to manage ...
4
votes
1answer
64 views

Programatically detect the format/version of an arc toolbox (e.g. 10.0,10.1 etc)

Is there a way to tell programatically (from the command line) what format a given ArcMap toolbox was saved in - 10.0, 10.1 and so on?