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

learn more… | top users | synonyms (1)

3
votes
1answer
421 views

Update Arcpy version?

This is probably the answer to my previous question. The version of arcpy that I am using does not include GetNAClassNames naClasses = arcpy.na.GetNAClassNames(serviceAreaLayer) ...
0
votes
0answers
165 views

Export Data Driven Pages extents to Kmz

Is it possible to export the extents of DDP to KMZ using arcpy - Map to KML (Conversion)? Alternatively can we export each extent of a single DDP extent to a new mxd and then run arcpy.MapToKML_3d on ...
1
vote
1answer
77 views

Is there a way to access ps.map in python?

i am wondering whether its possible using python interface to load layers and edit them in Print/Cartographic Composer without displaying, and finally export to PDF? something that can be done via ...
6
votes
0answers
468 views

Land Classification with Spectral Python (SPy) [closed]

Does anyone have experience working with the Spectral Python module for land classification? The following k-means clustering example takes an iterative approach to classification through pixel ...
3
votes
1answer
334 views

List Elements or Datasets of a given Layer

I am sorry of this might sound like a noob question but I cannot find any answer from google. I used arcpy to do batch processing of Network Analyst - Make Service Area layer of thousand of stores. ...
3
votes
2answers
614 views

How to select polygon features that have their centers outside of another polygon feature class

Since I only have Incorporated area feature class, how can I select census blocks that are in unincorporated area? Or not within any incorporated areas? Thank you. John
4
votes
4answers
881 views

Is there a way to programatically force RGB (3 bands) in a raster with arcpy?

I'd like to include conversion to a 3 band RGB raster in a script to prepare multiple DEMs for image processing. The input files are rasters extracted from a raster mosaic. The manual option is to ...
3
votes
1answer
321 views

How do I stop GP script from adding temporary data to Table of Contents?

I have a script that does a series of calculations, producing temporary data along the way. However, at each step of the script, data is added to the TOC and then removed when I call the ...
10
votes
2answers
2k views

Methods for optimizing multcore processing in ArcGIS

I am interested in learning methods to utilize the full extent of multicore processing power available on a desktop computer. Arc states that background geoprocessing allows the user to utilize ...
3
votes
1answer
329 views

Batch Sum Fields Script

I have created a python script that batch summarizes all string fields within a fc table based on the concatenation of two fields. The script loops through a list of the fields, however it stops ...
4
votes
2answers
1k views

Running ArcPy script from ArcObjects?

the standard method requires to run ArcPy script in command line, i've struggled with it to run but without a result, i can import arcpy, set the workspace to the geodatabase path and describe the env ...
3
votes
1answer
226 views

Create Array From Selected Features Based on the Order in Which They Were Selected

I need to create an array of features from a selection based on the order in which they were selected. As in: I select feature 5,2,3,4. I need to have an array so I can apply attributes (with python) ...
4
votes
1answer
395 views

Controlling time slider using arcpy

I am trying to control the time slider object through my code in the python console. As given in couple of examples, the time property of a data frame could be controlled by Data frame time property. ...
3
votes
1answer
843 views

Python scripts runs from PythonWin but not ArcCatalog (ArcGIS 10)

I add a field to the target FeatureClass it is not present, via arcpy.AddField_management(...). Works fine from PythonWin, but the AddField call fails when the script is run from ArcCatalog. I have ...
3
votes
3answers
2k views

Convert an .xlsx datasheet with point feature data into a POINT feature class

I am trying to create a script tool to automate this process, eventually it will be used for batch processing but at the moment I can't even get test data to work. This is pretty basic at the moment, ...
8
votes
2answers
653 views

Creating summary table of symbology of all datasets in multiple MXDs?

This is related to the following Retain ESRI symbology in Mapinfo TAB . As an initial step (in arcpy) I want to access the symbology of all the datasets and create a document which has the details of ...
3
votes
5answers
1k views

Having trouble nesting updatecursors

I'm trying unsuccessfully to perform updates on multiple linked tables using updatecursors. The following code works as I would expect: trackRows = ...
4
votes
2answers
1k views

Getting the Field Alias from a layer, from within a Map document

I've got a very simple script, that loops through all the layers in a mxd and loops through the fields, and prints out the Alias Name for the field, but I am having some problems, it seems to be ...
8
votes
4answers
300 views

Subset Folder Contents ArcPy

I have about 1500 .txt files within a folder named 3410001ne => 3809962sw. I need to subset about 470 of these files to process with a Python script. Below is the section of code prior to my for ...
2
votes
1answer
1k views

Adding Layer in current session using ARCPY

I wanted to add a layer through the toolbox using arcpy. The below script works fine through the python console in ArcMap, but does not when executed through the toolbox. The layer flashes for a ...
7
votes
3answers
5k views

How to delete feature class features faster (ArcPy)

I have written this script that recurses through all feature classes in a given set of feature datasets and deletes all their features. It appears to do the job but it runs pretty slowly. Is there ...
2
votes
1answer
722 views

Snapping lines to points

I have a layer containing a vector 'Line 1', that originates at point 'A' on a second layer. I also have point 'B' on a third layer. I want to create 'Line 2' that has the same angle and length of ...
5
votes
1answer
1k views

Move .SHP from .MXD to gdb [duplicate]

Possible Duplicate: How to move SHP to gdb with ArcView license? Let's cut it short, I have numerous mxd with layer coming from .SHP and various servers WMS that I need to move to a gdb. ...
4
votes
2answers
947 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. >>> ...
1
vote
0answers
644 views

Variable stored as NoneType in Python with updateCursor

SOLVED: although the field was not nullable (no null values), a glitch created one in the heading field, so the variable was stored as a null value and thus the NoneType. I am using updateCursor to ...
8
votes
3answers
8k views

How to include variable in where clause of arcpy.Select_analysis?

I am trying to loop through a shapefile, selecting each feature in turn and copying it to a temporary shapefile to by included in a union analysis. I'm using a cursor to find the ID name for each ...
9
votes
2answers
826 views

Check validity of file geodatabase using arcpy

AS the title suggests, how can I whether a GDB file is valid using arcpy? One approach is, only checking the whether the name ends with .gdb, but that's not a robust approach. Because a normal file ...
4
votes
1answer
1k views

How to rename large amounts of spatial data?

I have approximately 1500 raster files following this format: m_3609922_nw_14_1_20100425 I need these subsetted to, for example: 3609922nw. What are appropriate methods to rename large numbers of ...
3
votes
2answers
3k views

Selecting features through arcpy

I would like to achieve the following functionality through arcpy: Querying an existing baselayer on time and create a new layer Apply symbology from an existing layer and add the new layer to the ...
7
votes
3answers
3k views

Does ArcPy have a spatial search function for geometry?

My problem: Using ArcPy I want to loop over buffers and select geometry_features inside each buffer and do something (update) only the objects found within that specific buffer. The code below ...
4
votes
2answers
2k 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
1answer
269 views

How to dynamically view Python script results in ArcMap?

I want to view the output of arcpy scripts (run in Python IDLE) in ArcMap. I tried refreshing the ArcMap data frame after I run the script. This does not work. Please advice me on this.
3
votes
2answers
4k views

How to reference a specific layer in a dataframe with Arcpy

I am trying to reference a Layer named "Tim" in the dataframe "Layers" in my .mxd. It is not working. I have looked at the ArcGIS online help and all else in this forum. Can't get rid of this Runtime ...
7
votes
1answer
6k views

issues importing arcpy in Python IDLE

I would want to use arcpy in my python code. I am able to import it through the ARCGIS desktop python console. But I am not able to import it into Python IDLE. I get the following error Traceback ...
6
votes
1answer
359 views

Changes in synchronized replica not shown in ArcMap or ArcCatalog without refreshing

I am synchronizing a one-way replica in ArcEditor using Python. I tried adding RefreshActiveView and RefreshCatalog to the code, but I still need to refresh the synchronized database to see the ...
0
votes
1answer
324 views

Check multiple feature classes have same spatial reference

As the title says I've several feature classes. I want to check whether they have same spatial reference using arcpy
6
votes
1answer
525 views

Using python, how do you “reload cache” an opened Attribute Table

Used python to update a shapeFile through cursors. The Shapefile is updated, but there could be an opened Attribute Table. Manually you can hit "reload cache" to update the Attribute Table and see ...
3
votes
1answer
2k views

Unable to change data source path for group layer file

I am having some difficulty changing the data source for a group layer. Below is the code that I am using. It processes a LYR file successfully that has a single data source but if LYR file has more ...
8
votes
6answers
4k views

Get a point on a polyline from end points given distance along poly line

I have start point and end point of a polyline. How can I get a point on that polyline from end points specified by the given distance. How can I get this by using arcpy provided that this script ...
12
votes
2answers
347 views

ArcPy adds erroneous interior ring when writing adjacent, multipart geometry?

I've run into an odd issue when using Arcpy to write multipart geometry to a shapefile. I am using an InsertCursor to create a multipart feature from a list of parts each with a list of vertex pairs. ...
3
votes
3answers
632 views

Convert cursor output to list of geometries

I want to convert all the geometries returned by search cursor to a list. import math import arcpy from arcpy import env env.workspace = r"C:\GIS Data\GIS data_for Maeenul vai" desc = ...
1
vote
1answer
918 views

Using arcpy.mapping.ExportToTIFF() to create dataframe geotiff

Has anyone created a dataframe geotiff using arcpy.mapping.ExportToTIFF() with satisfactory results? My output has poor quality and the georeferencing is significantly off. This example is the ...
11
votes
1answer
5k views

“Field Mapping” in ArcGIS 10 - ArcPy

I've wrote a Python script that does a spatial join and some simple calculations. My problem is with setting the merge rule for one specific field, and leaving the rest of the fields as is. For ...
8
votes
4answers
7k views

Get all the points of a polyline

I have some polyline feature objects in python. Now I want to get all the points of polylines. For example, if a polyline has start point [0,0] end point [5,5]. Result: ...
2
votes
2answers
1k views

Get all polylines from a shape file (containing polylines)

I have a *.shp file which contains only polyline features. How can I iterate over all the point features. Given ESRI Polyline example only uses already defined points to make polylines. But I want to ...
8
votes
0answers
377 views

Two machines running the same arcpy based software - only one is leaking memory [closed]

Ok, so I'm running a rather large Python application based on arcpy on two separate machines - one of them is leaking memory and one is not. Both are running the same operation in the software. The ...
6
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 ...
0
votes
1answer
531 views

Defining projection in arc toolbox (JSON to shapefile) in python

I have a arc toolbox which converts JSON txt file to a shapefile but we have to define the projection. How can I hard code the defined projection so that user don't have to input the projection ? ...
1
vote
2answers
3k views

How can I save raster dataset using arcpy

I'm trying to save filled raster object to geo database by my specified filename. import arcpy from arcpy import env from arcpy.sa import * env.workspace = r"C:\GIS ...
2
votes
1answer
1k views

Outputting results message from spatial statistics tool to text file using Python?

I'm using the following tool in ArcGIS 10 - Calculate Distance Band from Neighbor Count (Spatial Statistics). I'm using a python script to execute this tool several times on different shapefiles: ...