A collection of custom Esri toolboxes written in python.
Python add-ins for ArcMap.
Quickly apply a definition query to selected layers using selected feature object id's
- Install the .addin file
- Open ArcMap and add the toolbar "Faribault"
- Select some features
- Select the layer in the TOC
- Apply the definition query using the filter button
ArcGIS Utilities
A custom data driven pages tool used for a variety of purposes.
- Optionally buffers selected feature or features
- Selects features that intersect the buffer
- Exports map of all features
- Optionally exports individual data driven pages for each feature
- Exports a csv file with the selected features
This tool clips each layer in a geodatabase and projects the data into an output database using a specified projection file.
Reprojects an entire geodatabase using a specified projection file. Layers not in a dataset will be placed in a _top
dataset.
- Copies a polygon feature class's centroid geometry into a new feature class
- Adds field
Rel_OID
typeLong
which represents the object id of the polygon
- Copies the start and endpoint of lines into a new feature class
- Adds field
related_oid
typeLong
which represents the object id of the line feature - Adds field
point_type
typeText
which will either be valueSTART
orEND
- See http://pro.arcgis.com/en/pro-app/arcpy/classes/geometry.htm
- Extracts elevation values at points and calculates them to a field
- This may crash ArcMap with large data sets
- Extracts attachments from a table and generates a unique file name for each file
- Adds a new field to the table called
file_name
that is updated to the file's unique name - Requires fields
'DATA', 'ATT_NAME', 'ATTACHMENTID'
scripts/UpdateMXDMetadata.py
Description: Iterates through an mxd's layers and extracts data source metadata. Layer descriptions are updated to the latest abstract, purpose, and credits.
Each metadata category is separated into a separate html paragraph using <p></p>
tags.
Purpose: Useful to update metadata on an arcgis server rest endpoint, because html paragraphs are formatted on the rest endpoint and in JSON responses.
Usage:
Run the script inside an arcmap python console that you want to update.
scripts/LabelRelatedRecords.py
Description: Looks up related records and generates a label with selected field in a list-like format.
Usage: See documented script
Description: Calculates the dynamic expression for a layer and can be used to dynamically display related records text for data driven pages or feature labels
Usage (see script for detail)
- Change the FindLabel parameter to the id field of the main table
- This id should be related to each of the related tables
- Also change the first line of FindLabel. Set parameter equal to the FindLabel parameter
- Change the lookup tables and assign their appropriate formatter function