-
Notifications
You must be signed in to change notification settings - Fork 21
GeMS_ToolsDocumentation
GeMS Tools is an ArcGIS toolbox to facilitate working with the GeMS geologic map database schema.
To obtain and install GeMS Tools, see the README file at https://github.com/usgs/gems-tools-arcmap.
If you see a need to correct or improve this documentation, please feel free to edit this wiki.
These scripts are far from perfect. When things fail, here are a couple of things to look at.
- Check for unexpected file and directory locks. Have you Stopped Editing? Is there another ArcMap process lurking somewhere with a lock on your database? Quit everything Arc, open Windows Task Manager, check for--and kill--orphan ArcMap and ArcCatalog process, and restart ArcMap.
- Some of the scripts appear to run into name-space issues that I (RH) don't understand. Quit ArcMap and try running the script from ArcCatalog.
Scripts .docx to DMU, Deplanarize CAF, and DMU to .docx are particularly problematic. MapOutline doesn't handle non-NAD27/NAD83 datums well.
Here is the current tool set. Click on a tool name to jump to its documentation.
Tool | Create and edit database | Cartography | Finalize database | Validate database |
---|---|---|---|---|
.docx to DMU | X | |||
Attribute by Key Values | X | |||
Compact and Backup | X | X | ||
Create New Database | X | |||
Deplanarize CAF | X | |||
DMU to .docx | X | X | ||
FGDC Metadata, step 1 | X | |||
FGDC Metadata, step 2 | X | |||
FGDC Metadata, step 3 | X | |||
Fix string values | X | |||
Geologic Names Check | X | X | ||
Inclination Numbers | X | |||
Make Polygons | X | |||
Make Topology | X | |||
MapOutline | X | |||
Project Map Data to Cross Section | X | |||
Project Points to Cross Section | X | |||
Purge Metadata | X | |||
Relationship Classes | X | |||
Set ID values | X | |||
Set PlotAtScale Values | X | X | ||
Set Symbol Values | X | X | ||
Symbol to RGB | X | |||
Topology Check | X | X | ||
Translate to Shapefiles | X | |||
Validate Database | X | X |
.docx to DMU** extracts DMU paragraphs from a Microsoft Word document, calculates values of HierarchyKey, and partially fills in table DescriptionOfMapUnits. Non-DMU paragraphs (the rest of the map text) are ignored. The Word document must be formatted using the paragraph styles in USGS Pubs template MapManuscript_v1-0_04-11.dotx, which is included with in folder GeMS_Tools/Docs.
DMU paragraphs in the manuscript are those tagged with styles DMU-Heading1, DMU-Heading2, DMU Headnote, DMU Paragraph, DMU Unit 1, DMUUnit 1 (1st after heading), DMU Unit 2, etc. Some character formatting (bold,italic, superscript, subscript, DMU Unit Label character style, FGDCGeoAgefont) is recognized and preserved in DescriptionOfMapUnits.
If a paragraph is a unit description, UnitLabl in the mapmanuscript is related to field Label in the database tableDescriptionOfMapUnits. If there is no match, UnitLabl is matched to the fieldMapUnit in DescriptionOfMapUnits. If the paragraph is a heading, the headingtext is matched to the Name field in DescriptionOfMapUnits. If a headnote, thefirst 20 characters of the headnote text is matched to the Description field.If no matching row is present in DescriptionOfMapUnits, a new row is created.If a new row is created, the UnitLabl is used to fill both MapUnit and Labelfields in DescriptionOfMapUnits.
Values of UnitLabl in the manuscript must be unique.
Parameter | Explanation | Data Type |
---|---|---|
DMU_manuscript_file | Microsoft Word .docx file formatted according to USGS template MapManuscript_v1-0_04-11.dotx. | File |
Geologic_map_geodatabase | GeMS-style geodatabase with DescriptionOfMapUnits table. DMU table may be empty or partly complete. | Workspace |
- The lxml package must be present on the host computer. Easiest to install using the Python pip utility. Note that you may want to install it for both 64-bit and 32-bit Pythons (e.g., C:\Python27\ArcGISx6410.5and C:\Python27\ArcGIS10.5).
- docxModified.py, which is included in the GeMS toolbox
GeMS_AttributeByKeyValues_Arc10.py
Attribute By Key Values steps through an identified subset of feature classes in the GeologicMap feature dataset and, for specified values of an independent field, calculates values of multiple dependent fields. It is useful for translating single-attribute datasets into GeMS format, and for using GeMS to digitize in single-attribute mode.
Many geologic map database schemas have characterized features--especially lines--with a single attribute such as"contact--approximate". GeMS characterizes lines by multiple attributes, such that
LTYPE="contact--approximate"
might, depending on map scale and the author’s intentions, translate to
Type="contact”
IsConcealed="N"
LocationConfidenceMeters=150
ExistenceConfidence="certain"
IdentifyConfidence="certain"
Symbol="01.01.03"
This tool simplifies the translation from such schemas into GeMS.
Parameter | Explanation | Data Type |
---|---|---|
Input_geodatabase | An existing GeMS-style geodatabase with a GeologicMap feature dataset. | Workspace |
Key_Value_file | A pipe ( | ) -delimited text file that describes mapping from unique values of an independent attribute to values of multiple dependent attributes. See file Dig24K_KeyValues.txt (should be located in folder GeMS_Toolbox/Resources) for an example with format instructions. | Text File |
Attribute By Key Values requires an accessory keyvalue file. You must create a plain-text file (use gedit, Notepad or Wordpad, save as .txt) that looks like:
ContactsAndFaults
LTYPE|Type|LocationConfidenceMeters| ExistenceConfidence| IdentityConfidence| Symbol
contact|contact| 20| certain| certain| 01.01.01
contact--approximate|contact| 150| certain| certain| 01.01.03
…
OrientationPoints
STYPE|Type|LocationConfidenceMeters|OrientationConfidenceDegrees|IdentityConfidence|Symbol
bedding|bedding| 20| 5| certain| 06.01.01
…
An example keyvalue file is provided with the toolbox, in the folder GeMS_Tools\Resources. Important aspects of the keyvalue file are:
- It contains one or more sets of header lines, such as lines 1, 2, and 6, 7 above. Header lines come in pairs: the first line identifies a feature class within the GeologicMap feature dataset. The second line names the independent attribute within that feature class and then the dependent attributes whose values will be calculated based upon the independent attribute.
- All lines after a pair of header lines are definitions for the respective values specified in that header line, until the next pair of header lines is encountered.
- Values within lines are separated by the pipe symbol (|). This permits the use of commas within values. Trailing (or leading) spaces are acceptable, but not required.
This file can also be created and edited with a spreadsheet program (e.g., LibreOffice Calc, Microsoft Excel), saving as a .csv file and setting the delimiter to “|”.
Attribute By Key Values will:
-
Read the keyvalue file for instructions
-
Open the GeMS-format database and calculate unassigned feature attributes (values of , zero-length string, or zero) based on key values (LTYPE, STYPE, or other). Note that if any attributes have already been assigned they will NOT be changed WITH THE EXCEPTION OF NUMERIC FIELDS WITH ZERO (0) VALUE. This allows you to somewhat easily override the default attributes
-
Write short messages to the script output window if unknown key values are encountered
Tool Attribute By Key Values can be run multiple times during the course of building a geodatabase (recommended) or just once at the end.
GeMS_CompactAndBackup_Arc10.py
Compact and Backup compacts a database and copies it to an archive version. The archive version is named geodatabasename_current date. Multiple backups in a single day will have suffixes a, b, c, etc.
Parameter | Explanation | Data Type |
---|---|---|
Input_geodatabase | The geodatabase which will be compacted and then backed up | Workspace |
Message_for_log_file (Optional) | Optional message to be written, with timestamp and username, to file 00log.txt inside the geodatabase directory. If this is a personal geodatabase, the write should fail gracefully and this message will not be recorded. | String |
Create New Database creates a new GeMS-style geodatabase.
Note that with default settings this tool creates only the minimum required feature dataset, feature classes, and tables. Check the appropriate boxes to add OrientationPoints, GeologicLines, etc. See the GeMS documentation for the purposes of these optional elements. Change the number of cross sections to 1 (or more) to create feature dataset(s) for cross sections.
This tool may take several minutes to run.
Parameter | Explanation | Data Type |
---|---|---|
Output_Workspace | Name of a directory. Must exist and be writable. | Folder |
Name_of_new_geodatabase | Name of a file or directory to be created; must not exist in output workspace. Use .gdb extension to create a file geodatabase, .mdb extension to create a personal geodatabase. If no extension is given, will default to .gdb. | String |
Spatial_reference_system | May select an ESRI projection file, import a spatial reference from an existing dataset, or define a new spatial reference system from scratch. | Coordinate System |
Optional_feature_classes_tables_ and_feature_datasets (Optional) | Select items from this list as needed. Note that if you later discover you need an additional feature class, table, or feature dataset, you may 1) define this element from scratch in ArcCatalog, or 2) run this tool again, creating a new geodatabase with the same spatial reference system, and creating the needed feature class(es), table(s), or feature dataset(s). Then copy and paste the additional elements into your existing geodatabase. | Multiple Value |
Number_of_cross_sections | An integer in the range 0 to 26. | Long |
Enable_edit_tracking | If checked, enables edit tracking on all feature classes. Adds fields created_user, created_date, last_edited_user, and last_edited_date. Dates are recorded in database (local) time. Default is checked. This parameter is ignored if the installed version of ArcGIS is less than 10.1. | Boolean |
Add_fields_for_cartographic_ representations | Default is unchecked. If checked, adds a representation--fields RuleID and Override--and representation rules to feature classes ContactsAndFaults, GeologicLines, and OrientationPoints, and equivalent feature classes in any CrossSection feature datasets that are created. Also adds coded-value domains that tie RuleID values (consecutive integers) to FGDC symbol identifiers (e.g., 1.1.7 for a dotted contact). The representation rules (aka symbols) are from the Arizona Geological Survey and are a subset of the FGDC symbology with a few additional symbols. Rules and coded-value domains are copied from a geodatabase and .lyr files in the Resources\CartoRepsAZGS directory within the GeMS toolbox directory. | Boolean |
Add_LTYPE_and_PTTYPE | If checked, adds LTYPE field to ContactsAndFaults and GeologicLines and adds PTTYPE field to OrientationPoints. Useful for digitizing purposes, or for ingesting ALACARTE-style data sets. Default is unchecked. With the use of Feature Templates for digitizing, values of LTYPE may be helpful proxies for clusters of Type - IsConcealed - LocationConfidenceMeters - ExistenceConfidence - IdentityConfidence - Symbol values. | Boolean |
Add_standard_confidence_values | Default is checked. If checked: 1) Attaches standard values of "certain" and "questionable" as a coded-value domain to all ExistenceConfidence, IdentityConfidence, and ScientificConfidence fields. 2) Adds definitions and definition source for "certain" and "questionable" to the Glossary table. 3) Adds the definition source (FGDC-STD-013-2006) to the DataSources table. The use of these particular values, or of only 2 values for confidence, is not required. You may use other values, but they must be defined in the Glossary table. | Boolean |
Deplanarize CAF removes excess nodes from arcs in the ContactsAndFaults feature class of the GeologicMaps feature dataset of a GeMS-style geodatabase. Note: This script has not been extensively tested. PLEASE back up your geodatabase before running it. Examine the results for correctness.
Arcs are IDENTITYed with MapUnitPolys to ascertain their bounding MapUnits. Arc-end points are created, labeled with XY, and sorted by XY to identify nodes. If 2 arcs meet at a node and have identical values for attributes Type, IsConcealed, ExistenceConfidence, IdentityConfidence, LocationConfidenceMeters, DataSourceID, Label, and Notes, they are merged. If 3 arcs meet at a node, the HierarchyKey values of the bounding map units are used to determine which pair of arcs bound the youngest polygon and thus should be continuous across that node if their values of attributes Type, IsConcealed, ExistenceConfidence, IdentityConfidence, LocationConfidenceMeters, DataSourceID, Label, and Notes are identical. If 4 arcs meet at a node, one of the arcs should be IsConcealed = 'Y'. The remaining 3 arcs are then treated as a 3-arc node.
Input geodatabase is assumed to have a GeologicMap feature dataset that contains feature classes ContactAndFaults and MapUnitPolys and a DescriptionOfMapUnits table.
This script will fail if the geodatabase has a Topology class that involves ContactsAndFaults.
Feature classContactsAndFaults is assumed to have attributes Type, IsConcealed, ExistenceConfidence,IdentityConfidence, LocationConfidenceMeters, DataSourceID, Label, Notes, ContactsAndFaults_ID, and Symbol. Feature class MapUnitPolys is assumed to have attribute MapUnit. Table DescriptionOfMapUnits is assumed to have attributes MapUnit and HierarchyKey. HierarchyKey must be populated and populated correctly.
Nodes are named by their XY coordinates recorded to within 0.01 map units. We assume no nodes are so close that they have the same name.
Parameter | Explanation | Data Type |
---|---|---|
Input_geodatabase | Should be a GeMS-style geodatabase. | Workspace |
DMU to .docx reads table DescriptionOfMapUnits in a GeMS-style geodatabase and creates"Description of Map Units" as a Microsoft Word .docx file using paragraph styles defined in USGS Pubs template MapManuscript_v1-0_04-11.dotx. The resulting file is likely to need minor editing, particularly finding and replacing all instances of “--” with em dashes.
DMU to .docx supports a minimal set of markup tags in text within the Description field:
<b> ... </b>
bold
<i>... </i>
italic
<g> ... </g>
FGDCGeoAge font
<sup>...</sup>
superscript
<sub>...</sub>
subscript
<br>
break(start new paragraph)
Parameter | Explanation | Data Type |
---|---|---|
Source_geodatabase | An existing GeMS-style geodatabase. Table DescriptionOfMapUnits should be (at least partially) populated, and HierarchyKey values should be present, as DMU table is sorted on HierarchyKey before translation to .docx file | Workspace or Feature Dataset |
Output_workspace | Directory in which output file will be written. Should exist and be writable. | Folder |
Output_filename | Name of output file. File will be overwritten if it already exists. If filename does not end with ".docx", ".docx" will be appended to file name. | String |
Use_MapUnit_as_UnitLabl | Values in fields MapUnit or Label can be used for UnitLabl. Default (use MapUnit) is recommended for constructing and proofing the DMU table. It may be useful to use Label (box unchecked) for creating a final MSWord file of the DMU. | Boolean |
List_of_Map_Units | If checked, creates a List of Map Units which omits map unit descriptions. | Boolean |
- The lxml package (see http:lxml.de; look for Windows binary to install) must be present on the host computer. Easiest to install using the Python pip utility. Note that you may want to install it for both 64-bit and 32-bit Pythons (e.g., C:\Python27\ArcGISx6410.5 and C:\Python27\ArcGIS10.5)
- docxModified.py,which is included in the GeMS_Toolbox/Scripts directory
- MSWordDMUtemplate, which is a directory within the GeMS Tools\Resources directory. This directory provides essential elements of a Microsoft Word document that uses the paragraph styles defined in USGS Pubs template MapManuscript_v1-0_04-11.dotx
FGDC Metadata, step 1 helps elaborate FGDC CSDGM2-style metadata for all elements of a GeMS-style geodatabase.
This script:
-
Exports existing ArcGIS metadata to FGDC-format XML.
-
Adds (or replaces) the branch with a statement that this is a GeMS-style database.
-
Creates a branch if none is present.
-
Adds branch with statement referring to ExistenceConfidene and IdentityConfidence attributes within database.
-
Adds branch with statement referring to LocationConfidenceMeters attributes within database.
-
Adds branches, one per datasource, that correspond to rows within DataSources table witin database.
-
Adds (or replaces) branch with statement that summarizes objects (tables, feature datasets, feature classes) within database.
-
Writes resulting modified metadata to a standalone XML file named -metadata.xml.
Before running this script, ensure that database is complete and clean by running Validate Database tool. Run this script. After running this script, use a standalone XML metadata editor (e.g., USGS Metadata Wizard) to complete the XML metadata. In particular
-
Citation will need completing or improving. Note that most geologic-map databases are not published by themselves; usually they are part of a larger work (a map report). Identify the larger work. The title of the database probably should not be identical to (but likely includes) the title of the larger work. The originator(s) of the database may or may not be the same as the originator(s)/author(s) of the larger work.
-
Data quality/Data sources will need significant editing, parsing the concatenated "Source" and "Notes" fields from the DataSources table, now in the datasource title field, into the various fields required by the CSDGM schema.
-
If you used the Topology Check and Validate Database scripts, you may want to add a statement about the logical consistency of the database.
-
You may wish to describe the process steps relevant to creation of the database.
Then validate the edited XML metadata. Revise as needed. When complete, run script FGDC Metadata, step 2 to create standalone XML metadata for each table, feature dataset, and feature class within the database. Edit/validate/revise the resulting metadata files, and save. Run script FGDC Metadata, step 3 which imports all the standalone XML metadata back into the database.
Parameter | Explanation | Data Type |
---|---|---|
GeMS-style_geodatabase | Workspace |
FGDC Metadata, step 2 helps elaborate FGDC CSDGM2-style metadata for all elements of a GeMS-style geodatabase. This script copies XML metadata for GeMS-style database as a whole and modifies copies to create formal metadata for objects (tables, feature datasets, feature classes) in the database. It does not create metadata for rasters.
Modifications to input XML metadata are:
-
Updating branch using entity descriptions, enumerated value domains, and other domain descriptions taken from the GeMS documentation (transcribed in file GeMS_Definitions.py in Scripts subdirectory of the GeMS_Tools directory) and the input database. These descriptions may be supplemented by a workgroup- or project-specific definition file, most easily created by editing a copy of my_GeMS_Definitions.py, found in the Resources subdirectory of the GeMS_Tools directory.
-
Pruning branches to include only those appropriate to the object
-
Replacing and branches with thosepovided automatically for the object by ArcGIS (but not for non-spatial tables)
-
Modifying <title> and text
After running this tool, look at file -metadataLog.txt to see what elements remain undescribed. You may provide descriptions by hand editing, or add descriptions to the definionExtensions file and re-run this script.
Input metadata are expected to conform to the FGDC CSDGM standard. Output metadata approximate this standard. Output may need further ediiting (e.g., with the USGS Metadata Wizard). Use Peter Schweitzer's metadata parser (mp.exe, available as tool USGS MP Metadata Translator (Conversion) in ArcGIS) to check your work.
At present the modified metadata are written to stand-alone XML files. After running this script and performing any subsequent hand editing, you should (1, optionall) purge the geoprocessing history from the database and (2) import the XML metadata into the database with script FGDC Metadata, step 3.
Parameter | Explanation | Data Type |
---|---|---|
GeMS-style_geodatabase | Workspace | |
XML metadata | Stand-alone XML metadata for input GeMS-style database. Typically prepared with script CSDGM metadata, step 1, and then extensively modified using an XML metadata editor such as the USGS FORT Metadata Wizard. Note that we do NOT extract this XML from the input database. This is because--at least at version 10.5 of ArcGIS--the FGDC metadata import-export cycle is not conservative: you do not get out what you put in. | File |
definitionExtensions (Optional) | Optional: file with extensions to definitions given in GeMS_Definitions.py. Useful for persistent entity and field descriptions, amongst other things. See file my_GeMSDefinitions.py, in Scripts directory of GeMS_Tools, for an example and further directions. | File |
FGDC Metadata, step 3 helps elaborate FGDC CSDGM2-style metadata for all elements of a GeMS-style geodatabase. The script imports standalone XML metadata files into a GeMS-style geologic map database. XML files may be prepared with tools CSDGM Metadata, step1 and CSDGM Metadata, step2 and hand editing with a standalone metadata editor such as the USGS Metadata Wizard.
Given a database named DB.gdb, XML files are assumed to be named
-
DB-metadata.xml
-
DB_Glossary-metadata.xml
-
DB_GeologicMap-metadata.xml
-
DB_ContactsAndFaults-metadata.xml
and similar. Any error messages from the import process are deleted; to preserve them, edit the script to set debug = True.
Parameter | Explanation | Data Type |
---|---|---|
GeMS-style_geodatabase | Workspace | |
xml directory (optional) | Directory which contains XML metadata files. Default is the directory which hosts the GeMS_style_geodatabase. | Folder |
Fix strings cleans up text strings in a GeMS database. Removes leading and trailing spaces and fixes bad values.
Parameter | Explanation | Data Type |
---|---|---|
input_geodatabase | An existing GeMS-style geodatabase. | Workspace |
Geologic Names Check automates some of the steps in a geologic names review as required by USGS publication policy. It searches within the DescriptionOfMapUnits table for names and usages found in the U.S. Geologic Names Lexicon (Geolex) and provides a report template in spreadsheet form for the author and reviewer to use during the review process. The tool reports the Geolex names found within the map unit name, the usages associated with those names, and whether or not the author's choice of geographic extent matches that found in Geolex. Comparisons of age and status (formal vs informal) are not at this time considered.
Parameter | Explanation | Data Type |
---|---|---|
DMU_Table | a GeMS-compliant DescriptionOfMapUnits table. Must contain the fields HierarchyKey, MapUnit, Fullname, and Age, but they may be in any order, need not be CamelCase, and there are no special constraints on how the values are formatted. Values in Name are searched for Geolex names. If no Geolex name is found, Fullname is searched as well. | Table |
States_extent | One or more (comma separated) state or territory abbreviations. Examples are "WA", or "ID,OR,WA" | String |
open_report_when_completed? (optional) | Should the Excel report file be opened when the script has finished running? | Boolean |
More info at Filling out the Geologic Names Report
GeMS_InclinationNumbers_Arc10.py
Creates point feature class OrientationPointLabels with dip and plunge numbers for appropriate features within OrientationPoints. Adds a layer representing the new feature class to your map composition.
Note that this script invokes a definition query using PlotAtScale values. These must exist! If the output layer appears to be empty, open layer properties and delete the definition query. Do you see inclination numbers? Good. Run Set PlotAtScales and then rerun Inclination Numbers
If this script fails because of locking issues, try (a) Stop Editing, or (b) save any edits and save the map composition, exit ArcMap, and restart ArcMap. Maybe the script will then run satisfactorily.
Parameter | Explanation | Data Type |
---|---|---|
Feature_dataset | The feature dataset with class OrientationPoints for which inclination annotation is to be created. | Feature Dataset |
Map_scale_denominator | Denominator of the map scale fraction. For a 1:24,000-scale map, enter 24000. | Double |
Inclination Numbers calls function isPlanar, defined in GeMS_utilityFunctions.py:
returns True if orientationType is a planar (not linear) feature
def isPlanar(orientationType):
planarTypes = ['joint','bedding','cleavage','foliation','parting']
isPlanarType = False
for pT in planarTypes:
if pT in orientationType.lower():
isPlanarType = True
return isPlanarType
Make Polygons:
- Creates (or recreates) feature classMapUnitPolys from lines in ContactsAndFaults, excluding lines for which IsConcealed='Y'
- Attributes polygons using temporary label points created from any polygons in the pre-existing MapUnitPolys and any label points in feature class MapUnitPoints
- Flags (a) polygons with multiple, conflicting, label points, (b) multiple, conflicting label points within a single polygon, (c) polygons with blank or null MapUnit values, and (d) contacts that separate polygons of the same MapUnit. These errors are written to feature classes errors_multilabelPolys errors_multilabels, errors_unlabeledPolys, and errors_excessContacts
- IDENTITYs the new MapUnitPolys with a temporary copy of the old MapUnitPolys. Any polygons--or fragments of polygons--that have changed their MapUnit are saved in feature class edit_ChangedPolys
- Optionally, saves old feature class MapUnitPolys to MapUnitPolysNNN, where NNN is a successively higher integer
- When used within ArcMap, selecting a MapUnitPolys layer will cause the data source of the layer to be changed to the newly created polygon feature class with no other change in layer properties (e.g., symbolization)
Note that if you remove a contact or fault that separates two existing polygons with different MapUnit values and run Make Polygons, the resulting multi-(temporary) label polygon is correctly flagged as an error. Re-running Make Polygons will (incorrectly) cause this error to disappear! Moral: Run Make Polygons once and FIX THE PROBLEMS.
While running, Make Polygons writes (overwrites) and deletes temporary feature classesxxxlabel, xxxpolys, and xxxtlabels, all within the GeologicMap feature dataset.
Parameter | Explanation | Data Type |
---|---|---|
input_geodatabase | An existing GeMS-style geodatabase. | Workspace |
Save_old_MapUnitPolys (Optional) | If checked, saves old MapUnitPolys feature class to feature class MapUnitPolysNNN, where NNN is a successively higher zero-padded integer. Default is checked (true). | Boolean |
Saved-layer_directory (Optional) | Directory in which .lyr files are saved for any map layers with sources MapUnitPolys, errors_excessContacts, errors_multilabelPolys, errors_multilabels, and errors_unlabeledPolys. These .lyr files are deleted when script completes. Must have write permission. Default is the directory that hosts the input geodatabase. | Folder |
Label_points_feature_class (Optional) | An optional point feature class with attribute MapUnit (and perhaps other attributes), which may used to label polygons. Familiar to those who used workstation ArcInfo, in which such features were necessary. ArcGIS does not require label points; polygons can be created and attributed without them. | Feature Class |
Creates and validates a topology feature class within a GeMS-style feature dataset. The new topology class is named GeologicMap_Topology (for the GeologicMap feature class) or xxx_Topology (for all other feature classes, where xxx is the prefix for the ContactsAndFaults-equivalent feature class within that feature dataset). Any existing topology with this name will be deleted. The input feature dataset should contain feature classes xxxContactsAndFaults and xxxMapUnitPolys (where xxx may be null).
Esri topology rules applied are:
- Must Not Overlap (Line)
- Must Not Self-Overlap (Line)
- Must Not Self-Intersect (Line)
- Must Be Single Part (Line)
- Must Not Have Dangles (Line)
- Must Not Overlap (Area)
- Must Not Have Gaps (Area)
- Boundary Must Be Covered By (Area-Line)
Parameter | Explanation | Data Type |
---|---|---|
Input_feature_dataset | Dataset | |
use_MUP_rules | Default = checked. If checked, adds rules that involve MapUnitPolys feature class (no gaps, no overlaps, boundaries must be covered by ContactsAndFaults). In some cases it is useful to build a topology that does not incorporate MapUnitPolys, most commonly so that this topology need not be deleted before (re)making polygons. | Boolean |
MapOutline calculates a map boundary and tics for rectangular (in latitude-longitude space) areas. Locations of boundary and tics are projected to the specified output coordinate system.
Locations of boundary and tics may be specified in either NAD27 or NAD83, independently of the output datum and projection. This may be useful if, for example, it is desirable that a map boundary coincides with that of a published USGS quadrangle map (most of which are located at even latitude-longitude values in NAD27) but because the mapper is working with GPS coordinates or dense lidar data, both of which are commonly in NAD83-based projections, the map database should be in a NAD83-based projection.
Output feature classes MapOutline and Tics are written to the top level of the output geodatabase. Any existing feature classes with these names will be overwritten.
Parameter | Explanation | Data Type |
---|---|---|
SE_longitude | Longitude of SE corner of map rectangle. May be in decimal degrees (-120.625), degrees - decimal minutes (-120 37.5) or degrees - minutes - seconds (-120 37 30). West longitudes (all of US) are negative. | String |
SE_latitude | Latitude of SE corner of map rectangle. May be in decimal degrees (42.375), degrees - decimal minutes (42 22.5) or degrees - minutes - seconds (48 22 30). South latitudes (none in US) are negative. | String |
width_(longitudinal_extent) | E-W extent of map rectangle. Values <= 5 are assumed to be in degrees. Values >5 are assumed to be in minutes. Enter 600 to obtain a 10 degree extent. | Double |
height__(latitudinal_extent) | N-S extent of map rectangle. Values <= 5 are assumed to be in degrees. Values >5 are assumed to be in minutes. Enter 600 to obtain a 10 degree extent. | Double |
tic_spacing | Value is in decimal minutes | Double |
Is_NAD27 | Check to locate map boundary and tics at NAD27 lat-long positions. Uncheck to locate at NAD83 positions. | Boolean |
output_geodatabase | Must be an existing, writable geodatabase. Please do not select a feature dataset or feature class (though ArcGIS will let you do so). | Workspace or Feature Dataset |
output_coordinate_system | Browse to select coordinate system from ArcGIS-provided coordinate system definitions, to import a coordinate system from an existing data set (RECOMMENDED) or define a coordinate system from scratch. | Coordinate System |
scratch_workspace | Directory that is writable. Files xxxbox.csv, xxxtics.csv, xxx1.dbf, xxx1.dbf.xml will be written to this directory and then deleted. Existing files with these names will be lost! | Folder |
GeMS_ProjectCrossSectionData_Arc10.py
Project Map Data toCross Section generates backdrop feature classes useful in constructing a geologic cross section. Inputs include the GeologicMap feature dataset of a GeMS-style geodatabase, a cross-section line (feature class, feature layer, or selection), and a DEM. The cross-section line need not be straight.
Final output is written to feature dataset CrossSectionxx,where xx is Output_name_token. This feature dataset will be created if it does not exist.
By default, all feature classes in the GeologicMap feature dataset are projected into the cross section feature dataset, with the exception of feature classes whose names begin with errors_ and ed_. Alternately, you may choose to project specified feature classes.
-
Polygons are projected to line segments that follow the topographic profile of the section line. Projected lines for MapUnitPolys (or any other polygon feature class that spans the entire section line) constitute the topographic profile.
-
Lines are projected to short vertical line segments located at the point where lines cross the section line. Line segments for ContactsAndFaults are below the topographic profile. All other line feature classes are projected to line segments above the topographic profile.
-
Points are projected to points at the appropriate elevation in the vertical plane of the section line.
For point feature classes the distance from the section line and the local azimuth of the section line at the projection point are recorded in fields DistanceFromSection and LocalCsAzimuth. If a point feature class has fields Azimuth and Inclination (e.g., OrientationPoints), new fields ApparentDip, Obliquity (angle between Azimuth and LocalCsAzimuth), and PlotAzimuth (rotation field for symbolization) are calculated.
Output feature classes are named ed_CsxxInputFeatureClass, where xx is Output_name_token. Existing feature classes with these names will be overwritten.
This script also creates empty GeMS feature classes CSxxContactsAndFaults, CSxxMapUnitPolys, and CSxxOrientationPoints if they are not already present in the output feature dataset. You may find it useful to load data from the appropriate ed_CSxxxx feature class into these classes.
Parameter | Explanation | Data Type |
---|---|---|
GeMS-style_geodatabase | An existing GeMS-style geodatabase. May be .gdb or .mdb. Must have a GeologicMap feature data set. | Workspace |
Project_all_features_in_GeologicMap | Default = true (checked). If checked, all point, line, and polygon feature classes within GeologicMap feature dataset (except for certain edit classes) are projected into cross section. If checked, the Feature_classes_to_Project parameter is ignored. If unchecked, you should specify which feature classes should be projected with the Feature_classes_to_Project parameter | Boolean |
Feature_classes_to_Project (Optional) | Used only if Project_all_features_in_GeologicMap is False (unchecked). Specify which point, line, and polygon feature classes to project. Note that the tool will happily project feature classes that are not within the GeologicMap feature dataset. This may not be meaningful! | Multiple Value |
DEM | Digital elevation model that encompasses section line and buffered selection polygon. Z units should be equal to XY units of GeologicMap feature dataset. | Raster Dataset |
Section_line | Feature class, feature layer, or selection that contains ONLY ONE element. Section line need not be straight. Zigs are OK and you can make a section along a stream course. Points to be projected onto section line are selected by buffering the section line with FLAT line ends. To project points that are beyond the ends of the section line, extend the section line. Points are projected to nearest point on section line using LocateFeaturesAlongRoutes. | Feature Layer |
Start_quadrant | Where does section start? (This may not control the section orientation. If you don't get the results you expect, try flipping the section line.) | String |
Output_name_token | Short text token used to name output feature dataset and feature classes. The output feature dataset will be named CrossSection Output_name_token. If this feature dataset does not exist it will be created. Output feature classes will be named ed_CSOutput_name_tokenInput_featureclass_name Suggested values are A, B, C, ... If the cross section has vertical exaggeration that is not 1, set the token to B5x, or C10x, or ... | String |
Vertical_exaggeration | Default is 1. If you change to another value, suggest you incorporate this value in the output name token. | Double |
Selection_distance | Distance, in GeologicMap XY units, within which point features are projected onto the cross section plane. | Double |
Add_LTYPE_and_PTTYPE | Feature classes CSxxMapUnitPolys, CSxxContactsAndFaults, and CSxxOrientationPoints will be created in the output feature dataset if they are not already present. Check this box to add LTYPE field to CSxxContactsAndFaults and PTTYPE field to CSxxOrientationPoints. | Boolean |
Force_exit | If checked, use sys.exit() to force an exit with error. Allows re-run of tool without re-entry of all parameters. Default is false (unchecked). | Boolean |
Scratch_workspace (Optional) | If blank, output feature dataset will be used as scratch workspace. Temporary feature classes have names that begin with 'xxx'. Existing feature classes with these names will be overwritten. | Workspace or Feature Dataset |
Save_intermediate_data | Default = NO (unchecked). This script creates temporary tables in the input geodatabase and temporary feature classes in the scratch workspace (default is the output feature dataset). If this box is unchecked, these tables and feature classes will not be deleted when the script finished. Check this box if you need these temporary data for troubleshooting. Note that using the default scratch workspace, saving intermediate data and then running the tool to create another feature dataset will not work. You must first delete the temporary data files within the first feature dataset. | Boolean |
GeMS_ProjectPtsToCrossSection_Arc10.py
Project Points to Cross Section projects points within a specified horizontal distance of a cross-section line into the vertical cross-section plane. Output is a feature class with attributes className_ID, ID, and DistanceFromSection. The source point feature class may then be joined to the output feature class--using ID and _ID as the join fields--to make the entire set of source feature class attributes available. The cross-section line must be straight!
If points are for orientation data (i.e., have an Azimuth attribute), the apparent dip (or plunge) of each orientation is calculated, as well as the obliquity of the measurement to the section line and the angle (PlotAzimuth) at which a symbol should be rotated.
Script ProjectMap Data To Cross Section is likely to be more useful. It will project data to a zig-zag or curved section line.
Parameter | Explanation | Data Type |
---|---|---|
Featureclass_that_contains_cross-section_line | Line feature class that contains the cross-section line. Typically, the CartographicLines feature class within the GeologicMap feature dataset. | Feature Class |
Cross-section_Label | One line needs to be selected from the feature class that contains cross-section lines. Selection is on the value of the "Label" field. Cross-section lines should have unique Label values. | String |
Point_class_to_be_projected | Point feature class that is to be projected. May be well points, OrientationPoints, or other. | Feature Class |
Key_field | Field in point class to be projected that serves as a primary key. If there is an _ID field in the point feature class, Key_field will be automatically reset to this _ID field. | Field |
Vertical_exaggeration | Desired vertical exaggeration. A real number. Default value is 1.0. | Long |
DEM | Digital elevation model that overlaps the points to be projected. Vertical units should be same as horizontal units, or the vertical exaggeration will be incorrect. | Raster Dataset |
Max_projection_distance | Distance from cross-section line within which points will be projected. Value is in map units. | Long |
Output_feature_dataset | Location of output data. Suggest use of one of the GeMS-defined feature datasets CrossSectionA, CrossSectionB, ... If appropriate feature dataset is not present, quit and run Create New Database tool to create empty cross-section feature datasets, which can then be copied and pasted into the existing map geodatabase. | Feature Dataset |
Output_feature_class_name | Name of the output featureclass. Any existing feature class with this name will be overwritten. Note that feature class names must be unique within a geodatabase. This suggests that, if there may be multiple cross sections, the name of the enclosing feature dataset should be incorporated within the feature class name. | String |
Scratch_workspace (Optional) | If left blank, defaults to the output feature dataset. Several feature classes (xxx1, xxx2, and xxx4) will be written to this workspace and then deleted. Any existing feature classes with these names will be deleted. | Workspace or Feature Dataset |
Purges metadata of geoprocessing history (and probably any other elements that don't have a place within the FGDC CSDGM2 metadata schema). Steps through all feature datasets, feature classes within feature datasets, tables ,and the dataset as a whole; for each item this script:
- Exports existing metadata as FGDC CSDGM2 metadata
- Clears metadata with USGS EGIS Clear Metadata tool
- Imports exported CSDGM2 metadata
Note that feature classes that are not within a feature dataset are not processed.
This script will leave the directory that hosts the geodatabase with amultitude of .xml metadata files
Parameter | Explanation | *Data Type |
---|---|---|
Input_geodatabase | An existing geodatabase. May be a file (.gdb) or personal (.mdb) geodatabase. | Workspace |
Output_directory (Optional) | Where .xml metadata files are created. If not specified, defaults to directory that hosts input geodatabase. | Folder |
The USGS EGIS tools must be installed for this script to work.
GeMS_RelationshipClasses1_Arc10.py
A GeMS geodatabase has numerous implicit relationships. For example,
- table DescriptionOfMapUnits references table DataSources via the DefinitionSourceID
- table DescriptionOfMapUnits references table GeoMaterialDict via GeoMaterial
- feature class MapUnitPolys references table DescriptionOfMapUnits via MapUnit
- feature class MapUnitPolys references table DataSources via DataSourceID
- feature class MapUnitPolys references table Glossary via IdentifyConfidence
These relationships may be made explicit as joins or relates (which live in an .mxd document) or as relationship classes which live in the geodatabase. Relationship Classes creates a number (though in many cases not all useful or all possible) of relationship classes within a GeMS-style database.
Note that:
- Relationship classes are named by the referencing table and field, e.g., DMU_DefinitionSource, DMU_GeoMaterial, MUP_MapUnit, MUP_DataSource, MUP_IdentityConfidence
- Any existing relationship class with the same name is overwritten
- This script creates a RelationshipClasses feature dataset. If this feature dataset already exists it is overwritten. Newly-created relationship classes are NOT placed in this feature dataset, though you may do so afterwards
Parameter | Explanation | Data Type |
---|---|---|
GeMS_geodatabase | Name of geodatabase to which relationship classes will be added. Note that any existing relationship classes with the same names will be deleted. | Workspace |
GeMS-style databases use _ID values as primary keys; these values are repeated as ID values in other tables where they serve as foreign keys to tie tables together. Set ID values generates _ID values while preserving any links established by existing _ID and ID values. As an option, GUIDs may be substituted for plain-text _ID and ID values.
This script modifies the input geodatabase. Make a backup copy (with Compact and Backup) before you run it!
Parameter | Explanation | Data Type |
---|---|---|
Input_GeMS-style_geodatabase | The geodatabase for which _ID values are to be created or recreated. Must exist. May be file geodatabase (.gdb) or personal geodatabase (.mdb). | Workspace |
Use_GUIDs (Optional) | Default is unchecked (false),which creates _ID values as several characters which denote the table (e.g., MUP for MapUnitPolys) followed by consecutive zero-padded integers: MUP0001, MUP0002, MUP0003, etc. If checked, creates GUIDs (Globally-Unique IDs which are many-byte nonsense strings) for _ID values. | Boolean |
Do_not_reset_DataSource_IDs | If unchecked, resets values of DataSources_ID and all DataSourcesID, LocationSourceID, AnalysisSourceID and similar that refer to DataSources_ID. Default is checked, which leaves these values unchanged. | Boolean |
Sets values of item PlotAtScale so that a definition query
[PlotAtScale] >=MapScale
limits displayed features to those that can be shown without crowding at the specified map scale. Note that MapScale is the DENOMINATOR of the scale ratio; that is, PlotAtScale of 24000 means feature can be plotted without crowding at map scales of 1:24,000 and larger.
Input feature class must have PlotAtScale field. If input feature class is named "OrientationPoints", point to be plotted of a too-close pair is biased towards (a) upright or overturned bedding (not bedding without facing direction), (b) bedding (not joint, foliation, lineation, ...), and (c) lower value of OrientationConfidenceDegrees. Large feature classes (>1,000) and large Maximum_value_of_PlotAtScale (>100,000) lead to long calculation times. A more efficient algorithm might be in order.
Parameter | Explanation | Data Type |
---|---|---|
Feature_class | Must have PlotAtScale field. | Feature Class |
Minimum_separation _(mm) | Set this on basis of symbol diameter, in mm on the page. For FGDC structure symbols, 8 works OK. | Double |
Maximum_value_of_PlotAtScale | Large values (e.g., >100,000) with large feature classes (e.g., > 1,000 features) can take a LONG time to calculate. | Double |
Set Symbol Values sets the Symbol attribute for some features in a GeMS-style geodatabase to match symbol IDs in the GSC implementation of the FGDC Digital Cartographic Standard forGeologic Map Symbolization (FGDC-STD-013-2006).
Values for line symbols are calculated on the basis of map scale and the GeMS attributes Type, IsConcealed, LocationConfidenceMeters, ExistenceConfidence,and IdentityConfidence.
Values for orientation point symbols are calculated from Type and OrientationConfidenceDegrees, for example,
for Type = bedding:
if OrientationConfidenceDegrees <= threshold:
symbol = 06.02
if OrientationConfidenceDegrees > threshold:
symbol = 06.33 #bedding symbol with open center
This script calculates Symbol for feature classes ContactsAndFaults, GeologicLines, and OrientationPoints.
Symbols are only calculated for recognized Type values. Recognized Type values are given in file Type-FgdcSymbol.txt, which is located in the Resources folder of GeMS Tools. This file may be edited to reflect your choices for Type values, add additional Type values, or change the correlation between *Type *and symbol ID.
Parameter | Explanation | Data Type |
---|---|---|
Feature_dataset | The feature dataset with classes xxxContactsAndFaults, xxxGeologicLines, and xxxOrientationPoints for which Symbol values are to be calculated. xxx may be null (the GeologicMap feature dataset), "CSA" for CrossSectionA, or similar. | Feature Dataset |
Map_scale_denominator | Denominator of the map scale fraction. For a 1:24,000-scale map, enter 24000. | Double |
Certain_to_approximate_threshold_mm_on_map | The value of LocationConfidenceMeters, converted to mm on the map, at which lines change from "certain" (continuous) to "approximate" (dashed). If map scale denominator is 24,000 and the certain to approximate threshold is 1.0, lines with LocationConfidenceMeters <= 24 will have continous-line symbols. If map scale denominator is 100,000 and the certain to approximate threshold is 2.5, lines with LocationConfidenceMeters <= 250 will have continuous-line symbols. | Double |
Use_inferred_short_dash_line_symbols | FGDC-STD-013-2006 defines "approximate" (long dash) and "inferred" (short dash) symbols and distinguishes inferred on the basis of how-located, not how-well-located. Yet by this how-located standard (not directly observed), most geologic lines are inferred, and this is not common usage. Check this box to use "inferred" symbols for lines with LocationConfidenceMeters greater than a threshold value. | Boolean |
Approximate_to_inferred_threshold_mm_on_map (Optional) | The value of LocationConfidenceMeters, converted to mm on the map, at which lines change from "approximate" (long dash) to "inferred" (short dash). If threshold is 4 and map scale denominator is 24,000, lines with LocationConfidenceMeters > 98 will be drawn with short dashes. | Double |
Use_approximate_strike-and-dip_symbols | Default is checked. Uncheck to avoid use of open-center symbols for approximately-oriented bedding. | Boolean |
OrientationConfidenceDegrees_threshold | FGDC-STD-013-2006 describes special symbols for some common orientation-data types to denote "when the measurement of strike and (or) dip value is approximate but the location of observation is accurate." For these types, if OrientationConfidenceDegrees > threshold value, the approximate symbol is assigned. | Double |
Set_polygon_symbols_and_labels | If checked, Symbol and Label values will be calculated for MapUnitPolys, using values from table DescriptionOfMapUnits. Default is checked. | Boolean |
If you check Set_polygon_symbols_and_labels there must be a DescriptionOfMapUnits table with rows for each map unit AND with values, for each map unit, of MapUnit, IdentityConfidence, Symbol, and Label.
Calculates values of AreaFillRGB in table DescriptionOfMapUnits of a GeMS-style geodatabase. Symbol values must be present and are assumed to reference the WPGCYMK color set, which is included in style file USGS Symbols2.style.
Parameter | Explanation | Data Type |
---|---|---|
Input_geodatabase | An existing geodatabase. May be a file (.gdb) or personal (.mdb) geodatabase. | Workspace |
- Calls module colortrans.py, which calls module wpgdict.py. Both are included in the *GeMS_Toolbox/Scripts *directory
Topology Check analyzes a map-like feature dataset within a GeMS database for topology appropriate for a geologic map. It assumes there is a DescriptionOfMapUnits table within the host geodatabase. Analysis does not alter the input geodatabase. The tool is very useful for catching digitizing errors related to poorly-controlled snapping. See head of the script file for more information.
Not all geologic-map topology errors will be identified. Some of the features identified may not be errors. Use your judgement!
Output is a folder inGdb_Topology, located in the same folder as the input geodatabase, that contains geodatabase inGdb_TopologyCheck.gdb and HTML file FDS.html, where FDS is the name of the analyzed feature dataset. Within inGdb_TopologyCheck.gdb/FDS are several feature classes:
- xxxContactsAndFaults---copy of input ContactsAndFaults
- xxxMapUnitPolys---copy of input MapUnitPoints
- xxxContactsAndFaults_planarized---planarized CAF, with left and right polygon info
- xxxContactsAndFaults_unplanarized---unplanarized CAF
- errors_xxx_BadNodes---nodes with probable geologic-topology inconsistencies
- errors_xxx_FaultFlipNodes---nodes at which fault-line direction changes. Probably one fault line should be flipped
- FDS_topology---ESRI topology class
- errors_FDS_line---ESRI topology errors
- errors_FDS_point---" "
- errors_FDS_poly---" "
- xxxMissingConcealedCAF_nodes---nodes at which a concealed contact could be drawn
xxx is a short token that signifies the feature dataset. Feature classes errors__FDS__line, errors__FDS__point, and errors__FDS__poly are each only present if there are errors of that geometry.
For each feature class within which duplicate point features are detected, a table
- dups_FC is written, where FC is the name of the feature class.
errors_xxx_BadNodes includes:
- 1-arc nodes that are not faults (i.e., non-fault dangles)
- 2-arc nodes at which there is a change in Type, or one arc is concealed and one is not
- 3-arc nodes at which:
- 1 or 2 arcs are concealed
- no two arcs have same Type
- all arcs are concealed and not all adjoining map units are identical
- all arcs are not faults and the youngest adjoining map unit is not bounded by arcs of same Type (note that for some maps this rule may not be applicable)
- 4-arc nodes at which:
- opposite arcs don't have same Type
- 0, 3, or 4 arcs are concealed
- all arcs are faults
- fault marks transition from unconcealed to concealed crossing arcs
- any 5+ arc nodes
These rules stem from the following observations:
- Faults have offset
- Contacts are continuous
- The improbability of coincident truncations implies that there are no 4-arc junctions unless one arc is the concealed continuation of its opposite arc
The Nodes and MapUnit adjacency modules use functions isFault and isContact. These functions, listed below, may need to be modified for some geodatabases.
def isFault(lType):
if lType.upper().find('FAULT') > -1:
return True
else:
return False
def isContact(lType):
lType = lType.upper()
if lType.find('CONTACT') > -1:
return True
elif lType.find('FAULT'):
return False
elif lType.find('SHORE') > -1 or lType.find('WATER') >-1:
return True
elif lType.find('MAP') > -1: # is map boundary?
return False
elif lType.find('GLACIER') > -1 or lType.find('SNOW') >-1 or lType.find('ICE') > -1:
return True
else:
return False
Parameter | Explanation | Data Type |
---|---|---|
Feature dataset | A map-like feature dataset. Contains xxxContactsAndFaults (arcs) and xxxMapUnitPolys (polygon) feature classes. | Feature dataset |
HKey test value | MapUnits with HierarchyKey values less than HKey test value are deemed covering units beneath which one might choose to draw concealed faults and contacts. HKey test value is typically a string, something like '2', or '01-02'. Don't enter the enclosing quotes. See the DescriptionOfMapUnits table in the database you are analyzing to select a value. Correct identification of covering units requires that the youngest "map units" (water, permanent snow, unmapped area) have the lowest HKey values. Covering units may not be correctly identified in some cases in which map units are divided into rock-type silos (e.g., "Igneous Rocks"). | |
String |
- Must Not Overlap (Line) xxxContactsAndFaults
- Must Not Self-Overlap (Line) xxxContactsAndFaults, xxxGeologicLines
- Must Not Self-Intersect (Line) xxxContactsAndFaults, xxxGeologicLines
- Must Be Single Part (Line*) xxxContactsAndFaults, xxxGeologicLInes*
- Must Not Overlap (Area) xxxMapUnitPolys
- Must Not Have Gaps (Area) xxxMapUnitPolys
- Boundary Must Be Covered By (Area-Line) xxxMapUnitPolys / xxxContactsAndFaults
Note the lack of a rule Must Not Have Dangles (Line). This is because dangling fault lines (and dangling concealed fault or contact lines) are common in geologic maps and are not errors. Dangling contacts (which are errors) are identified by the Nodes option.
- More than 4 lines never join at a node.
- Four lines join at a node only if two opposite lines are contacts (not concealed) and the other lines are both of the same Type and one or both is concealed. This explicitly disallows the possibility of faults that do not offset contacts.
- Where three lines join, either none are concealed or all are concealed. An exception is where two of the lines are the map boundary.
- There should be no pseudonodes (junctions between only two lines where both lines have same values for Type, LocationConfidenceMeters, ExistenceConfidence, IdentityConfidence, and DataSourceID). Pseudonodes where the lines are identical—i.e., the line joins itself (forming a closed loop) are OK.
- Nodes with one line are dangles. Dangles are permissible where the line is a fault or the line is concealed. Note that some fault dangles are errors. To evaluate conformance with these rules, the input ContactsAndFaults feature class is first planarized, that is, all lines are broken at intersections. Nodes that do not meet these constraints are written to output feature class errors_xxxBadNodes.
Note that this routine may not identify some direction errors where three fault arcs meet. Also, some changes of fault-arc direction are intentional, for example on a scissors fault where the DOWN side changes along fault strike.
ContactsAndFaults can be IDENTITYed with MapUnitPolys to ascertain the map units on either side. Results are displayed in tables arranged by LEFT MAP UNIT (Y axis) and RIGHT MAP UNIT (X axis). Values on each axis are sorted by DescriptionOfMapUnits.HierarchyKey. Arcs in ContactsAndFaults are divided into 3 groups and a table is written for each:
- Concealed contacts and faults (IsConcealed = 'Y')
- Contacts (not concealed) (isContact and IsConcealed = 'N')
- Faults (not concealed) (isFault and IsConcealed = 'N')
These tables can be useful for identifying mis-tagged polygons and lines. In the table for Concealed contacts and faults, all arcs should list along the diagonal (same unit on either side). Table Contacts (not concealed) should have no diagonal values (no internal contacts) and significant unconformities will correspond to rows & columns with large numbers of populated cells. Table Faults (not concealed) makes it easy to identify faults that cut young map units; in many cases these are likely to be digitizing errors.
Identifying information for concealed lines that separate polygons with different MapUnit values and non-concealed contacts that separate polygons with identical MapUnit values is written to HTML tables Bad concealed contacts and faults and Internal contacts.
Flags those features that:
- Have the same location, and
- Have the same Type values, and
- If attributes Azimuth and Inclination are present, have the same Azimuth and Inclination values
Note that entries in a geochem, geochron, or sample table that represent multiple samples taken at a single locale will (incorrectly) generate errors.
GeMS_TranslateToShape_Arc10.py
Translate to Shapefiles converts a GeMS-style ArcGIS geodatabase to two shapefile packages:
- OPEN--Consists of shapefiles, additional .dbf files, and pipe-delimited text files. Field renaming is documented in output file logfile.txt. This package will be a complete transcription of the geodatabase without loss of any information.
- SIMPLE--Consists of shapefiles alone. Tables Glossary, DataSources, and DescriptionOfMapUnits are joined to selected feature classes within feature dataset GeologicMap, long fields are truncated, and these feature classes are written to shapefiles. Field renaming is documented in output file logfile.txt. This package is a partial (incomplete) transcription of the geodatabase, but will be easier to use than the OPEN package.
Output is written to directories DBName-simple and DBName-open, where DBName is the name of the input geodatabase, without gdb or mdb suffix. If these directories already exist, any files within them will be deleted.
Parameter | Explanation | Data Type |
---|---|---|
Input_geodatabase | An existing geodatabase. May be a file (.gdb) or personal (.mdb) geodatabase. | Workspace |
Output_workspace | Must be an existing folder. Output folders DBName-open and DBName-simple will be written here, as well as temporary geodatabase xxDBName. | Folder |
GeMS_ValidateDatabase_Arc10.py
Validate Database audits a geodatabase for conformance with the GeMS schema and reports compliance as “may be LEVEL 1 COMPLIANT”, “is LEVEL 2 COMPLIANT”, or “is LEVEL 3 COMPLIANT”. It also runs mp (metadata parser) to check for formal errors in geodatabase-level FGDC metadata. Note that qualify as LEVEL 2 or LEVEL 3 compliant a database must also be accompanied by a peer-reviewed geologic names report.
Compliance criteria are:
Level 1:
- No overlaps or internal gaps in map-unit polygon layer
- Contacts and faults in single feature class
- Map-unit polygon boundaries are covered by contacts and faults lines
Databases with a variety of schema may meet these criteria. Validate Database cannot confirm LEVEL 1 compliance.
Level 2:
- 2.1 Has required elements: nonspatial tables DataSources, DescriptionOfMapUnits, GeoMaterialDict; feature dataset GeologicMap with feature classes ContactsAndFaults and MapUnitPolys
- 2.2 Required fields within required elements are present and correctly defined
- 2.3 GeologicMap topology: no internal gaps or overlaps in MapUnitPolys, boundaries of MapUnitPolys are covered by ContactsAndFaults
- 2.4 All map units in MapUnitPolys have entries in DescriptionOfMapUnits table
- 2.5 No duplicate MapUnit values in DescriptionOfMapUnit table
- 2.6 Certain field values within required elements have entries in Glossary table
- 2.7 No duplicate Term values in Glossary table
- 2.8 All xxxSourceID values in required elements have entries in DataSources table
- 2.9 No duplicate DataSources_ID values in DataSources table
Level 3
- 3.1 Table and field definitions conform to GeMS schema
- 3.2 All map-like feature datasets obey topology rules. No MapUnitPolys gaps or overlaps. No ContactsAndFaults overlaps, self-overlaps, or self-intersections. MapUnitPoly boundaries covered by ContactsAndFaults
- 3.3 No missing required values
- 3.4 No missing terms in Glossary
- 3.5 No unnecessary terms in Glossary
- 3.6 No missing sources in DataSources
- 3.7 No unnecessary sources in DataSources
- 3.8 No map units without entries in DescriptionOfMapUnits
- 3.9 No unnecessary map units in DescriptionOfMapUnits
- 3.10 HierarchyKey values in DescriptionOfMapUnits are unique and well formed
- 3.11 All values of GeoMaterial are defined in GeoMaterialDict. GeoMaterialDict is as specified in the GeMS standard
- 3.12 No duplicate _ID values
- 3.13 No zero-length or whitespace-only strings
Validate Database checks for schema extensions: are there tables, feature datasets, feature classes or fields that are not defined by the standard?
Validate Database lists contents of tables DataSources, DefinitionOfMapUnits, Glossary, and (if present) MiscellaneousMapInformation in human-readable form.
Validate Database also inventories the database and reports the number of rows, fields, and field definitions for all tables and feature classes.
Output is written to several files in Output_workspace: Input.gdb-Validation.html, Input.gdb-ValidationErrors.html, Input.gdb-vFgdcMetadata.txt, Input.gdb-vFgdcMetadata.xml, and Input.gdb-vFgdcMetadataErrors.txt. Topology errors are recorded in Input_Validation.gdb.
If ArcMap is open, any joins--e.g., MapUnitPolys to DescriptionOfMapUnits--may need to be removed. If, when running this script from ArcMap, it fails to inventory some feature classes, try running it from ArcCatalog. If MapUnitPolys, ContactsAndFaults, or a similar feature class in another feature dataset participates in a relationship class--e.g., feature-linked annotation--ArcGIS may crash when the script attempts to copy the feature class into the Validation gdb to check topology.
Note that using this script with a geodatabase with a schema that differs significantly from GeMS may not yield a useful report.
Parameter | Explanation | Data Type |
---|---|---|
Input_geodatabase | A file geodatase (.gdb). The .gdb extension must be included. | Workspace |
Output_workspace (optional) | A directory that must exist and be writable. If no directory is specified, defaults to host directory for Input_geodatabase. | Folder |
Refresh GeoMaterialDict | Databases built with earlier versions of the GeMS toolbox will generate numerous errors associated with GeoMaterialDict and GeoMaterial values. Check this box to replace the GeoMaterialDict table in the database with the current version. The GeoMaterials domain (available as a picklist while editing the DescriptionOfMapUnits table) is also replaced. This option permanently modifies the geodatabase. Perhaps you should back it up before using this option. | Boolean |
Skip topology checks | If checked, potentially time-consuming topology checks will be skipped and database will FAIL level 2 and level 3 compliance checks. This may be useful when testing for other aspects of compliance with the GeMS schema. | Boolean |
Delete unused Glossary and DataSources rows | Automatically delete any rows in Glossary and DataSources that describe Terms and Sources that are unused elsewhere in the database. If deleted rows have missing required values these still show up as errors. Rerun the Validate Database script to clear such errors. Deletion of a Glossary row may render a DataSource row unneeded. Rerun the Validate Database script to discover such errors. This option permanently modifies the geodatabase. Perhaps you should back it up before using this option. | Boolean |