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

learn more… | top users | synonyms (1)

4
votes
1answer
701 views

Raster Calculator dynamic map algebra expression

Is it possible to dynamically construct a Map Algebra expression that is dependent on the output of another tool, either using model builder or arcpy? For example, say I have a model that performs a ...
3
votes
1answer
910 views

Multiline VBScript Label Expressions in Arcpy

I am able to set simple label expressions, but when I try to set multiline expressions (which all VBScript expressions are) it does not get copied into the expression box properly. I have tried using ...
5
votes
4answers
2k views

Creating perpendicular snapped polylines between an existing point and polyline using arcpy

Here's my situation - I'm working on a project that requires 20,000+ short connector lines be created, each drawn from a point to a snapped location on a nearby polyline such that the resulting ...
5
votes
3answers
5k views

arcpy.MakeFeatureLayer in-memory layer still exists when subsequent step fails during testing

When I used arcgisscripting to create in-memory output layer with gp.makefeaturelayer, I would put it in a try/except block and delete the gp object in the except piece when the makefeaturelayer would ...
3
votes
1answer
450 views

Disaggregating multiring polygon for editing, then recombining

BUMP? We have many rows of multi-ring polygons, displayed on a Flex front end. We need to be able to select a polygon (a row), split the rings for editing, edit them, then combine into one polygon ...
3
votes
1answer
895 views

Update layer datasource in multiple map documents using ArcPy?

I would like to update the data source of a specific layer in multiple map documents using ArcPy, however I'm getting a <type 'exceptions.SyntaxError'>: invalid syntax error on this line: if ...
4
votes
1answer
224 views

Removing a Table from several MXD-Files using ArcPy

I'm trying to remove a certain Table (xlsx-File) from some MXD-Files using python, but I can't finguring out how. I tried the code sniplet for removing: import arcpy, os from arcpy import env ...
3
votes
3answers
1k views

Using Python to combine middle parts of two fields into third field

Below is how I used the Update Cursor in my final script. As you can see getValue was used a few times, perhaps there is a cleaner way to do this? But my concatenated field wouldn't populate properly ...
5
votes
2answers
413 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 ...
0
votes
0answers
101 views

Graphing with matplotlib [duplicate]

Possible Duplicate: Can you use arcpy.RasterToNumPyArray() to Graph a Raster with matplotlib? I ask this question, but didn't get any real bites: Can you use arcpy.RasterToNumPyArray() to ...
6
votes
1answer
340 views

Accessing graph in ArcMap document using ArcPy?

I am trying to access an existing graph in an ArcMap document with arcpy. I know how to create a new graph with arcpy, but I cannot seem to figure out how to access an existing graph in an ArcMap ...
3
votes
1answer
408 views

Arcgis -> python -> ctypes -> c++ dll tool cancels itself, why?

Since optimizing my python-ctypes-dll based geoprocessing tool, it seems to cancel itself a lot. Followed by arcmap reporting a pure virtual function call (which is odd, because you'd think any such ...
3
votes
1answer
120 views

Are there any alternatives to ArcGIS Locator Report?

I'm a pretty new GIS programmer and I've found ArcGIS/Arcpy to be extremely unstable. I'm trying to run a Locator Report in arcpy with no success. I'm wondering if there are any other alternatives? ...
7
votes
5answers
685 views

python.multiprocessing and “FATAL ERROR (INFADI) MISSING DIRECTORY”

While trying to do multiprocessing with arcpy, I am occasionally running into this error: FATAL ERROR (INFADI) MISSING DIRECTORY I have no clue what is triggering this error, and it crashes the ...
4
votes
1answer
529 views

Can you use arcpy.RasterToNumPyArray() to Graph a Raster with matplotlib?

Can you use arcpy.RasterToNumPyArray() to Graph a Raster with matplotlib? I'm looking to graph a raster with X, Y, and Z values in a 3D bar graph. I just can't seem to translate the numpy array to ...
8
votes
4answers
3k views

How to create arcs between two points in Python?

I've been working on an python script automating the visualization of live point data. I have a table with two coordinate pairs. I'd like to connect these two point with an arc of a circle or similar ...
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 ...
1
vote
1answer
711 views

Hotlink vector/raster files to open in current workspace in ArcGIS 10 similar to Mapinfo

I want to add datasets to ArcMap and place them in a particular group layer by simply clicking on hotlinked polygons in a shape file. The same process is easy in MapInfo and I want to implement the ...
2
votes
1answer
318 views

Why does “takes no arguments” error propagate from Arcpy example?

I was attempting to run Setup_Customers_Using_Tabular_Data , I modified the paths to fit my environment but when I run the program I receive SetupCustomersByTable() takes no arguments (6 given) ...
3
votes
1answer
1k views

Referencing Feature Dataset in File Geodatabase with ArcPy

It's probably an obvious one but since I'm new to arcpy I'd appreciate any help. I'm trying to develop an arcpy script which will eventually loop through number of rasters and feature classes stored ...
1
vote
2answers
320 views

How to match two feature classes with same geography and use part of the name of one to name the other

So I have a polygon feature classes with unique identifying names to them that I want to use to rename some other feature classes that are of the point feature type and have the same geography of one ...
1
vote
2answers
642 views

arcpy.sa.Viewshed with OFFSETA

This is using ArcGIS10 arcpy with spatial analyst. I need to call Viewshed, but with an observer height set. I have tried using a Z-aware point feature set, but that only throws an error. I am ...
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
4answers
2k views

Automate Projection of multiple shp files using ArcPy

I have been trying to create a Python script that will convert all shape files within a folder from GCS WGS 84 to Web Mercator. Below is the code I have so far but what I'm struggling with is how to ...
4
votes
2answers
2k views

ArcGIS 10.0/arcpy: How to create a polygon geometry from inner and outer ring point arrays?

I have two arrays, each containing a closed ring of points, one for an outer ring and the other for an inner ring, the latter running counterclockwise, of course. I am using the arcpy.Polygon() ...
2
votes
1answer
751 views

How to rename feature classes based on field values within the attribute table?

My goal is to iterate through several feature classes and rename each feature class based on a field value within the feature class's attribute table. These feature classes are a single polygon ...
4
votes
2answers
898 views

How to setup PyCharm to reference ArcPy?

How would I setup PyCharm to recognize import ArcPy? I'd like to use PyCharm to develop and debug geoprocessing tool.
1
vote
0answers
52 views

What are the steps to go from raw address data to a locator report? [closed]

I'm a seasoned programmer, but I'm new to GIS in general. I've read a decent amount of ArcPY documentation but haven't seen an example that takes me from raw data to a locator report, from start to ...
3
votes
1answer
1k views

Can ArcPy test for availability of SDE Connection before trying to use it?

In a Python script that I use to publish ArcGIS 10.0 Geoprocessing Services I have some code: arcpy.AddMessage("If process hangs here, check for ArcSDE connections issue by trying to open " + mapFile ...
1
vote
0answers
675 views

ArcGIS 10.0/arcpy: Can't retrieve the points in a polyline geometry obect: any idea why?

My arcpy script builds a Python dictionary, dictCLPnts, that holds the geometry objects of a polyline feature class. The following code snippet shows the attempt to access the geometry object with ...
1
vote
2answers
1k views

Getting print statements in Python script to print through a batch file

I'm starting to learn Python and batch files. I have a Python script which selects data by location and exports the selection to a new feature class. The script runs just fine - included in this ...
0
votes
1answer
1k views

Create TIN from Elevation Points in Python

I want create a TIN from point features with elevation using a python script. This is my script: import arcpy from arcpy import env import json as simplejson import urllib import sys,os ...
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 ...
2
votes
2answers
376 views

how to calculate a field from a shp currently sected in a arcmap session using a Python script in ArcMap 10?

Hi I nedd to create a script in Python for use in ArcMap 10. This script must be able to calculate a field from the shp currently selected in ArcMap. Any ideas?, I'm new to Python so any code example ...
0
votes
1answer
864 views

It is possible to edit selected features with Python?

I'm trying to edit some fields of the selected features in ArcMap. It's possible to do this with Python (ArcPy)?
1
vote
1answer
402 views

Issues with defining projection to that of the current root file

I am creating a shp file with the extent of all the raster file in a set of directories and it works fine when all the rasters are in the same projection but not when they switch around. So I want to ...
3
votes
1answer
642 views

Strange Behavior in Focal Statistics

I am trying to calculate the maximum value in a neighborhood on a raster using the Focal Statistics tool for Spatial Analyst in ArcGIS 10. Using python, I loop though several different radii, with ...
0
votes
1answer
175 views

How do I assign a variable to a SQL Server ArcSDE database's feature class?

I'm using ArcGIS Desktop 10 and have no experience using Python with a SQL Server ArcSDE database. When using a shp file or file gdb it is very simple to reference a given feature class by simply ...
12
votes
3answers
3k views

How do I use sys.exit(0) in an arcpy script to exit early without having an error message show up?

I have an arcpy tool script for ArcGIS 10.0 that has two major functional sections. The user can choose whether or not to run the second section. If the user chooses NOT to run the second section, I ...
7
votes
2answers
645 views

Reordering polygon shapefile permanently?

I've written a script which produces a polygon shapefile of the extents of all the thousands of rasters in our library. I want to organise the FID so that the files with the largest extents are on the ...
1
vote
0answers
146 views

Arcpy problems regarding convertToMSD() Function

I am having trouble getting the ConvertToMSD Function to work. Technically it works, but not in the long run of my script. I use the converttomsd function to create an msd. I then publish this msd as ...
3
votes
1answer
2k views

How do I 'select' using ArcPy?

When using a cursor to loop through an attribute table, is it possible to iteratively select each row? I want to clip a line to a polygon grid (see previous question); due to the size of the grid the ...
3
votes
2answers
795 views

How to read MapInfo .tab files in ArcPy?

I want to use arcpy (the ESRI install of python 2.65) to analyse tab files...can this be done directly or do I need to convert them to shp files...if so would it be possible to do something like ...
6
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 ...
4
votes
1answer
1k views

Create overlapping polygons from contour lines

Working in ArcGIS 10, I have a set of contour lines representing density of commercial square footage, and I have a set of points representing local maxima for each peak of the dataset. For each ...
7
votes
1answer
3k views

Converting ArcGIS date value to string reading in mm/dd/yyyy format using ArcPy?

I am writing an arcpy tool script in ArcGIS 10.0. In a fGDB feature class, I have a Date type field. I gather that the values in the Date field are stored as long integer dates, but they display in ...
4
votes
2answers
3k views

arcpy, “.lyr” file to shapefile or raster

i am using arcgis server 10 and python 2.6.5. i have created a "test.lyr" file, now i wanted to convert it either to shape file or raster file. i have created the "test.lyr" from "test0.tif" and ...
3
votes
2answers
622 views

Arcpy: print to PDF with Vector shapefiles, text etc

I have a small python script which exports a set of data driven pages to PDF. This works fine, including appending each page to an 'all' pdf. My issue is that it creates rasters of each layer in the ...
7
votes
1answer
237 views

Efficient Network Neighbors?

I would like to identify the Kth order neighbors of an edge on a network, specifically the neighbors of a large set of streets. For example, I have a street that I'm interested in looking at, call ...
1
vote
2answers
740 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 ...