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

learn more… | top users | synonyms (1)

3
votes
1answer
45 views

Number of items in a Combo Box

I'm developing a Combo Box for an ArcMap toolbar, that at present simply lists all of the layers that are in the table of contents. However the height of the drop-down menu is very small, and I cannot ...
3
votes
1answer
141 views

Is it possible to run ArcToolbox without ArcMap?

I am following the accepted answer for the question: Batch conversion of netCDF to Raster in ArcGIS using Python, obviously, to convert netcdfs. The code taken from the above answer (pasted below) ...
3
votes
3answers
104 views

Error when Projecting Rasters using ArcPy?

Using ArcGIS 10.3 I'm receiving the dreaded 'ERROR 999999' when attempting to project a geodatabase full of rasters from WGS84_UTM_zone_10N to Nad83_BC_Environment_Albers import arcpy InRasterGDB = ...
3
votes
2answers
69 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
1answer
31 views

ArcMap Using Python to Rename a Feature Class based on Print Results

I would like to rename a feature class based on the EDITOR and DATE fields. I wrote this code: import arcpy fc = "C:\Users\PythonTesting.gdb\MyFile" f1, f2, f3 = "EDITOR", "DATE", "OBJECTID" ...
3
votes
1answer
79 views

Add value to field using arcpy

I calculated the azimuth angle between two points. I'm trying to create a new field where I will store my angle values, but although the field is created it stays empty, no values within! I'm using ...
3
votes
2answers
76 views

How to get size of SDE geodatabase feature class

Is there a way in catalog or arcpy to determine the amount of hard drive space a SDE feature class takes up on disk? In catalog the 'size' column is blank and Esri help states: The size, ...
3
votes
1answer
81 views

Track progress of running GP tools (in arcpy script) programmatically?

I am looking for a way to access a GP tool running in a Python script to be able to see how much of the job has already been done. I have found SetProgressor function, but this one is available only ...
3
votes
1answer
78 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 ...
3
votes
1answer
244 views

Using Python Add-In to delete/remove ArcMap layers that are turned off?

I have made a python addin button which removes layers that are turned off in an MXD. The strange thing is that I get different results depending on whether I run the python commands in the python ...
3
votes
1answer
166 views

How do I classify number values in Python to assign it to a group?

I have calculated the number of points that exists for a SqMi area and am trying now to assign it to a certain group based on where it falls in the classification. Does anyone know a tool that I can ...
3
votes
1answer
386 views

Why does the next() method fail after the last record, using arcpy.da.SearchCursor?

Using the older arcpy.SearchCursor, the next() method would return Nothing once the last record had been passed. Using the newer arcpy.da.SearchCursor, I'm finding that the next() method crashes the ...
3
votes
1answer
1k views

Why does Raster Calculator (RasterCalculator_sa) give ERROR 000539 in ArcPy?

I am getting a not executed error for a raster calculator. Here is part of the output: File "C:\projectTemp\FloodAnalysis\floodxsectionanalysis.py", line 107, in makeSeemless ...
3
votes
2answers
206 views

How to specify units when using SelectLayerbyLocation_management WITHIN_A_DISTANCE?

Can anyone help by suggesting how to specify the units when using the SelectLayerbyLocation_management tool. I am selecting by "WITHIN_A_DISTANCE" and the ArcGIS resources do not suggest how to do ...
3
votes
2answers
720 views

Why does ArcPy Excel To Table give AttributeError: 'module' object has no attribute? [closed]

I'm trying to import an excel workbook using arcpy. ExcelToTable, but I get the following traceback: ERROR updateParameters Execution Error: Runtime error Traceback (most recent call last): File ...
3
votes
2answers
345 views

How to change the style of the north arrow from “ESRI North 4” to “ESRI North 1”?

I have a Python assignment where I have to write a script to change the style of the north arrow from “ESRI North 4” to “ESRI North 1”. I wrote the following code: import arcpy mxd = ...
3
votes
3answers
549 views

How to create button that calculates acres on selected polygon features?

I'm looking to create a simple button that calculates acres on selected polygons and can't quite find what I'm looking for. I read through this thread: automating a python script..., but found it ...
3
votes
2answers
1k 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
264 views

IO Performance of ArcPy in virtual machine

The following script just copies a file into RAM, performs some simple operations and writes the result back to hard disc: import arcpy import random import time arcpy.management.Delete("in_memory") ...
3
votes
2answers
220 views

How can I generalize “field name” variable?

Here is my code: import arcpy import math arcpy.env.workspace = "C:\RG\Kings County\Test.gdb" fcs = arcpy.ListFeatureClasses("NVF_*") try: for fc in fcs: rows = arcpy.UpdateCursor(fc) ...
3
votes
2answers
899 views

Python Search cursor: Error handling

I have a search cursor that using a SQL query to match addresses and then returns the associated roll number with that address. However, some addresses do not match the roll number and then I believe ...
3
votes
2answers
475 views

Create line from two points, two different feature class

I'm attempting to automate this in ModelBuilder in ArcMap. I have one feature class with one point (Start) and one feature class with multiple points (Destinations). I want to iterate through the ...
3
votes
1answer
590 views

Why is my simple arcpy script failing? (sets raster cell value to null if below threshold value, ArcGIS 10.1)

As mentioned in the title, simple script to set null cell values below three standard deviations beyond the mean: import arcpy, sys, os #Accept input and output raster inRas = sys.argv[1] outRas = ...
3
votes
2answers
2k 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
2answers
801 views

Csv to Shp conversion? [duplicate]

I am working on a really big script right now where I have a csv file that I have removed rows and columns from, and edited the headers. I need to create one big shapefile for the entire csv file then ...
3
votes
2answers
147 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
418 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
2k 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
634 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
685 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
1answer
237 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
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
3k 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
3answers
2k views

Convert an .xlsx datasheet with point feature data into a POINT feature class

I am trying to create a script tool to automate this process, eventually it will be used for batch processing but at the moment I can't even get test data to work. This is pretty basic at the moment, ...
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
795 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
876 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
652 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
1answer
28 views

What does InsertRow() return if the insert is not successful?

I have some basic code that inserts rows using an InsertCursor. oc = arcpy.da.InsertCursor(outputFC, someFields) for item in rowsForInsertCursor: tmp = oc.insertRow(item) del oc It seems the ...
3
votes
2answers
87 views

Using ArcPy to zoom to Y,X (string) coordinate pair copy/pasted from Google Maps?

I frequently use google maps to find locations, and paste the coordinates into the "go to XY" toolbar in decimal degrees. It's a bit repetitive to paste the latitude into one box, and the longitude ...
3
votes
2answers
159 views

Converting Date field to string using ArcGIS for Desktop?

I'm working with two data sets that require a compound key to join or relate. The two fields are: 'Node_ID' which is a long integer field referring to a particular electrical substation [887932] ...
3
votes
1answer
46 views

Python output for batch “FeatureToRaster” in ArcPy

I am trying to batch process the conversion of shapefiles to rasters. I am stuck on how to specify the name for each output raster file. Part of the trick is that my input shapefiles are the names of ...
3
votes
1answer
179 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
1answer
105 views

Updating fields of feature layer and reflecting changes in original data

I am trying to write a script that will select points from a feature class that are within a polygon and update the fields within the original point feature class. The problem I'm running into is ...
3
votes
2answers
256 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
120 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
75 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 ...