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

learn more… | top users | synonyms (1)

3
votes
2answers
124 views

Is it possible to have tool parameters appear only if clause met?

I'm writing an arcpy script for a tool that has a large number of parameters (around 10). About half of these are "dependent" (perhaps not in the technical sense of the term), as in [first ...
3
votes
1answer
356 views

Is it possible to get the coordinates of a user clicked point in a current MXD with ArcGIS 10.0 ArcPy?

I would like to know if it is possible to get the coordinates from a user clicked point in the current map document - arcpy.mapping.MapDocument("CURRENT")?
3
votes
1answer
1k views

ArcGIS 10.0/10.1 - arcpy - automate projection tool with different datum or projection

I am getting stuck with a task that is slightly different from the posts I found so far on this same website. Assumption: all layers have a defined coordinate system Problem: I would like to ...
3
votes
1answer
534 views

Zoom to Shapefile attribute table row feature

I am working with the python code below in ArcGIS to zoom into a shapefile's attribute table row features without selected until the end of table one by one. I am trying to use this code but this one ...
3
votes
1answer
618 views

Automate removal of duplicate polygon nodes from shape file in Arcmap

I have a whole lot of polygon shape files, many of which have got duplicate nodes. This makes processing difficult as almost all tools (erase, union, calculate area) do not work. I found that by ...
3
votes
2answers
2k views

Getting values from attribute table and inserting another table

I have line feature class of a river network and “FromTo” table. Lines are dissolved so they are not segmented from junctions. I need to write a Python script in ArcGIS to do following: Begin from ...
3
votes
2answers
2k views

Using arcpy from the command line on ArcGIS Linux Server 10.1

We installed ArcGIS SERVER (not Desktop!) 10.1 on a RHEL (Red Hat) machine. ArcGIS Sever is supported for Linux. However, it appears they don't make it easy to script in python, from the command ...
3
votes
2answers
3k 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 ...
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 ...
3
votes
1answer
3k views

How to set the Output Extent (Environment Setting)?

I'm a bit confused as I'm trying to figure out how to set my output extent before creating Thiessen Polygons in a loop of ~100 points shapefile. (ArcMAP 10.0 - Python) for i in range(3,51,1): ...
3
votes
1answer
712 views

ArcPy not running on standard console

I know this is a newbie ArcPy question, but here is the deal: While I'm inside ArcMap 10, the Python window gives me all output correctly, like this: >>> arcpy.env.workspace = ...
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 ...
3
votes
2answers
794 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 ...
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 ...
3
votes
2answers
593 views

Enabling time aware layers using arcpy

Is it possible to enable time aware on a layer programmatically? I can add a time-enabled layer to a non-time aware data frame as shown here: ...
3
votes
2answers
40 views

ArcGIS Removing values from a shapefile with Python

I've got a monster shapefile with lots of duplicate records, however each duplicate record has an accuracy rating. I want to remove all duplicate records with a lower accuracy rating. This would be ...
3
votes
2answers
71 views

Assign point IDs to respective start and end attributes of a polyline

I have two shapefiles, Point and Polyline. I'm trying to populate my polyline layer with the point data ID (systemID) where the lines start to where they end; eg. create two columns (from and to). The ...
3
votes
1answer
83 views

Using arcpy and script toolbox to add the date to a attribute table

I would like some information on how to add a date to an attribute table, by adding a user specified date in a script tool that will update the polygons attribute table. In short I have two polygons ...
3
votes
2answers
102 views

How do updateParameters and updateMessages Interact in a Python Toolbox?

I have been developing a Python toolbox which consists of 6 parameters. I have received immense amounts of help on this through StackExchange through the following posts: How to Determine if a Layer ...
3
votes
1answer
62 views

Trying to generate a PDF for each feature in a feature class based on an attribute with Python.

I have a feature class of points that represent storm water inlets. I am trying to automate a process that does the following. finds all of the inlets that have a field called "Marker" populated ...
3
votes
2answers
298 views

How can you alter label styles (font, color, size, etc.) using Python scripting? (ArcGIS 10.2)

I am trying to write a python macro that will automate the process of labeling points in a layer based on different types of apartments. For example, one style of apartments would have a blue square ...
3
votes
1answer
88 views

Copy multiple features in feature class, update field value based on number copied

I have created a field which will indicate the records I want to alter. What I want to do is then cycle through these records, each will contain sum values in a field.Based on the sum I want to copy ...
3
votes
1answer
62 views

Which parameter data type is used in the Integrate geoprocessing tool for ranking?

I'm trying to figure out which parameter data type is used in, for example, the Integrate geoprocessing tool. It looks like this: I'd like to use it in a geoprocessing tool I'm making, but can't ...
3
votes
1answer
111 views

Which feature class(es) is/are used by a service

I have several feature classes and a lot of services. When I try to make my feature class versioned I get the message that the feature class is locked which is obvious. But it's not telling me by ...
3
votes
1answer
70 views

Why is Mosaic or Mosaic To New Image causing a 1-pixel gap between adjacent images?

I have a series of adjacent PNG images, and I'm trying to merge/mosaic them into a single seamless image. The images have clean "cuts" between them, with no overlaps. However, when I use either the ...
3
votes
1answer
55 views

How to obtain the width and height of an image using arcpy

This Stack Overflow question shows how to obtain the pixel dimensions of an image using Python. Is it possible to find an image's height and width using arcpy and ArcGIS? arcpy.Describe would seem ...
3
votes
2answers
285 views

Using python to Raster clip the extent to be the same as the display?

I've been trying to figure this out for almost a week now. I am creating a tool which first needs the raster to be clipped out to the current display. I have tried all sorts of things. Below is the ...
3
votes
1answer
455 views

How to perform Tool Validation in Python Toolbox?

I'm trying to make sure there is no '-' in the output filename, and if there is, to set an error (circle with the red 'X') so that the tool can't be run, and have a tooltip that explains the issue. ...
3
votes
1answer
90 views

Python objects in my ArcMap addIn aren't instantiated

I've got a weird problem. My addin throws problems intermittently where it doesn't recognize buttons or tools when I try to toggle the visibility in my code. It seems as though the objects aren't ...
3
votes
1answer
571 views

layer.visible command not working in arcpy.mapping module

I am using the arcpy.mapping module for the first time, and the lyr.visible command is not working as it should (or I am not using it as I should). I have a list that contains the the layer names of ...
3
votes
2answers
202 views

How to work with OGR and GDAL in GP Service in ArcGIS for Server 10.1

I have got a lot troubles with GDAL and OGR in the context of ArcGIS Server on 64 bit server machine. I can run script that use GDAL in ArcGIS as Tool and in the debug mode in PyScripter, then ...
3
votes
1answer
866 views

set values in feature class attribute table to null

I've created a point-data featureclass (fc) containing data from a simple .txt file using Arcpy as follows: arcpy.CreateFeatureclass_management(out_path= outPath, out_name= 'fcTest', geometry_type= ...
3
votes
1answer
107 views

How do I use variables inside a arcpy toolbox function? [closed]

I have a point file and I need to make a lot of buffers in specific increments but I can't figure out how to interate through a list inside the buffer function. Here is what I have: import arcpy ...
3
votes
2answers
1k views

How to export a mxd to a image with transparent background

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, ...
3
votes
1answer
113 views

Join is deleting fields in arcpy

I'm working on a script to automate the conversion of CAD .dwgs of rooms to feature classes, I'm nearing completion and am now working on the second portion of the script (I've seperated it into two ...
3
votes
1answer
308 views

Using ArcPy to run Report Layout File (RLF) report and add to layout (for Data Driven Pages)?

I currently have a data driven page template set up which I manually cycle through and for each page run a Report Layout File (RLF) report and then add this to the ArcMap layout. The added element is ...
3
votes
1answer
258 views

Pythonaddins SaveDialog filter

If you look in the ArcGIS 10.1 help, the Pythonaddins module SaveDialog shows the following: SaveDialog({title}, {name_text}, {starting_location}) But if you open the python window in ArcMap, you ...
3
votes
1answer
932 views

Change ArcSDE data source for mxds in specific folder using ArcPy?

I've searched all the forums and help and have made progess but recently got an error that has thrown me for a loop - also some mxds are not being changed at all! What I'd like my code to do: Iterate ...
3
votes
2answers
341 views

Explicitly locking a file geodatabase

I need to lock a file geodatabase (or only a single Mosaic dataset) at the beginning of a python script (and release it in the end).. I looked and looked and couldn't find any explicit arcpy command ...
3
votes
1answer
997 views

Iterating through an numpy array and index to a value in another numpy array

I am struggling to get this code to work I want to iterate through an numpy array and based on the result, index to a value in another numpy array and then save that in a new position based on that ...
3
votes
2answers
821 views

Append or merge consecutive line segments (contours) as one single line of the same elevation value

Is there a way using python (ArcPy) or ArcGIS 10.1 tools to collect consecutive line segments having the same elevation value and appending/merging/generating one single line from them? Each resulting ...
3
votes
1answer
1k views

How to save currently opened mxd and changes using ArcPy and Python?

Here is what I have so far... import arcpy import arcpy.mapping as map mxd = map.MapDocument() mxd.save() And yes I know that map.MapDocument requires an argument, but I want it to automatically ...
3
votes
1answer
397 views

Arcpy: Troubleshooting parameter error for Export Report

I'm running into what I believe is a parameter error in writing an arcpy exporttoreport script. I've written several successful scripts of this same type, but the difference is that this one has a ...
3
votes
2answers
530 views

How to efficiently check for feature overlaps with Arcpy?

In an effort to reduce processing time, I am looking for ways to pre-process data within my script. I have ~18,000 featureclasses with ~500 features each (all simple circle polygons) from which I want ...
3
votes
2answers
165 views

Polyline in shapefile

I'm still pretty new to arcpy and am still learning. I'm working on a script that has a polyline as its input. I'm able to traverse the polyline and get points at certain intervals. These intervals ...
3
votes
2answers
5k views

Read specific column and row value from a text file using Python [closed]

I have a text file as following: 1.25 177. 1.50 220. 2.00 272. 5.00 427. 10.00 556. 25.00 763. 50.00 916. ...
3
votes
2answers
269 views

Get the junction id for the roads in a network dataset

I have a network dataset with roads and junctions. I am wondering what class I can use in arcpy to extract FromJunctionId and the ToJunctionId for each road segment in the network dataset. Thanks.
3
votes
1answer
335 views

How to best organize files for a large arcpy script tool?

I am writing a lengthy arcpy tool and am working with multiple python scripts, simply for organization's sake. Everything runs well when I run it from the command line, but now that I am starting to ...
3
votes
1answer
218 views

pair value comparison to generate new raster using arcpy/python

I want to write a function which takes in two arguments (from two rasters) and compare those 2 values against a set of hard coded pair values inside function. Then return a value which i want to use ...
3
votes
1answer
980 views

How can I use a variable to specify which field to update with arcpy.UpdateCursor?

I am writing a script that cycles through several different point shapefiles, finds how many lie within a given area and the writes the outcome to a table in an Access database. I've used an search ...