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

learn more… | top users | synonyms (8)

8
votes
1answer
656 views

Reduce extent of raster processing in ArcPy or ArcGIS Desktop?

I need to reduce the processing extent of my raster by some sort of automatic procedure in python. Currently the borders of the dataset I've been using has anomalies (due to the classification of the ...
8
votes
3answers
3k views

How to get full path of layer selected in drop-down box for ArcGIS Python tool

I have a Python script-based tool in ArcGIS. One of the parameters for the tool is an input raster file, which I've set (using the properties of the tool within the toolbox) to be a Raster Layer. This ...
8
votes
2answers
2k views

Calculating Date Field with today's date from datetime.date.today()?

I'm working on part of tool that will use arcpy.CalculateField_management to add the current date to the attribut table. I've wandered far and wide on the interwebs and can't seem to find the ...
8
votes
2answers
337 views

Unusual results for geoprocessing speed tests

I have been observing unusual performance with a Python geoprocessing script. The (attached) script performs the following actions: Use a search cursor to look up UTM zone corresponding to polygon ...
8
votes
1answer
618 views

Migrating ArcPy scripts from ArcGIS 9.3 to 10?

What changes are needed to migrate scripts from the ArcGis 9.x environment/gp-object to the ArcGis 10/arcpy environment? Can anyone provide a good overview what the changes are? Can someone share ...
8
votes
1answer
2k views

concurrent use of in_memory workspace in arcpy

i am using a python script that's eliminating small polygons from a feature class. this script creates temporary feature classes with fixed (hardcoded) names in the "in_memory" workspace. example: ...
8
votes
4answers
9k views

Avoiding import arcpy error (RuntimeError: NotInitialized) when using IDLE?

ArcGIS Version: ArcGIS 10, Python 2.6.5 Machine: Windows 7 64bit (Intel) I'm receiving the following error when importing arcpy using the the IDLE (gui and cmd prompt) and when using pythonwin. I ...
8
votes
3answers
198 views

“Greedy” clipping lines with polygon

I am wishing to clip a set of polylines (black lines in image below) to the outer boundary of a polygon. Any voids within the polygon should be ignored. My ideal output are the dashed yellow lines. ...
8
votes
3answers
1k views

python script error- with GetParameterAsText [duplicate]

I have a seemingly simple code which iterates through a list of feature classes and calculates an ID field in the attribute table that is equal to the first 5 characters of feature class name. The ...
8
votes
2answers
4k views

Is it possible to convert graphics to features in ArcGIS 10 using arcpy?

Apologies if this is easy but I cannot seem to find the answer. Is there a way to convert a graphic to feature, i.e. use the "Convert Graphics to Feature" tool on the toolbar, within an arcpy script? ...
8
votes
6answers
2k views

Divide polygons into *n* number of groups of equal counts with ArcGIS 10.2

One of my tasks for work is to divide parcels into groups. These groups will be used by agents to talk to property owners. The goal is to make the agent's job easy by grouping parcels that are near ...
8
votes
2answers
484 views

ArcGIS 10: Create an event linear layer from a point layer based on directionality

I have a point layer that reflects the speed limits and a line layer of the roads. The location of the speed sign indicates in which direction the speed limit applies. How can I make linear event ...
8
votes
3answers
2k views

Permanently replace/update server/service in each ArcSDE Layer in MXD?

Using the mxd.findAndReplaceWorkspacePaths method, if and MXD is updated and the path the the .sde connection file moves again all of the data sources will break again. Is there a method to ...
8
votes
1answer
2k views

Editing End Points in Polyline using ArcPy?

I am trying to make a polyline endpoint snapping tool in Python using ArcGIS 10. using a Search Cursor I read in the values to an array of line objects (which contain the feature id of the line, and ...
8
votes
2answers
1k 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 ...
8
votes
3answers
5k views

Setting parameters in Script Tool using Python?

I hate to bug you all with the same problem over and over again but I run into a new problem everytime I make a slight change to the code. All I did to the code below was to replace field names to ...
8
votes
1answer
193 views

Do ArcGIS Pro tasks support Python Toolbox tools which operate on Map Frames?

Do ArcGIS Pro tasks support Python Toolbox tools which operate on Map Frames? The reason I ask is that I am stuck when trying to do the following: Start ArcGIS Pro 1.1.1 Create a new project - I ...
8
votes
3answers
249 views

How to Find out Point which falls between two parallel lines

I am facing one Problem in ArcGIS. I work on a navigation Database. In our database single lane streets are represented by a single Line, while a multi-lane street (Street with Divider in centre) is ...
8
votes
1answer
3k views

Setting up Drop-Down list in Parameters of Python script tool?

I am trying to create a tool from a python script I have written that will take a list I have created and use it as a drop-down menu in the finished tool as one of the inputs (see attached image for ...
8
votes
1answer
353 views

Where to find and share Python geoprocessing scripts? [duplicate]

Where are folks storing and sharing their Python geoprocessing scripts? For example, I know that GitHub has some shared scripts. ESRI is phasing-out ArcScripts, which is still really handy, and ...
8
votes
2answers
4k 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 ...
8
votes
2answers
1k views

How to write scripts that can call on both Arcpy and PyQGIS?

I have spent quite a bit of time looking for a clear answer this topic and have still been unable to really accomplish my goal of accessing PyQGIS in a stand alone script. Parts of answers have been ...
8
votes
4answers
438 views

How to determine if point is surrounded using raster processing?

I am attempting to improve a currently extremely cumbersome vector/python process for a natural hazard model. At the moment we have a lengthy script which generates distance/bearing lines from a given ...
8
votes
1answer
367 views

Difference between python window and toolbox

Are there differences in performance or other potentially critical area between running a python script in the python window versus running it from the toolbox in ArcGIS 10.0? I am asking in cases ...
8
votes
1answer
824 views

Does arcpy have a method for accessing related records within a cursor?

I have a line feature class that represent sampling segments. I have a data table of field notes in the same Geodatabase that is connected to the feature class with a Relationship Class. Is there a ...
8
votes
5answers
988 views

How to programatically identify the “Joined Field” in ArcMap?

Is it possible to programmatically identify the Join Field that is being used to Table Join two datasets together in ArcMap? I am currently using ArcGIS 10.0, SP5 and would prefer an ArcPy solution, ...
8
votes
2answers
6k views

Building extraction with LiDAR data (Improve Process)

I have the following process for automatically creating building outlines/footprints from Las files and was wondering if anyone can help improve it or has suggestions for other processes to use? ...
8
votes
1answer
1k views

Handle annotation layers with arcpy

I want to access annotation layers using arcpy (the purpose is to verify few text strings in text annotations). By annotation I mean draw tool annotations, not dynamic labels. These annotation layers ...
8
votes
2answers
1k views

How to remove spikes in polygons with ArcGIS 10/Python?

In the picture below you can see a polygon layer, representing steep slopes, extracted from a TIN. The polygons have a lot of spikes in them. I would like to remove these spikes while the rest of the ...
8
votes
4answers
3k views

python.exe has stopped working

A python script was written about 18 months ago by a person who has now left. It produced the required outputs then. I've been asked to run it again but with different (finer resolution) data inputs....
8
votes
0answers
432 views

Two machines running the same arcpy based software - only one is leaking memory [closed]

Ok, so I'm running a rather large Python application based on arcpy on two separate machines - one of them is leaking memory and one is not. Both are running the same operation in the software. The ...
8
votes
0answers
389 views

Using a different Python IDE/debugger for ArcGIS [duplicate]

Possible Duplicate: How can I effectively debug arcpy Python scripts? I prefer to use PyScripter over IDLE as my IDE/debugger for writing GP scripts in Python. In ArcGIS, however, when I ...
7
votes
3answers
472 views

Performing Feature to Point (no advanced license) using ArcPy?

I have a set of polygons I have calculated the centroids of, but am having trouble finding a way to output these values to a point shapefile. I dabbled with arcpy.MakeXYEvents_management, but it only ...
7
votes
3answers
7k views

How to delete feature class features faster (ArcPy)

I have written this script that recurses through all feature classes in a given set of feature datasets and deletes all their features. It appears to do the job but it runs pretty slowly. Is there ...
7
votes
3answers
11k views

Python - formatting path strings and checking if a path exists

I would like to use the following code to determine if a path exists. The path I would like to check is being passed to my code via parameter on a ArcMap 10.0 tool dialog box. The parameters data ...
7
votes
1answer
6k 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
1answer
2k views

Counting number of points in a point shapefile - ArcGIS 10.0 / arcpy

I assumed this would be an easy thing to do. I'm loading a point shapefile into a map like this: layer = arcpy.mapping.Layer(file_name) Is there a way to get the number of points in the shapefile? ...
7
votes
1answer
3k views

Computing UTM Zone from lat/long point?

I am trying to convert a latlong point to UTM. To define UTM projection, I need to calculate zone for the point. I am trying to figure out the best way to do this. One way to do this would be ...
7
votes
2answers
2k views

Distinguishing Python version when using IDLE with ArcGIS Pro and ArcGIS 10.x for Desktop architecture?

I have just started to work with Python 3.4.1 which comes with ArcGIS Pro 1.0.0, on my laptop, which also has Python 2.7.8 which comes with ArcGIS 10.3 for Desktop installed, and I would like to ...
7
votes
1answer
4k views

Delete layer from ArcMap using Python

Problem: I'm trying to loop through all my layers looking for layer named "CADAnnotation". If the layer exists then remove the layer from the mxd Notes: Running from Stand-Alone script (ie. NOT ...
7
votes
2answers
2k views

How to implement bivariate Ripley's K function?

The attached image shows a forest gap with red pine represented as circles and white pine represented as crosses. I am interested in determining if there is a positive or negative association between ...
7
votes
3answers
4k views

Clipping raster by multiple datasets or polygons?

I would like to clip a DEM using a grid of polygons. It's probably easier to use multiple polygons in one shape file, but I haven't managed this so I'm trying to use a for loop so I can loop through ...
7
votes
2answers
221 views

Installing an ArcGIS add-in on several PCs

I usually do my python scripts and add them to ArcMap in the form of add-ins. First I launch the ArcGIS Python Add-In Wizard, create a project, a toolbar and the tool. Then, every time I do an ...
7
votes
3answers
773 views

Why does arcpy.da.SearchCursor() class not autocomplete within Eclipse?

I am very new to GIS. I just installed eclipse luna with pydev plug-in and ArcGIS 10.1 for Desktop. When I write a script, trying to import arcpy.da.SearchCursor I see that no SearchCursor is ...
7
votes
2answers
1k views

Handling user password input in ArcPy scripts?

I'm currently trying to write a script that has a username & password input which then returns some data if the user has appropriate access. The script works just fine when I hardcode my own ...
7
votes
2answers
4k views

Frequency, summarize tool options of ArcGIS for Desktop?

I'm looking for some general frequency, summarize tool. What I basically want is some tool like the summarize tool in ArcGIS (right click in the attribute table> summarize) that runs on all attributes ...
7
votes
3answers
200 views

Identify and delete overlaping or near lines with similar running

I have shapefiles with lines that shows surface water runoff. I need to clear and simplify these shapefiles by condition that if some lines are near by other and has similar running, this lines has to ...
7
votes
2answers
2k views

Using multiple wildcard parameters with arcpy.ListFeatureClasses

I know there has to be a way to do this but I'm having trouble figuring out how to do so. I would like to create a list of feature classes to perform operations on however, I want to have the list ...
7
votes
2answers
5k views

Getting XY map coordinates on mouse clicks as input variables into a python script

This is my first time coding in python, so bear with me. I wrote a script to calculate an analytical solution to find the orientation of a plane based on three points. I'm using ArcGIS 10.1. # Input ...
7
votes
2answers
9k views

How to clip a vector feature to the extent of an existing raster dataset using arcpy

I have a clipped raster dataset with polylines (from the contour tool) overlayed (see attached). I am trying to clip the polylines to the extent of the raster dataset, which seems simple enough, but ...