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

learn more… | top users | synonyms (1)

8
votes
2answers
3k views

Using arcpy.SetParameter() with Python Script Tool published as Geoprocessing Service?

I have a script that needs to be published to ArcGIS Server as a geoprocessing service. This script computes a set of records in table form. I need to set an output parameter so that it returns the ...
6
votes
4answers
2k views

Efficient arcpy method of points in polygon

Coming from a background of Mapinfo and Manifold, I frequently find myself frustrated with the ArcGIS SQL toolset. In both these former programs it is trivial to write a query asking, for instance, ...
2
votes
1answer
340 views

ArcPy replaceDataSource to an SDE raster catalog error

New to Python! I'm trying to re-path a multitude of rasters currently the workspace is a folder, the intended workspace is a raster catalog in an SDE database - using the replaceDataSource method I'm ...
3
votes
1answer
653 views

ArcGIS Select Analysis using Unique Values from Field

I am trying to create separate shapefile using Select analysis with ArcPy by doing an SQL query to create them based on a unique value from the field. I want to create a list of the unique values in ...
5
votes
1answer
3k views

Arcpy cursors, WHERE clauses, and date/time fields

I'm having trouble making a selection of rows that meet certain date criteria using my arcpy.UpdateCursor(). I need to update records in a field in a geodatabase table with an ascending value based on ...
7
votes
1answer
1k views

Edit End Points in Polyline (Python/ArcMap10)

I am trying to make a polyline endpoint snapping tool in python. using a Search Cursor I read in the values to an array of line objects (which contain the feature id of the line, and two "EndPoint" ...
6
votes
1answer
397 views

Counting Files with a Spatial Reference using Python

I need to display a list of feature classes with an unknown spatial reference, and the number of feature classes with a spatial reference. I think I have the first part right, but having troubles with ...
3
votes
1answer
196 views

arcpy pydev 3rd party toolbox intellisense

I am just newly started to look at arcpy and i see that it has good intellisense for system toolboxes by default and also if you import a custom toolbox - the intellisense gets update also - however ...
11
votes
1answer
354 views

File Validation using ArcPy

I have a script which scans a directory and outputs basic raster data information such as the file name, format, number of bands, and etc. I need a way to make it so if the directory does not contain ...
4
votes
2answers
390 views

Finding Band Count in Rasters using ArcPy

I'm having troubles finding the band count for my raster files using ArcPy. I need to first list all the raster files in a directory, and then display the band count for each file. I am able to list ...
6
votes
1answer
1k views

Get shape filename in attribute field using field calculator

I apologize for crossposting against the ESRI geoprocessing forum, but it seems like this one gets answers. I'd like to have a modified append tool (ArcToolbox) that takes multiple shapefiles with ...
5
votes
1answer
885 views

How to check whether a fc is registered as versioned or not using python

How can I check whether or not a feature class is versioned using python? I'm trying to register feature classes using a python script. Before I do this I need to check whether a feature class is ...
1
vote
1answer
3k views

Using the arcpy.UpdateCursor to delete rows doesn't delete based on counter

I am trying to delete rows from a shapefile using arcpy.UpdateCursor. The first thing I did was get a unique list of values from the key field "PolyGUID", then I iterate that list doing a ...
3
votes
1answer
858 views

Workaround for Raster data input in ArcGIS Server Geoprocessing Service

UPDATE I have accomplished the Python script, but only tested in desktop environment, i.e. ArcMap. #Import ArcPy site package module import arcpy from arcpy import env from arcpy import Extent from ...
7
votes
3answers
977 views

How to determine on which side of a line a polygon feature falls?

I have parcel data intersecting line data. In the parcel data there are some parcels that don't intersect the line. How could I programmatically figure out if the non-intersecting parcel is on the ...
3
votes
2answers
5k views

How to sort a feature class and then calculate a sequential ID field?

I am in ArcMap and I want to sort the records based on a field and then do a Calculate Field with an auto-incrementing value with the sort in-place. Any ideas? It looks like I could get an update ...
4
votes
1answer
2k views

Batch conversion of netCDF to Raster in ArcGIS using Python

I'm having trouble using the Dimension Values (Optional) argument in arcpy.MakeNetCDFRasterLayer_md. Whatever I seem to do the output raster is always the first layer which is the default value. ...
0
votes
1answer
919 views

How to use variable field name in arcpy.SearchCursor?

I have code that says fld = fieldName rows = arcpy.SearchCursor(fc) for row in rows: x = row.fld How do I use a variable for my field name in python ArcGIS 10 on windows? Thanks.
1
vote
1answer
607 views

help writing a python script

Hi I need help with writing a script: The task I have a point feature class of graffiti incidents and a polygon feature class of patrol zones with some empty attributes already created for you. I ...
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 ...
1
vote
2answers
201 views

ArcPy Result Object Associated with Currently Running Script

We are at the end of a Python script using ArcPy. We can crawl around ArcPy to get information, but is there any way to get a result object for our currently running script? My motivation is to use ...
4
votes
1answer
384 views

How to write code for downloading a file in ArcGIS 10?

I have an offline database which has lat & long coordinates. The functionality I need to provide is to have a (latitude, longitude) point which will have country and city in it. Once the user has ...
2
votes
1answer
159 views

ArcGIS Geoprocessing Script - Calling External EXE Works in Desktop - Causes GP Service to Quit Abruptly

I have an interesting problem on my hands... I have a generic python script that does a bunch of geoprocessing functions using the standard arcgisscripting module (Yes, I am still at 9.3.1). At one ...
6
votes
1answer
663 views

With arcpy, how do I detect relationship classes in a file GDB (or can't I)?

I would like to be able to detect relationship classes in a file GDB. Because users of my script might have only an ArcView level license, they would not be able to manipulate the schema of a feature ...
4
votes
1answer
3k views

How to add field in attribute table by python

I have research on the question (How to add an attribute field to an existing Shapefile via Python) but could not implement it. If you can give me examples on how to add field name in attribute ...
1
vote
1answer
196 views

Odd behavior with arcpy.mapping.PublishMSDToServer

When I publish an MSD to ArcGIS Server 10.0 manually in ArcCatalog (through right-click context menu) or through the web interface, the service is created properly. When I use ...
9
votes
3answers
8k views

How to create a shapefile in ArcGIS 10 using arcpy?

How can I create a shapefile using Python in ArcGIS 10? I have lat & long. From this I need Python code which will create a shapefile and display it in ArcGIS 10. Thanks.
2
votes
1answer
317 views

How can I remove WMS layers from mxds using arcpy?

I'm trying to remove WMS layers from an mxd using arcpy. I can successfully remove "MapServer" type services using the below code, but not WMS? Here is an example mxd (zipped) with two different WMS ...
5
votes
1answer
592 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 ...
2
votes
1answer
262 views

What is the interface/property in ArcObjects that corresponds to a layer's dataSource property in arcpy?

I am trying to get the "Catalog Path" of a Feature Layer's data source in the table of contents of ArcMap using ArcObjects. This is very straightforward in arcpy but seemingly not so much in ...
3
votes
1answer
167 views

No placement inside feature dataset using arcpy XYtoLine?

When I run the following code with the outFC creation path set to a feature dataset inside a file geodatabase... arcpy.XYToLine_management(tempFC, outFC, "POINT_X", "POINT_Y", "NEAR_X", "NEAR_Y", ...
3
votes
2answers
566 views

How do you get access to a Network Analyst layer item in ArcPy?

I have a Python script that I'm working on. I have created a Closest Facility layer (in memory). I add facilities. I add incidents. I perform the Solve. These all complete. The only problem is, ...
4
votes
1answer
681 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
864 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
4k 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
430 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
855 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
220 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
397 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
330 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
397 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
119 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
662 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
519 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
2k 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
701 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 ...