This repository contains an ArcGIS toolbox of Python 3 geoprocessing tools for creating, manipulating, and validating GeMS-style geologic map databases for use in ArcGIS Pro. Additional resources; vocabularies, symbology, links to other projects, etc.; are available at the NGMDB GeMS site.
If you are looking for tools that work in ArcMap using Python 2.7, go to gems-tools-arcmap
There are two ways you can get the toolbox. You can download a zip file with the contents of this repository every time there is a new release or you can clone the repository using git
and pull the latest changes as necessary with a simple terminal command.
- Download the latest release from Releases or from the green Code button above.
- Unzip the file to a folder of your choice. This will extract a single folder named
gems-tools-pro-
followed by either the version number (e.g.,gems-tools-pro-2.1
) if downloaded from Releases ormaster
if downloaded from the Code button.
This method requires you to have git
installed on your computer. If you know you do, you can skip down two steps and use that instance of it. If not, you can use the instance that was installed in the default conda environment when ArcGIS Pro was installed.
- Click on 'Start' (
) in the lower-left of your desktop.
- From the list of programs, select ArcGIS and then Python Command Prompt.
- At the prompt, type
cd
and the path of the location where you would like the toolbox to be. - Paste in
git clone https://github.com/usgs/gems-tools-pro.git
cd
togems-tools-pro
- Now, whenever you get notice of a new release or if it's just been awhile and you want to make sure you are using the most up-to-date version, go back to this folder and type
git pull
.
- Open ArcGIS Pro and go to either the Contents or Catalog pane.
- Under Project, right-click on Folders to add a folder connection. Navigate to the toolbox folder.
- Note that this only saves the folder connection with the current project file. If you want to have the toolbox handy for any project that you open up,
- go to the Catalog pane
- select the Favorites tab
- click Add Item
- choose Add Folder, and navigate to the folder.
The documentation for these tools may not be complete or may be poorly formatted for display in either the ArcGIS Pro help popup (hover your cursor over the ? icon when looking at the tool parameter form) or metadata view (right-click on the tool from the Catalog pane and choose View Metadata), but, for the most part, the Python 3 versions produce the same results as the older Python 2.7 versions.
- Each tool comes with documentation inside the parameter form.
- Check out the wiki for help on these tools and extensive advice on using these tools to create, edit, and validate GeMS-style databases.
- If you have a question about how to build or attribute a GeMS-compliant database or the schema in general, visit the Discussions tab of this repo. You will need a GitHub acccount to post there. NOTE we are no longer using Gitter for discussions.
- Documentation for the toolbox and all tools and is also available in GeMS_Tools_Arc10.docx and GeMS_Tools_Arc10.pdf found in the
Docs
sub-folder โ these are both somewhat out-of-date; check back for new versions. - If, when using a tool, it fails to run and produces an error message, first check that you have the latest release of the tool. If that is not the source of the problem, start a new issue at this repository (see the Issues tab above). Provide a screenshot of the error message if you can.
- Explore the Jupyter Notebooks at the notebooks branch of this repo.
Suggestions for improvements and edited files submitted by email will be considered, but you are strongly encouraged to use GitHub to fork the project, create a new branch (e.g., "MyFixToProblemXXX"), make changes to this branch, and submit a pull request to have your changes merged with the master branch. Excellent guides for various aspects of the git workflow can be found here:
- Despite the suffix "_AGP2" on most script files, the tools have been tested with ArcGIS Pro 3.0
- "Project Map Data to Cross Section" does not always produce the correct apparent dip direction. The dip magnitude is correct, but it may be in the wrong direction.
- "MapOutline" stumbles over some choices of datum.
- "DMU to .docx" requires the python-docx third party package. Do not try to install this package into your default arcgispro-py3 python environment. Instead, install it into a clone. Remember to activate this environment before running the tool.
- Issue 11 describes a problem found when using the Fix Strings tools but may occur elsewhere as well; trying to update rows with an update cursor may throw an error if there is an attribute rule on the field with a message similar to:
Failed to evaluate Arcade expression. [
Rule name: Calc _ID,
Triggering event: Update,
Class name: MapUnitLines,
GlobalID: ,
Arcade error: Field not found GlobalID,
Script line: 1]
even when the field, e.g., GlobalID
, does exist. The workaround for now is to disable the attribute rule.
GeMS Tools was originally written by in Python 2.7 by Ralph Haugerud, Evan Thoms, and others and ported to Python 3 by Evan Thoms.