Paul
  • Member for 8 years, 7 months
  • Last seen more than a month ago
Removing duplicate features with same geometry in ArcMap?
Accepted answer
22 votes

If you have an advanced license, you can use Find Identical or Delete Identical. Both can be used to find/delete features that have identical attributes, or, if the Shape field is specified, ...

View answer
Exporting list of values into csv or txt file using ArcPy?
Accepted answer
19 votes

You mention that you computed a list of values in a Python script, so the easiest way to dump that to a csv would be to use the csv module! import csv res = [x, y, z, ....] csvfile = "<path to ...

View answer
Turning off layers in ArcMap via ArcPy?
Accepted answer
17 votes

The Layer object has a read/write property, visible, that can be used to turn on/off layers. This is some basic code that should get you started: #A list of layer names that you want to be turned ...

View answer
How to process large shapefiles faster in ArcGIS for Desktop?
Accepted answer
16 votes

ESRI has a blog post - aptly titled Dicing Godzillas - about processing feature classes with large amounts of vertices. It discusses the Dice tool, which splits up a shapefile's features into smaller ...

View answer
How to perform If Statement in Field Calculator of ArcGIS for Desktop?
Accepted answer
15 votes

Parser: Python Code block: def calc(f1,f2): if f1 > f2: return "True" elif f1 < f2: return "False" else: return "Equal" Expression: calc(!Dist_1!, !...

View answer
Creating and re-using map template in ArcMap?
Accepted answer
15 votes

The help page on Using Map Templates explains it quite well. Here are three different ways you can go about rectifying this. From the help, it appears that you need to make a change in the registry ...

View answer
Extending line by specified distance in ArcGIS for Desktop?
Accepted answer
12 votes

Well I think I've gotten it down for lines of any vertex count. I haven't attempted multipart lines since I've never messed with it in arcpy. The coding was made a bit more difficult since there isn't ...

View answer
Adding online basemap in ArcMap
11 votes

Complimentary use of Bing maps is currently being phased out by Esri, and after December 31st, you'll no longer be able to use it at all. Right now, I think the only way you can use Bing as your ...

View answer
Python workspace
Accepted answer
11 votes

In Python, the backslash character is treated as an escape character. \n is the newline character, \t is a tab.... There are a few different ways you can get it to work: Change your backslashes to ...

View answer
Create a line perpendicular to an existing line in ArcGIS
10 votes

Based on @Felix's answer, here's an approach that uses built-in methods on geometry objects. Supported on 10.3+. from math import atan2, pi # epsilon e = 1e-10 def tangentLine(line, dist): '''...

View answer
Creating temporary in-memory geodatabase using ArcPy
10 votes

As @PolyGeo said, you won't be able to use the in_memory workspace for Geodatabases. If you want a "temporary" geodatabase that is saved on disk, you can use the Scratch GDB. #Set the path to GDB, ...

View answer
How to split single address field into 4 fields (House No., Direction, Name, Suffix)
Accepted answer
10 votes

Instead of using multiple RegExes to parse addresses, just use Esri's out of the box tool that is designed for this task, Standardize Addresses. It's available at all license levels and my experience ...

View answer
How to check if feature class or table contains field with specific name before adding it?
10 votes

Instead of looping over the current field names, you can loop over the field names you want to add. Let's say you have a list, to_add, containing the field names you want your feature class to have. ...

View answer
If Then Else in ArcGIS model builder
Accepted answer
10 votes

If the precondition that checks for True or False is expecting a boolean, it will always evaulate to true because non-empty strings return true values, like so: >>> if "true": print "...

View answer
Translate Excel formula to be used in field calculator
10 votes

All of the trigonometric functions you need are in the math module. I presume you'll want atan2() which is the equivalent of atan(y/x). For the mod function, you'll need to use the percent symbol. ...

View answer
How to change the number of decimal digits in arcmap in symbology
Accepted answer
9 votes

You can accomplish this with the arcpy.mapping module. The following should work as long as your symbology is GraduatedColorsSymbology. Just paste into the python window and run the function with your ...

View answer
Does ArcMap have a Pan To Layer command?
Accepted answer
9 votes

The python addin button is actually simpler than I first thought. Just highlight a layer in the TOC and the button will pan to it. import arcpy, pythonaddins class ButtonClass1(object): """...

View answer
Creating square buffer around point feature using ArcGIS for Desktop?
9 votes

Since the script linked at the end of Aaron's code can only be used for square buffers and doesn't make use of the newer arcpy.da module, I've written a script that can be used to create rectangle ...

View answer
Getting XY map coordinates on mouse clicks as input variables into a python script
9 votes

You can get the coordinates a mouse click via the onMouseDownMap() function of the Tool Class for Python add-ins. The x and y values for onMouseDownMap and onMouseUpMap represent the map ...

View answer
How to use LIKE clause/condition in Arcpy.Exists/Delete
Accepted answer
8 votes

Wildcard searching is built into arcpy.ListRasters(): import arcpy arcpy.env.workspace = "c:/base/data.gdb" for raster in arcpy.ListRasters("*_*"): arcpy.Delete_management(raster) If you want ...

View answer
Re-compiling Python Addin after editing script?
8 votes

Per @blah238's suggestion, the following script closes ArcMap (if open) creates Add-in installs Add-in silently re-opens ArcMap document Save to directory containing makeaddin.py: import os #...

View answer
Checking for multiple layers existing using arcpy.Exists
Accepted answer
7 votes

You can only pass one dataset at a time to arcpy.Exists, but you just as easily can chain them together with and: if arcpy.Exists(vriLyr) and arcpy.Exists(rsltLyr) and arcpy.Exists(forCovLyr): This ...

View answer
getPart() method returns incorrect geometry from buffer in ArcGIS
Accepted answer
7 votes

Instead of using getPart(), you can use WKT on the buffered polygon itself. It's not the exact shape of the buffer (due to approximating the 3 true curves on the triangle with 15 vertices each), but ...

View answer
Script (ArcPy) vs field calculator (Python Parser) behaviour of getPart in ArcGIS for Desktop?
Accepted answer
7 votes

With cursors and the "SHAPE@" token, a geometry object is returned. The getPart() method returns an Array containing all the points for that particular part. Interestingly, field calculator also ...

View answer
Find lower left corner of a rotated polygon
7 votes

Here's a very simple approach that offloads all the processing into the Sort GP tool. Since you have access to an Advanced license, sorting by shape and starting at the lower left corner gives quick ...

View answer
need to find max value among fields AND PRINT FIELD NAME
Accepted answer
7 votes

Since your answer was tagged with arcgis-10.3, you'll find there is no need to use arcgisscripting. (I don't even know where to start with it to be honest.) You can also use the updated data access ...

View answer
Calculate Row if Row Value Equals Value in List
Accepted answer
7 votes

Well, there are a few ways to go about this. Here is one approach: import arcpy from os.path import splitext #Use splitext, as slicing is hardcoded for extension length photos = arcpy....

View answer
Using Select Layer by Attribute in ArcPy?
7 votes

You'll make life simpler in the future by using Add Field Delimiters. This will work for shapefiles, feature classes in a file geodatabase, personal geodatabase, etc. You might find that str.format() ...

View answer
Deleting features (rows) from shapefile (attribute table) using ModelBuilder?
7 votes

Edit: The first method I posted wouldn't work. This one should though. One straightforward way to do this would be to select everything you want to keep via Make Feature Layer with a where clause of ...

View answer
How to summarize GIS skills on a resume?
7 votes

If the experience you have came from a job, then I'd make bullets under that heading giving short descriptions of what you did. If you wanted, you could put your general description then follow with ...

View answer
1
2 3 4 5
9