Questions tagged [arcpy]

A site-package created by Esri to expose ArcGIS Desktop (ArcMap and ArcGIS Pro) geoprocessing, mapping, etc, to Python.

Filter by
Sorted by
Tagged with
14
votes
3answers
14k views

Expecting ArcPy to overwrite files in geodatabase file?

I'm writing a python script, I've got an mxd and its workspace is a geodatabase file with all the files I need into. The problem I'm encountering in testing and writing code is that, despite of the ...
12
votes
5answers
7k views

Compiling Python scripts (to .exe) that use ArcGIS Geoprocessing Tools?

I've been coding with Python for several months now and have developed some reasonably complex scripts for primarily geoprocessing tasks. That being said, I'm still learning a lot as I'm coming from a ...
19
votes
7answers
12k views

Listing feature classes with active domains?

I have an Esri file geodatabase with attribute domains defined. I need to delete some of the attribute domains but can't because "The domain is used by an attribute rule.". How might I discover which ...
19
votes
3answers
10k views

Finding angle between intersecting features in two feature classes using ArcGIS Desktop and Python? [closed]

I have two intersecting line featureclasses. I want to find the angle at each point of intersection using ArcGIS 10 and Python. Can anyone help?
11
votes
2answers
3k views

Drawing parallel lines inside polygons (Well Paths) using ArcGIS Desktop?

I would like to take a polygon feature class with multiple irregular polygons, and have Arc draw parallel lines inside of each polygon. Ideally, it would be nice for Arc to figure out the angle of the ...
9
votes
5answers
14k views

ArcGIS 10: create perpendicular transects to stream at specified intervals

I am trying to do what my title says. The goal is to input a line, segment it in an evenly distributed way by a specified distance, convert the vertices to points, then draw lines perpendicular to the ...
9
votes
5answers
2k 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 ...
11
votes
2answers
9k views

Listing feature classes in multiple geodatabases in folder using ArcPy?

I have a folder with numerous geodatabases in it. Within the geodatabases are feature classes. I would like to get a list of the feature classes in these geodatabases using a Python script. I've only ...
11
votes
2answers
982 views

Can ArcGIS and OSGeo4W share the same python install? [duplicate]

I don't like unnecessary duplication. Is it possible to install python only once and have both ArcGIS and OSGeo4W using it?
9
votes
3answers
19k views

Finding duplicate records in field using ArcGIS for Desktop?

I'm looking for duplicate records in dbf files based upon the attribute called 'ID'. I have various dbf files from 500,000 records to 1.5 million and I know there are a host of duplicates. I would ...
6
votes
2answers
9k views

Exporting mxd to image with transparent background from ArcGIS for Desktop?

I cannot get ArcMap 10.0 or 10.1 to "Export Map" to a png or gif with a transparent background -- no matter what I set the background and transparent colors to. Thus, I created the following script, ...
6
votes
4answers
18k views

Using arcpy.da.InsertCursor to insert entire row that is fetched from search cursor?

This is a simple process using the legacy cursors, but I cannot figure out how to do it with the newer Insert Cursor from the Data Access module. I basically want to take the entire row from a Search ...
6
votes
1answer
2k views

Labeling one to many relationship class using ArcGIS for Desktop?

I’ve created a feature class with a one to many relationships to a table. One point many classes. However I want to label the point with the classes attributes. Esri wrote VB solution but it's ...
15
votes
3answers
5k views

Selecting ArcSDE polygon by point in ArcGIS Desktop 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 ...
13
votes
2answers
3k views

Multiprocessing Errors - ArcGIS implementation

I was wondering if anyone else in the community here has attempted to use multi-processing for spatial analyses. Namely I am trying to iterate through a series of rasters, create a multiprocessing job ...
9
votes
2answers
2k views

Generating true curve elliptical polygons in file geodatabase using ArcPy?

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 10.1 GUI it is very easy to ...
8
votes
2answers
5k views

Select and copy features in ArcMap using Python add-in tool

I'm trying to add a tool to an add-in toobar to select features from an existing feature class and copy them across to another feature class. I need two tools, one for a point and one for a rectangle. ...
7
votes
3answers
2k views

Can a folder connection in ArcMap Catalog window be added using Python?

I have created a set of general scripting tools for map automation, etc. In one of my tools a geodatabase is created in the workspace folder the script points to. Just out of curiosity, is there any ...
6
votes
1answer
8k views

Using ArcPy outside of ArcMap?

There may be something I'm missing, but is it possible to use the arcpy module outside arcmap? My situation is that we have one license on a computer which is shared over a network. I need to do ...
2
votes
3answers
9k views

Creating point at midpoint of polyline with ArcPy?

I have a polyline shapefile (that contains multiple lines) and am trying to create a point at the midpoint of each line using Python. I am currently using the ET Geowizards tool 'PolylineToPoints' ...
9
votes
3answers
5k views

Transform bookmarks to data driven pages in ArcGIS Desktop?

We have this large project in ArcGIS with 30 maps with different extents using Bookmarks to pan between these maps/pages. Now we would like to use Data driven pages instead. The question is, is it ...
8
votes
3answers
5k views

Writing world file when exporting TIFF using ArcPy Mapping?

According to documentation, the options are: Syntax ExportToTIFF (map_document, out_tiff, {data_frame}, {df_export_width}, {df_export_height}, {resolution}, {world_file}, {color_mode}, {...
8
votes
1answer
11k 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 ...
7
votes
5answers
6k views

Finding close and parallel lines using ArcPy? [closed]

I need help with script for QA of water network. I need to find all lines that are almost parallel and close to each other less then 2 meters. The script has 3 stages: add azimuth field and ...
7
votes
1answer
3k views

Performing table look-up using Python in ArcGIS Desktop?

Using ArcGIS 10.1 the arcpy module has a TableToNumPyArray command, which converts a table into an array. Unfortunately I don't have access to 10.1 on my work PC. Is there a workaround which will ...
7
votes
2answers
3k views

ArcGIS Python Script Tool Field Name Drop Down?

I have a python script that checks file path names for corresponding files in a drive location. All of the inputs were originally hard coded, and it works well enough: import arcpy import os ...
6
votes
2answers
18k views

Specifying precision and scale of new field using ArcPy?

I'm wanting to create a field with a maximum of 1 decimal place and then calculate a value into it: (I know that all my values are < 10) arcpy.AddField_management('C:/shapefile.shp', 'myField', "...
6
votes
2answers
3k 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 ...
6
votes
1answer
4k views

Calculating Percentiles in ArcMap?

I have a large polygon dataset (26,000) records with numerous attributes columns. I wish to calculate the percentile rank of each attribute. Say I have population_density in an attribute, is there a ...
5
votes
4answers
4k views

Converting case of all values in all fields of table 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 ...
5
votes
2answers
6k views

How do you add a long list of rasters together in Python?

If you have produced a long list of rasters (lets say 50) and want to add them together, is there any shorter way to write in python rather than typing all the inputs, like so: outRas = inRas1 + ...
5
votes
1answer
4k views

Exporting each layer in map to separate image using ArcPy?

I have a mxd file with multiple layers I have to export to PNG/JPG. I would like to create a script which turns on layers one at the time before they are exported. So far I have come up with the ...
5
votes
1answer
3k views

Create conditional to check if raster has value

I have a problem with this code: ac = ExtractByMask(raster, "area.shp") arcpy.RasterToPoint_conversion(ac, "point.shp", "VALUE") The problem is that sometimes the raster has no value. (It's a flow ...
4
votes
2answers
5k views

Overwrite existing map service in ArcGIS Server through ArcPy?

I am using ArcGIS Desktop and Server 10.1. I want to over write existing map service though ArcPy and going through this link and getting an errorRuntime error Traceback (most recent call last): ...
4
votes
1answer
3k views

Debugging ERROR 000728: Field *fieldname* does not exist within table even though field exists?

I do some script for a shapefile's table. And this script works for 2 fields and do not for other ones, because of: ERROR 000728: Field FID_158_01 does not exist within table But this field is ...
4
votes
2answers
15k views

Constructing file path within Python for Feature Class within Feature Dataset?

Based on my understanding of the ArcGIS path structure, a feature class inside a feature dataset inside a geodatabase can be accessed by the following: C:\Menu\Lunch.gdb\Sandwich\Cheese Where ...
4
votes
2answers
665 views

Script (ArcPy) vs field calculator (Python Parser) behaviour of getPart in ArcGIS for Desktop?

From time to time I have to access geometry field and shuffle through points in it. Process is simple: Get shape Get it's part Iterate through part's points This is how it looks like in a script ...
3
votes
1answer
2k views

Generating sequential numbering for duplicate values in a field sorted by ObjectID

I am trying to figure out a solution to an field calculation problem. What I'm trying to do is automatically (using either ArcPy or the Field Calculator) generate sequential numbers, beginning at 1, ...
3
votes
2answers
2k views

Trace Geometric Network in custom script tool?

I'm trying to make a Python script tool which uses the Trace Geometric Network tool (10.3). My script works in the Python window, but as a script-tool, it runs and NOTHING HAPPENS. Messages state: ...
8
votes
1answer
2k views

Why del cursor/row objects of ArcPy?

Can someone help me understand what the last 2 lines of this code does: import arcpy arcpy.env.workspace = "c:/esripress/python/data/exercise07" arcpy.env.overwriteOutput = True copy = arcpy....
7
votes
2answers
4k views

Projecting single pointGeometry object with ArcPy?

In an attempt to create a python add-in for ArcMap that will pass x and y coordinates to another application via a mouse click on the map, I have written the following code. I need the output ...
6
votes
2answers
7k views

How to find and delete identical points?

I recently performed Integrate on a merged point feature class in ArcGIS 10.1. I specified "1 meter" XY tolerance for the Integrate command. The resulting point feature appears to be what I want ...
6
votes
1answer
788 views

Drawing shapes with highest possible decimal accuracy

I am trying to read input of lat and long to draw the shape based on condition.The input is standard array of lat and long with 15 decimal accuracy. I am realizing - I am loosing some decimal accuracy ...
5
votes
2answers
5k views

ArcPy Insert Cursor not inserting all rows?

I have a script here that takes data from a cross-tabulated non-spatial dataset where monthly values are stored in a single table row for a given year and linearizes those data so that each monthly ...
5
votes
2answers
860 views

Auto-updating symbology between *.mxds for same shapefile using arcgisscripting?

I have a variety of .mxds for any one project I'm working on, which are all different but all use the same set of base shapefiles for my project. I know I can save a .lyr version of my initial ...
5
votes
2answers
6k 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() ...
5
votes
3answers
2k views

Resequencing Legend Items using ArcPy?

I create various layers programmatically using ArcPy. I can adjust how the layers are sequenced using the arcpy.mapping.MoveLayer command. However, I want to have the legend reflect a different ...
4
votes
1answer
631 views

Match features that are spatially similar with ArcGIS?

I'm hoping there might be a way to match features from one feature class to features of another feature class that are the most spatially similar. I have two datasets representing the same thing that ...
4
votes
2answers
3k views

What is the most efficient way to search a geodatabase for NULL-like records?

The problem: I have a geodatabase with several datasets and many more feature classes within. The fields within the feature classes have been populated through joins with shapefiles and manual edits. ...
4
votes
2answers
1k views

Automatically emailing interim results from ModelBuilder?

I want to get ModelBuilder to email me the results of processes at certain stages so that if there are issues I can remotely login and deal with them as I do with python scripts. I have a python based ...

1 2 3
4
5
27