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

learn more… | top users | synonyms (1)

1
vote
2answers
737 views

What changes will be made to arcpy in ArcGIS 10.1? [closed]

I heard that two big changes to arcpy will be add-ins and new, faster cursors. Also, new features include "the ability to administer your enterprsie geodatabase (ArcSDE) using Python scripting" and ...
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 ...
3
votes
5answers
2k views

arcpy : Add Raster Layer layer without lyr file

i wonder how i can add a raster layer to a remote (not the current) mxd file with arcpy. I need to not use a lyr file for that. For vector Layer i have the following lines working fine : mxdPath = ...
12
votes
4answers
4k views

What is quickest way to select polygon by point in ArcGIS 10 using ArcPy?

I keep thinking that I must be missing something, but there does not seem to be a tool in ArcGIS 10 to select features (in particular polygons) from a layer at a point (X,Y) location via ArcPy. The ...
2
votes
2answers
1k views

ArcPy Changing Spatial Database Connection

hi we have conveyed our some servers which has ArcGIS application and SDE on it to another server and its ip has changed. now when i want to open my .mxd file it tries to connect remote SDE with old ...
8
votes
2answers
856 views

ArcMap running scripts slower if you import Arcpy

I am finding ArcMap runs slower, if you have written a script, which imports arcpy. You may wish to write a script that can be operated in ArcMap, through the python window, or as a standalone ...
1
vote
2answers
3k views

Get extent of Georeferenced Rasters in Python and output to polygon shapefile

I would like to create a shape file containing the extents of each of the rasters in a directory. Is it possible to capture the extent of a raster using Python? I have tried ...
2
votes
0answers
578 views

Perfectly running python script gives error when run from web.py

I have the following python script which runs perfectly if run separately: import arcpy val = arcpy.GetCellValue_management("D:\dem-merged\lidar_wsg84", "-95.090174910630012 29.973962146120652", ...
4
votes
2answers
671 views

arcgis 10, python update raster of mxd file

i wanted to update the raster file in a mxd file using python. for example, i created a.mxd which contains b.tif file in it. now, i obtained c.tif and want to update the a.mxd, i.e. want to delete ...
3
votes
3answers
1k views

How could I label features and convert them to annotations with arcpy?

how could I do the following steps with arcpy: right-click on the layer with the features Label Features Convert Labels to Annotations ... The annotions should be saved in a new shapefile. How ...
9
votes
2answers
1k views

How can I crawl directory tree and change Mxd relativePaths to true?

I have a large number of project folders where each project folder can have many subfolders. These subfolders can contain mxds, shapefiles, personal gdb's and fgdb's. In many cases the user forgot ...
5
votes
3answers
924 views

arcpy taking longer and longer in a loop

I am looping through an amount of point arrays, creating data on the fly. The features/arrays, are largely similar in size. One thing I have noticed, is that when I start the process, the time it ...
6
votes
3answers
3k views

Insert Raster to MXD using arcpy.mapping (ArcGIS 10)

What i want to do seems simple. But again i can't even find a workaround... I have got a lot of Raster-files (ESRI-GRID) which i need to insert into a layout mxd-file and then export the map to ...
18
votes
3answers
11k views

ArcPy and running Python scripts (with parameters) within another Python script

A common coding pattern used in AML was to run an AML (with parameters) inside another AML. An application that I'm currently developing would benefit from being able to run a Python script (with ...
4
votes
3answers
566 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 ...
5
votes
1answer
534 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 ...
2
votes
3answers
472 views

writing a 3D polygon (arcpy)

I currently working on some scripts with 3D polygons using arcpy (arcgis10). Reading and data manupulation works fine, however writing the output back into a shapefile doesn't seem to work, it only ...
3
votes
2answers
2k views

Create Polylines from arrays of points

Let me describe the data setup. A line has been provided as an array of coordinate pairs, one for each vertex. This array is variable in size, anywhere from 2 to 200 coordinate pairs per line. What I ...
19
votes
4answers
1k views

Run a Python Script when opening an MXD?

Can anyone tell me how to accomplish this? I want a Python script to run on opening the MXD which would pull an excel worksheet into a GDB and refresh the map. I only want this to happen in this ...
2
votes
2answers
988 views

Automate creating Rectified files from georeferenced images

A python 2.6.5 / ArcGIS 10 solution is preferred. UPDATE: I found a tool to do this "Create Ortho Corrected Raster Dataset" but the python script for it gives errors when I try. import arcpy import ...
6
votes
2answers
679 views

How to refresh the ArcMap display using ArcPy?

Was trying to replicate a RePast Agent Analyst simulation using just Python and arcpy. The script was about urban expansion. The script just changes the values of a column in a shape file. ArcMap's ...
2
votes
2answers
490 views

Creating a GP script to update a table in SDE

I need to create a geoprocessing script to update a table on an SDE server, with some text input from the user. I thougth what I needed to do was create a toolbox with a python script associated with ...
3
votes
1answer
1k views

How do you make a SQL join query for a NULL in a search cursor in ArcPy?

I am trying to learn how to do some error catching/avoiding in ArcPy. Here is a simplified version of what I would like to do. I would like to take some points, and then check to see if there is a ...
0
votes
1answer
372 views

Calculating length with Python and the PYTHON_9.3

(Please critic wholly if possible) If I have polyline data in NAD83 and I want to calculate geometry using the PYTHON_9.3 parameter from the arcgisscripting.create(9.3), I am getting mixed results. If ...
8
votes
1answer
984 views

arcpy.geometry __geo_interface__ and AsShape() function: loss of precision and holes

I'm serializing my arcpy geometries as geojson so that I can 'hydrate' them back as geometries later and I'm having 2 problems in the cycle.: PROBLEM 1: Precision R0 = ...
2
votes
1answer
411 views

How can you make RasterToASCII_conversion observe environment setting output cell size?

I have two rasters (an ESRI grid and an IMAGINE image) that differ in projection, extent and cell size. I want to convert the IMAGINE to an ASCII, and want it to have the extent, cell size and ...
5
votes
1answer
757 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 ...
4
votes
1answer
663 views

Can I change the font type in all Text_Elements in a page?

I want to change all the font styles in a number of mxd's from "Lucinda Sans" or whatever the current one is to "Arial" without changing the font size. I wrote a simple script to find/replace text ...
2
votes
1answer
194 views

Out of Range error when creating thumbnails of MXDs

I am tryting to create thumbnails of all the mxd's in a directory but no mater how high I set the value of the "While" loop it gives me an "Index out of range" error... Also can I get it to look at ...
2
votes
3answers
2k views

Does ArcGIS 10 have a Geoprocessor Programming Model by using Arcpy?

Does ArcGIS 10 have a Geoprocessor Programming Model by using Arcpy? is it possible to use ArcGIS 9.3 Geoprocessor Programming Model within ArcGIS 10?
1
vote
1answer
347 views

Opening ArcCatalog to FGDB causes application to fall over

I have some python scripts I have written to create a lot of objects. I write these, in code, to a couple of FGDB's. If I happen to open ArcCatalog in one of these FGDB's, the application falls ...
1
vote
1answer
500 views

Create shape file of bookmark extents and/or automatically print bookmark extents to pdf

Is it possible to export the extents of all bookmarks in an active map document to a shape file containing the polygons of the shape and/or to automate the print to pdf of all the bookmark extents. ...
1
vote
1answer
2k views

Replace text using python in active map view

I would like to update misc text in an active map window but can't seem to crack the code and I found some presentations that mention it can be done but the full code isn't there. The following is ...
3
votes
2answers
4k 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. ...
6
votes
1answer
628 views

ArcGIS 10 Linux experience

We have ArcGIS 10 installed on a nice clean Linux box. We have developed scripts to run on the Windows desktop development machines, and modified them to run on Linux. Now, if we run the scripts on ...
2
votes
1answer
1k views

How do I insert a DATAFRAME_ELEMENT value into a dynamically generated shape file containing its extent?

This is for ArcGIS 10, Python 2.65. I have code which captures the extent of dataframes within all mxd's in a directory. I also want it to add the dataframe name, scale and the name of the mxd it ...
4
votes
1answer
297 views

ArcPy or FME for adding history to an object?

I have a very specific problem and I'm looking for a solution for it. I need to add some sort of history to an object. The history will be stored like this: begin_date end_date previous_id Suppose ...
2
votes
1answer
808 views

Using multivalue output parameter with ArcPy?

How can I use a multivalue output parameter with ArcPy? Please give an example.
6
votes
1answer
472 views

Arcpy hanging on Linux

I am having issues getting arcpy to run correctly on Linux Red Hat. I solved some earlier problems which appeared to be related to permissions on the init_server file. Now that si resolved, when I ...
1
vote
3answers
716 views

Automating capture of Extent from multiple mxds with multiple dataframes

I want to create a single shape file from multiple mxd's that have multiple frame sets with different extents in them. I have found/started a script to do this (attached) but can't figure out how to ...
0
votes
6answers
3k views

batch buffer with python in arcgis 10

Hi friends: i have some feature class(7 feature classes) and I want to batch buffer in ArcGIS 10 . I don't know how can I buffer at once. Please help me. sincerely
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, ...
2
votes
1answer
161 views

Does arcpy.AggregatePoints_cartography create multiple polygons?

Does this function allow you to put in an array of points, which may, or may not, be representative of many polygons, and create many polygons from it, or just the one, linked?
2
votes
0answers
580 views

Spatial Analyst Cell Statistics seems to give the wrong answer in ArcGIS 10.0

I have a script that calculates standard deviation for a list of grids using the Cell Statistics function in Spatial Analyst for ArcGIS 10.0 The syntax is this: stdevGrid = ...
7
votes
2answers
3k views

Modify raster layer display and symbology properties programmatically with arcpy or ArcObjects

I have over 1500 NITF files that I need to be able to modify the layer display and symbology of programmatically from within ArcMap. I need to set the properties outlined in red below: I've looked ...
4
votes
1answer
5k views

Thiessen Polygon delineation within a Feature

I am trying to create Thiessen (Voronoi) polygons, based on points within a defined shapefile extent. The output should be inclusive to the feature. The output I receive now is the rectangular area ...
4
votes
4answers
645 views

Unable to save selected layer by attribute for ArcGIS Geoprocessing

I am troubles using the SelectLayerByAttribute() function for arcgis geoprocessing. I have a layer and I want to select everything that matches on a particular attribute. I call MakeFeatureLayer() ...
0
votes
1answer
60 views

Adding data at runtime into dataframes

I am trying to create an empty MXD to act as a template. I will have three dataframes for maps, each holding a different object from ArcSDE (1 raster object and 2 features). I know how to query all ...
2
votes
1answer
577 views

Is there a way to set a mask(halo) for labels in a python script?

I currently am writing a python script and using a lot of the arcpy mapping module functionality. I have been using the LabelClass of the arcpy mapping module to automate the display of labels with my ...
6
votes
2answers
2k views

Installing ArcGIS 10 with Python(x,y)

EDIT 10/20/2011: The problem I was having below was caused by trying to install Python(x,y) after ArcGIS 10. I got a new machine yesterday and instructed IT to install Python(x,y) 2.6.5.3 (has ...