diff --git a/Scripts/GeMS_CreateDatabase_AGP2.py b/Scripts/GeMS_CreateDatabase_AGP2.py index 7a043e0..021d986 100644 --- a/Scripts/GeMS_CreateDatabase_AGP2.py +++ b/Scripts/GeMS_CreateDatabase_AGP2.py @@ -454,3 +454,460 @@ def createDatabase(outputDir,thisDB): else: addMsgAndPrint(usage) +======= +# GeMS_CreateDatabase_Arc10.1.py +# Python script to create an empty NCGMP09-style +# ArcGIS 10 geodatabase for geologic map data +# +# Ralph Haugerud, USGS +# +# RUN AS TOOLBOX SCRIPT FROM ArcCatalog OR ArcMap + +# 9 Sept 2016: Made all fields NULLABLE +# 19 Dec 2016: Added GeoMaterialsDict table, domains +# 8 March 2017: Added ExistenceConfidence, IdentityConfidence, ScientificConfidence domains, definitions, and definitionsource +# 17 March 2017 Added optional table MiscellaneousMapInformation +# 30 Oct 2017 Moved CartoRepsAZGS and GeMS_lib.gdb to ../Resources +# 4 March 2018 changed to use writeLogfile() +# 16 May 2019 GeMS_CreateDatabase_Arc10.py Python 2.7 ported to Python 3 to work in ArcGIS Pro 2.1, Evan Thoms + +# 8 June 2020 In transDict (line 31), changed 'NoNulls':'NON_NULLABLE' to 'NoNulls':'NULLABLE' +# " " Fixed bug with addTracking(), where EnableEditorTracking_management apparently wants in_dataset to be a full pathname +# " " Added MapUnitLines to list of feature classes that could be created (line 153) +# 28 Sept 2020 Now defines coordinate system for CMU and cross section feature datasets (= map coordinate system) +# 7 Oct 2020 Improved definition of cross section feature classes to match specification +# Edits 10/8/20 to update to Ralph's latest changes (above), Evan Thoms +# 23 December 2020: Changed how MapUnitPoints feature class is created, so that it follows definition in GeMS_Definitions.py - RH + +import arcpy, sys, os, os.path +from GeMS_Definition import tableDict, GeoMaterialConfidenceValues, DefaultExIDConfidenceValues, IDLength +from GeMS_utilityFunctions import * +import copy + +versionString = 'GeMS_CreateDatabase_AGP2.py, version of 28 January 2021' + +debug = True + +default = '#' + +#cartoReps = False # False if cartographic representations will not be used + +transDict = { 'String': 'TEXT', + 'Single': 'FLOAT', + 'Double': 'DOUBLE', + 'NoNulls':'NULLABLE', #NB-enforcing NoNulls at gdb level creates headaches; instead, check while validating + 'NullsOK':'NULLABLE', + 'Optional':'NULLABLE', + 'Date' : 'DATE' } + +usage = """Usage: + systemprompt> GeMS_CreateDatabase_Arc10.1.py + <#XSections> + is existing directory in which new geodatabaseName is to + be created, use # for current directory + is name of gdb to be created, with extension + .gdb causes a file geodatabase to be created + .mdb causes a personal geodatabase to be created + is a fully-specified ArcGIS coordinate system + is either # or a semicolon-delimited string specifying + which non-required elements should be created (e.g., + OrientationPoints;CartographicLines;RepurposedSymbols ) + <#XSections> is an integer (0, 1, 2, ...) specifying the intended number of + cross-sections + is either true or false (default is true). Parameter is ignored if + ArcGIS version is less than 10.1 + is either true or false (default is false). If true, add + fields for Cartographic representions to all feature classes + is either true or false (default is false). If true, add LTYPE field + to feature classes ContactsAndFaults and GeologicLines, add PTTYPE field + to feature class OrientationData, and add PTTYPE field to MapUnitLabelPoints + + Then, in ArcCatalog: + * If you use the CorrelationOfMapUnits feature data set, note that you will + have to manually create the annotation feature class CMUText and add field + ParagraphStyle. (I haven't yet found a way to script the creation of an + annotation feature class.) + * If there will be non-standard point feature classes (photos, mineral + occurrences, etc.), copy/paste/rename feature class GenericPoint or + GenericSample, as appropriate, rename the _ID field, and add necessary + fields to the new feature class. + * Load data, if data already are in GIS form. + Edit data as needed. + +""" + +def addMsgAndPrint(msg, severity=0): + # prints msg to screen and adds msg to the geoprocessor (in case this is run as a tool) + #print msg + try: + for string in msg.split('\n'): + # Add appropriate geoprocessing message + if severity == 0: + arcpy.AddMessage(string) + elif severity == 1: + arcpy.AddWarning(string) + elif severity == 2: + arcpy.AddError(string) + except: + pass + +def createFeatureClass(thisDB,featureDataSet,featureClass,shapeType,fieldDefs): + addMsgAndPrint(' Creating feature class '+featureClass+'...') + try: + arcpy.env.workspace = thisDB + arcpy.CreateFeatureclass_management(featureDataSet,featureClass,shapeType) + thisFC = thisDB+'/'+featureDataSet+'/'+featureClass + for fDef in fieldDefs: + try: + if fDef[1] == 'String': + # note that we are ignoring fDef[2], NullsOK or NoNulls + arcpy.AddField_management(thisFC,fDef[0],transDict[fDef[1]],'#','#',fDef[3],'#','NULLABLE') + else: + # note that we are ignoring fDef[2], NullsOK or NoNulls + arcpy.AddField_management(thisFC,fDef[0],transDict[fDef[1]],'#','#','#','#','NULLABLE') + except: + addMsgAndPrint('Failed to add field '+fDef[0]+' to feature class '+featureClass) + addMsgAndPrint(arcpy.GetMessages(2)) + except: + addMsgAndPrint(arcpy.GetMessages()) + addMsgAndPrint('Failed to create feature class '+featureClass+' in dataset '+featureDataSet) + +def addTracking(tfc): + if arcpy.Exists(tfc): + addMsgAndPrint(' Enabling edit tracking in '+tfc) + try: + arcpy.EnableEditorTracking_management(tfc,'created_user','created_date','last_edited_user','last_edited_date','ADD_FIELDS','DATABASE_TIME') + except: + addMsgAndPrint(tfc) + addMsgAndPrint(arcpy.GetMessages(2)) + + +def cartoRepsExistAndLayer(fc): + crPath = os.path.join(os.path.dirname(sys.argv[0]),'../Resources/CartoRepsAZGS') + hasReps = False + repLyr = '' + for repFc in 'ContactsAndFaults','GeologicLines','OrientationPoints': + if fc.find(repFc) > -1: + hasReps = True + repLyr = os.path.join(crPath,repFc+'.lyr') + return hasReps,repLyr +def rename_field(defs, start_name, end_name): + """renames a field in a list generated from tableDict for + special cases; CrossSections and OrientationPoints + instead of using AlterField after creation which was throwing errors""" + f_list = copy.deepcopy(defs) + list_item = [n for n in f_list if n[0] == start_name] #finds ['MapUnitPolys_ID', 'String', 'NoNulls', 50], for instance + i = f_list.index(list_item[0]) #finds the index of that item + f_list[i][0] = end_name #changes the name in the list + arcpy.AddMessage(f_list[i][0] + ' becoming ' + end_name) + arcpy.AddMessage(f_list) + return f_list + +def main(thisDB,coordSystem,nCrossSections): + # create feature dataset GeologicMap + addMsgAndPrint(' Creating feature dataset GeologicMap...') + try: + arcpy.CreateFeatureDataset_management(thisDB,'GeologicMap',coordSystem) + except: + addMsgAndPrint(arcpy.GetMessages(2)) + + # create feature classes in GeologicMap + # poly feature classes + featureClasses = ['MapUnitPolys'] + for fc in ['DataSourcePolys','MapUnitOverlayPolys','OverlayPolys']: + if fc in OptionalElements: + featureClasses.append(fc) + for featureClass in featureClasses: + fieldDefs = tableDict[featureClass] + if addLTYPE and fc != 'DataSourcePolys': + fieldDefs.append(['PTYPE','String','NullsOK',50]) + createFeatureClass(thisDB,'GeologicMap',featureClass,'POLYGON',fieldDefs) + + # line feature classes + featureClasses = ['ContactsAndFaults'] + for fc in ['GeologicLines','CartographicLines','IsoValueLines', 'MapUnitLines']: + if fc in OptionalElements: + featureClasses.append(fc) + + for featureClass in featureClasses: + fieldDefs = tableDict[featureClass] + if featureClass in ['ContactsAndFaults','GeologicLines'] and addLTYPE: + fieldDefs.append(['LTYPE','String','NullsOK',50]) + createFeatureClass(thisDB,'GeologicMap',featureClass,'POLYLINE',fieldDefs) + + # point feature classes + featureClasses = [] + for fc in ['OrientationPoints','GeochronPoints','FossilPoints','Stations', + 'GenericSamples','GenericPoints', 'MapUnitPoints']: + if fc in OptionalElements: + featureClasses.append(fc) + for featureClass in featureClasses: + """ +The following block of code was bypassing the MapUnitPoints definition now in GeMS_Definitions.py and +appending PTYPE to the resulting feature class, along with the PTTYPE field appended in the +next statement. I think we don't need it, but need to talk with Evan about this. +If he concurs, will delete this block. +Ralph Haugerud +23 December 2020 +I agree - + # the following if statement used to be here, but was removed at some point + # putting it back to allow for creation of MapUnitPoints after discussion + # with Luke Blair - Evan Thoms + if featureClass == 'MapUnitPoints': + fieldDefs = tableDict['MapUnitPolys'] + if addLTYPE: + fieldDefs.append(['PTYPE','String','NullsOK',50]) + else: + fieldDefs = tableDict[featureClass] + if addLTYPE and featureClass in ['OrientationPoints']: + fieldDefs.append(['PTTYPE','String','NullsOK',50]) + # end of re-inserted if statement + """ + fieldDefs = tableDict[featureClass] + if addLTYPE: + fieldDefs.append(['PTTYPE','String','NullsOK',50]) + createFeatureClass(thisDB,'GeologicMap',featureClass,'POINT',fieldDefs) + + # create feature dataset CorrelationOfMapUnits + if 'CorrelationOfMapUnits' in OptionalElements: + addMsgAndPrint(' Creating feature dataset CorrelationOfMapUnits...') + arcpy.CreateFeatureDataset_management(thisDB,'CorrelationOfMapUnits', coordSystem) + fieldDefs = tableDict['CMUMapUnitPolys'] + createFeatureClass(thisDB,'CorrelationOfMapUnits','CMUMapUnitPolys','POLYGON',fieldDefs) + fieldDefs = tableDict['CMULines'] + createFeatureClass(thisDB,'CorrelationOfMapUnits','CMULines','POLYLINE',fieldDefs) + fieldDefs = tableDict['CMUPoints'] + createFeatureClass(thisDB,'CorrelationOfMapUnits','CMUPoints','POINT',fieldDefs) + + # create CrossSections + if nCrossSections > 26: + nCrossSections = 26 + if nCrossSections < 0: + nCrossSections = 0 + # note space in position 0 + alphabet = ' ABCDEFGHIJKLMNOPQRSTUVWXYZ' + + for n in range(1,nCrossSections+1): + xsLetter = alphabet[n] + xsName = 'CrossSection'+xsLetter + xsN = 'CS'+xsLetter + addMsgAndPrint(' Creating feature data set CrossSection'+xsLetter+'...') + arcpy.CreateFeatureDataset_management(thisDB, xsName, coordSystem) + muDefs = rename_field(tableDict['MapUnitPolys'], 'MapUnitPolys_ID', xsN+'MapUnitPolys_ID') + + createFeatureClass(thisDB, xsName, xsN+'MapUnitPolys', 'POLYGON', muDefs) + cfDefs = rename_field(tableDict['ContactsAndFaults'], 'ContactsAndFaults_ID', xsN+'ContactsAndFaults_ID') + createFeatureClass(thisDB, xsName, xsN+'ContactsAndFaults', 'POLYLINE', cDefs) + arcpy.AlterField_management(xsN+'ContactsAndFaults','ContactsAndFaults_ID',xsN+'ContactsAndFaults_ID') + + if 'OrientationPoints' in OptionalElements: + opDefs = rename_field(tableDict['OrientationPoints'], 'OrientationPoints_ID', xsN+'OrientationPoints_ID') + createFeatureClass(thisDB, xsName, xsN+'OrientationPoints','POINT', opDefs) + + + # create tables + tables = ['DescriptionOfMapUnits','DataSources','Glossary'] + for tb in ['RepurposedSymbols','StandardLithology','GeologicEvents','MiscellaneousMapInformation']: + if tb in OptionalElements: + tables.append(tb) + for table in tables: + addMsgAndPrint(' Creating table '+table+'...') + try: + arcpy.CreateTable_management(thisDB,table) + fieldDefs = tableDict[table] + for fDef in fieldDefs: + try: + if fDef[1] == 'String': + arcpy.AddField_management(thisDB+'/'+table,fDef[0],transDict[fDef[1]],'#','#',fDef[3],'#',transDict[fDef[2]]) + else: + arcpy.AddField_management(thisDB+'/'+table,fDef[0],transDict[fDef[1]],'#','#','#','#',transDict[fDef[2]]) + except: + addMsgAndPrint('Failed to add field '+fDef[0]+' to table '+table) + addMsgAndPrint(arcpy.GetMessages(2)) + except: + addMsgAndPrint(arcpy.GetMessages()) + + ### GeoMaterials + addMsgAndPrint(' Setting up GeoMaterialsDict table and domains...') + # Copy GeoMaterials table + arcpy.Copy_management(os.path.dirname(sys.argv[0])+'/../Resources/GeMS_lib.gdb/GeoMaterialDict', thisDB+'/GeoMaterialDict') + # make GeoMaterials domain + arcpy.TableToDomain_management(thisDB+'/GeoMaterialDict','GeoMaterial','IndentedName',thisDB,'GeoMaterials') + # attach it to DMU field GeoMaterial + arcpy.AssignDomainToField_management(thisDB+'/DescriptionOfMapUnits','GeoMaterial','GeoMaterials') + # Make GeoMaterialConfs domain, attach it to DMU field GeoMaterialConf + arcpy.CreateDomain_management(thisDB,'GeoMaterialConfidenceValues','','TEXT','CODED') + for val in GeoMaterialConfidenceValues: + arcpy.AddCodedValueToDomain_management(thisDB,'GeoMaterialConfidenceValues',val,val) + arcpy.AssignDomainToField_management(thisDB+'/DescriptionOfMapUnits','GeoMaterialConfidence','GeoMaterialConfidenceValues') + + #Confidence domains, Glossary entries, and DataSources entry + if addConfs: + addMsgAndPrint(' Adding standard ExistenceConfidence and IdentityConfidence domains') + # create domain, add domain values, and link domain to appropriate fields + addMsgAndPrint(' Creating domain, linking domain to appropriate fields') + arcpy.CreateDomain_management(thisDB,'ExIDConfidenceValues','','TEXT','CODED') + for item in DefaultExIDConfidenceValues: # items are [term, definition, source] + code = item[0] + arcpy.AddCodedValueToDomain_management(thisDB,'ExIDConfidenceValues',code,code) + arcpy.env.workspace = thisDB + dataSets = arcpy.ListDatasets() + for ds in dataSets: + arcpy.env.workspace = thisDB+'/'+ds + fcs = arcpy.ListFeatureClasses() + for fc in fcs: + fieldNames = fieldNameList(fc) + for fn in fieldNames: + if fn in ('ExistenceConfidence', 'IdentityConfidence','ScientificConfidence'): + #addMsgAndPrint(' '+ds+'/'+fc+':'+fn) + arcpy.AssignDomainToField_management(thisDB+'/'+ds+'/'+fc,fn,'ExIDConfidenceValues') + # add definitions of domain values to Glossary + addMsgAndPrint(' Adding domain values to Glossary') + ## create insert cursor on Glossary + cursor = arcpy.da.InsertCursor(thisDB+'/Glossary',['Term','Definition','DefinitionSourceID']) + for item in DefaultExIDConfidenceValues: + cursor.insertRow((item[0],item[1],item[2])) + del cursor + # add definitionsource to DataSources + addMsgAndPrint(' Adding definition source to DataSources') + ## create insert cursor on DataSources + cursor = arcpy.da.InsertCursor(thisDB+'/DataSources',['DataSources_ID','Source','URL']) + cursor.insertRow(('FGDC-STD-013-2006','Federal Geographic Data Committee [prepared for the Federal Geographic Data Committee by the U.S. Geological Survey], 2006, FGDC Digital Cartographic Standard for Geologic Map Symbolization: Reston, Va., Federal Geographic Data Committee Document Number FGDC-STD-013-2006, 290 p., 2 plates.','https://ngmdb.usgs.gov/fgdc_gds/geolsymstd.php')) + del cursor + + # if cartoReps, add cartographic representations to all feature classes + # trackEdits, add editor tracking to all feature classes and tables + if cartoReps or trackEdits: + arcpy.env.workspace = thisDB + tables = arcpy.ListTables() + datasets = arcpy.ListDatasets() + for dataset in datasets: + addMsgAndPrint(' Dataset '+dataset) + arcpy.env.workspace = thisDB+'/'+dataset + fcs = arcpy.ListFeatureClasses() + for fc in fcs: + hasReps,repLyr = cartoRepsExistAndLayer(fc) + if cartoReps and hasReps: + addMsgAndPrint(' Adding cartographic representations to '+fc) + try: + arcpy.AddRepresentation_cartography(fc,fc+'_rep1','RuleID1','Override1',default,repLyr,'NO_ASSIGN') + """ + Note the 1 suffix on the representation name (fc+'_rep1') and the RuleID1 and Override1 fields. + If at some later time we wish to add additional representations to a feature class, each will + require it's own RuleID and Override fields which may be identified, and tied to the appropriate + representation, by suffixes 2, 3, ... + Naming representations fc+'_rep'+str(n) should be sufficient to identify each representation in a + geodatabase uniquely, and allow for multiple representations within a single feature class. + It appears that ArcGIS provides no means of scripting an inventory of representations within + feature class or geodatabase. So, the convenience of establishing a coded-value domain that ties + representation rule IDs (consecutive integers) to some sort of useful text identifier becomes a + necessity for flagging the presence of a representation: One CAN script the inventory of domains + in a geodatabase. Run arcpy.da.ListDomains. Check the result for names of the form + _rep??_Rule and voila, you've got a list of representations (and their associated + feature classes) in the geodatabase. + Moral: If you add a representation, be sure to add an associated coded-value domain and name + it appropriately! + """ + except: + addMsgAndPrint(arcpy.GetMessages(2)) + if trackEdits: + addTracking(os.path.join(thisDB,fc)) + if trackEdits: + addMsgAndPrint(' Tables ') + arcpy.env.workspace = thisDB + for aTable in tables: + if aTable != 'GeoMaterialDict': + addTracking(os.path.join(thisDB,aTable)) + +def createDatabase(outputDir,thisDB): + addMsgAndPrint(' Creating geodatabase '+thisDB+'...') + if arcpy.Exists(outputDir+'/'+thisDB): + addMsgAndPrint(' Geodatabase '+thisDB+' already exists.') + addMsgAndPrint(' forcing exit with error') + raise arcpy.ExecuteError + try: + # removed check for mdb. Personal geodatabases are out - ET + if thisDB[-4:] == '.gdb': + arcpy.CreateFileGDB_management(outputDir,thisDB) + return True + except: + addMsgAndPrint('Failed to create geodatabase '+outputDir+'/'+thisDB) + addMsgAndPrint(arcpy.GetMessages(2)) + return False + +######################################### + +addMsgAndPrint(versionString) + +if len(sys.argv) >= 6: + addMsgAndPrint('Starting script') + + outputDir = sys.argv[1] + if outputDir == '#': + outputDir = os.getcwd() + outputDir = outputDir.replace('\\','/') + + thisDB = sys.argv[2] + thisDB = thisDB+'.gdb' + + coordSystem = sys.argv[3] + + if sys.argv[4] == '#': + OptionalElements = [] + else: + OptionalElements = sys.argv[4].split(';') + if debug: + addMsgAndPrint(f'Optional elements = {OptionalElements}') + + nCrossSections = int(sys.argv[5]) + + try: + if sys.argv[6] == 'true': + trackEdits = True + else: + trackEdits = False + except: + trackEdits = False + + if arcpy.GetInstallInfo()['Version'] < '10.1': + trackEdits = False + + try: + if sys.argv[7] == 'true': + cartoReps = True + else: + cartoReps = False + except: + cartoReps = False + + try: + if sys.argv[8] == 'true': + addLTYPE = True + else: + addLTYPE = False + except: + addLTYPE = False + + try: + if sys.argv[9] == 'true': + addConfs = True + else: + addConfs = False + except: + addConfs = False + + # create gdb in output directory and run main routine + if createDatabase(outputDir,thisDB): + thisDB = outputDir+'/'+thisDB + #Arc 10 version refreshed ArcCatalog here, but there is no equivalent with AGPro + main(thisDB,coordSystem,nCrossSections) + + # try to write a readme within the .gdb + if thisDB[-4:] == '.gdb': + try: + writeLogfile(thisDB,'Geodatabase created by '+versionString) + except: + addMsgAndPrint('Failed to write to'+thisDB+'/00log.txt') + +else: + addMsgAndPrint(usage) diff --git a/Scripts/GeMS_Definition.py b/Scripts/GeMS_Definition.py index e40e7e8..08b8732 100644 --- a/Scripts/GeMS_Definition.py +++ b/Scripts/GeMS_Definition.py @@ -1,412 +1,414 @@ -# -*- coding: cp1252 -*- -# GeMS_Definition.py -# module with definitions for GeMS geodatabase schema for -# ArcGIS geodatabases (personal or file) for geologic map data -# -# Ralph Haugerud, 19 August 2016 -# - -versionString = 'GeMS_Definition.py, version of 29 October 2020' -# fixes errors in Station feature class definition -# 16 Jan 2014: added ObservedMapUnit to Station feature class definition -# 8 April 2016: Fixed ObservedMapUnit. Put _ID field at end of each field list -# 19 August 2016: Began converting to GeMS -# 9 Sept 2016: Removed CMUText definition -# 4 March 2017: Removed ChangeLog definition. Added MapCollarInformation -# 17 Mar 2017: Changed MapCollarInformation to MiscellaneousMapInformation, added associated entity and domain descriptions -# 27 March 2017: order of tables in startDict revised to conform with documentation. Fields reordered and amended to conform with documentation -# 20 May 2017: MapUnitOverlayPolys and OverlayPolys (new names) changed to conform to v2 draft. MapUnitLabelPoints removed. -# 6 October 2017: In IsoValueLines definition, changed LocationConfidenceMeters to ValueConfidence -# 8 October 2017: ValueConfidence and URL added to attribDict[] -# 29 October 2019: Changed StationID to StationsID -# 29 October 2019: Added MapUnitLines, MapUnitPoints to as-needed feature classes -# 4 April 2020: Changed NullsOK to NoNulls for some fields in DescriptionOfMapUnits, to conform with documentation -# 9 April 2020: Changed NullsOK for Notes fields to Optional. Added definition of table LayerList -# 19 July 2020: Added 'Age' to attribDict -# 25 Sept 2020: Swapped Symbol and Label in ContactsAndFaults -# 28 Sept 2020: Removed definitions of CSA feature classes, as this is handled in Create Database and in cross-section projection tools -# 29 October 2020: Changed NoNulls to NullsOK for ObservedMapUnit in Stations per documentation - ET - -# to think about: Maybe change all NoNulls to NullsOK? - -defaultLength = 254 -mapUnitLength = 10 -IDLength = 50 -memoLength = 3000 -booleanLength = 1 - -# attributes are in order Name DataType NullStatus suggestedLength -# _ID is missing, as it is added programatically, below -startDict = { -# required tables and feature classes - 'MapUnitPolys': [['MapUnit','String','NoNulls',mapUnitLength], - ['IdentityConfidence','String','NoNulls',IDLength], - ['Label','String','NullsOK',IDLength], - ['Symbol','String','NullsOK',defaultLength], - ['DataSourceID','String','NoNulls',IDLength], - ['Notes','String','Optional',defaultLength]], - 'ContactsAndFaults': [['Type','String','NoNulls',defaultLength], - ['IsConcealed','String','NoNulls',booleanLength], - ['LocationConfidenceMeters','Single','NoNulls'], - ['ExistenceConfidence','String','NoNulls',IDLength], - ['IdentityConfidence','String','NoNulls',IDLength], - ['Label','String','NullsOK',IDLength], - ['Symbol','String','NullsOK',defaultLength], - ['DataSourceID','String','NoNulls',IDLength], - ['Notes','String','Optional',defaultLength]], - 'DescriptionOfMapUnits': [['MapUnit','String','NullsOK',mapUnitLength], - ['Name','String','NoNulls',defaultLength], - ['FullName','String','NullsOK',defaultLength], - ['Age','String','NullsOK',defaultLength], - ['Description','String','NullsOK',memoLength], - ['HierarchyKey','String','NoNulls',defaultLength], - ['ParagraphStyle','String','NoNulls',defaultLength], - ['Label','String','NullsOK',30], - ['Symbol','String','NullsOK',defaultLength], - ['AreaFillRGB','String','NullsOK',defaultLength], - ['AreaFillPatternDescription','String','NullsOK',defaultLength], - ['DescriptionSourceID','String','NullsOK',IDLength], - ['GeoMaterial','String','NullsOK',defaultLength], - ['GeoMaterialConfidence','String','NullsOK',defaultLength]], - 'DataSources': [['Source','String','NoNulls',500], - ['Notes','String','Optional',300], - ['URL','String','Optional',300]], - 'Glossary': [['Term','String','NoNulls',defaultLength], - ['Definition','String','NoNulls',memoLength], - ['DefinitionSourceID','String','NoNulls',IDLength]], -# as-needed tables and feature classes - 'GenericPoints': [['Type','String','NoNulls',defaultLength], - ['Symbol','String','NullsOK',defaultLength], - ['Label','String','NullsOK',IDLength], - ['LocationConfidenceMeters','Single','NoNulls'], - ['PlotAtScale','Single','NoNulls'], - ['StationID','String','NullsOK',IDLength], - ['MapUnit','String','NoNulls',mapUnitLength], - ['LocationSourceID','String','NoNulls',IDLength], - ['DataSourceID','String','NoNulls',IDLength], - ['Notes','String','Optional',defaultLength]], - 'GenericSamples': [['Type','String','NoNulls',defaultLength], - ['Symbol','String','NullsOK',defaultLength], - ['Label','String','NullsOK',IDLength], - ['FieldSampleID','String','NullsOK',defaultLength], - ['AlternateSampleID','String','NullsOK',defaultLength], - ['MaterialAnalyzed','String','NullsOK',defaultLength], - ['LocationConfidenceMeters','Single','NoNulls'], - ['PlotAtScale','Single','NoNulls'], - ['StationID','String','NullsOK',IDLength], - ['MapUnit','String','NoNulls',mapUnitLength], - ['LocationSourceID','String','NoNulls',IDLength], - ['DataSourceID','String','NoNulls',IDLength], - ['Notes','String','Optional',defaultLength]], - 'OrientationPoints': [['Type','String','NoNulls',defaultLength], - ['Azimuth','Single','NoNulls'], - ['Inclination','Single','NoNulls'], - ['Symbol','String','NullsOK',defaultLength], - ['Label','String','NullsOK',IDLength], - ['LocationConfidenceMeters','Single','NoNulls'], - ['IdentityConfidence','String','NoNulls',50], - ['OrientationConfidenceDegrees','Single','NoNulls'], - ['PlotAtScale','Single','NoNulls'], - ['StationID','String','NullsOK',IDLength], - ['MapUnit','String','NoNulls',mapUnitLength], - ['LocationSourceID','String','NoNulls',IDLength], - ['OrientationSourceID','String','NoNulls',IDLength], - ['Notes','String','Optional',defaultLength]], - 'GeochronPoints': [['Type','String','NoNulls',defaultLength], - ['FieldSampleID','String','NullsOK',defaultLength], - ['AlternateSampleID','String','NullsOK',defaultLength], - ['MapUnit','String','NoNulls',mapUnitLength], - ['Symbol','String','NullsOK',defaultLength], - ['Label','String','NullsOK',IDLength], - ['LocationConfidenceMeters','Single','NoNulls'], - ['PlotAtScale','Single','NoNulls'], - ['MaterialAnalyzed','String','NullsOK',defaultLength], - ['NumericAge','Single','NoNulls'], - ['AgePlusError','Single','NullsOK'], - ['AgeMinusError','Single','NullsOK'], - ['AgeUnits','String','NoNulls',IDLength], - ['StationID','String','NullsOK',IDLength], - ['LocationSourceID','String','NoNulls',IDLength], - ['AnalysisSourceID','String','NullsOK',IDLength], - ['Notes','String','Optional',defaultLength]], - 'Stations': [['FieldID','String','NoNulls',IDLength], - ['LocationConfidenceMeters','Single','NoNulls'], - ['ObservedMapUnit','String','NullsOK',mapUnitLength], - ['MapUnit','String','NoNulls',mapUnitLength], - ['Symbol','String','NullsOK',defaultLength], - ['Label','String','NullsOK',IDLength], - ['PlotAtScale','Single','NoNulls'], - ['DataSourceID','String','NoNulls',IDLength], - ['Notes','String','NullsOK',defaultLength], - ['LocationMethod','String','NullsOK',defaultLength], - ['TimeDate','Date','NullsOK'], - ['Observer','String','NullsOK',defaultLength], - ['SignificantDimensionMeters','Single','NullsOK'], - ['GPSX','Double','NoNulls'], - ['GPSY','Double','NoNulls'], - ['PDOP','Single','NullsOK'], - ['MapX','Double','NoNulls'], - ['MapY','Double','NoNulls']], - 'GeologicLines': [['Type','String','NoNulls',defaultLength], - ['IsConcealed','String','NoNulls',booleanLength], - ['LocationConfidenceMeters','Single','NoNulls'], - ['ExistenceConfidence','String','NoNulls',IDLength], - ['IdentityConfidence','String','NoNulls',IDLength], - ['Symbol','String','NullsOK',defaultLength], - ['Label','String','NullsOK',IDLength], - ['DataSourceID','String','NoNulls',IDLength], - ['Notes','String','Optional',defaultLength]], - 'CartographicLines': [['Type','String','NoNulls',defaultLength], - ['Symbol','String','NullsOK',defaultLength], - ['Label','String','NullsOK',IDLength], - ['DataSourceID','String','NoNulls',IDLength], - ['Notes','String','Optional',defaultLength]], - 'IsoValueLines': [['Type','String','NoNulls',defaultLength], - ['Value','Single','NoNulls'], - ['ValueConfidence','Single','NoNulls'], - ['Symbol','String','NullsOK',defaultLength], - ['Label','String','NullsOK',IDLength], - ['DataSourceID','String','NoNulls',IDLength], - ['Notes','String','Optional',defaultLength]], - 'MapUnitLines': [['MapUnit','String','NoNulls',mapUnitLength], - ['IsConcealed','String','NoNulls',booleanLength], - ['LocationConfidenceMeters','Single','NoNulls'], - ['ExistenceConfidence','String','NoNulls',IDLength], - ['IdentityConfidence','String','NoNulls',IDLength], - ['Label','String','NullsOK',IDLength], - ['Symbol','String','NullsOK',defaultLength], - ['PlotAtScale','Single','NoNulls'], - ['DataSourceID','String','NoNulls',IDLength], - ['Notes','String','Optional',defaultLength]], - 'MapUnitPoints': [['MapUnit','String','NoNulls',mapUnitLength], - ['LocationConfidenceMeters','Single','NoNulls'], - ['ExistenceConfidence','String','NoNulls',IDLength], - ['IdentityConfidence','String','NoNulls',IDLength], - ['Label','String','NullsOK',IDLength], - ['Symbol','String','NullsOK',defaultLength], - ['PlotAtScale','Single','NoNulls'], - ['DataSourceID','String','NoNulls',IDLength], - ['Notes','String','Optional',defaultLength]], - 'MapUnitOverlayPolys':[['MapUnit','String','NoNulls',defaultLength], - ['IdentityConfidence','String','NoNulls',IDLength], - ['Label','String','NullsOK',IDLength], - ['Symbol','String','NullsOK',defaultLength], - ['DataSourceID','String','NoNulls',IDLength], - ['Notes','String','Optional',defaultLength]], - 'OverlayPolys': [['Type','String','NoNulls',defaultLength], - ['IdentityConfidence','String','NoNulls',IDLength], - ['Label','String','NullsOK',IDLength], - ['Symbol','String','NullsOK',defaultLength], - ['DataSourceID','String','NoNulls',IDLength], - ['Notes','String','Optional',defaultLength]], - 'DataSourcePolys': [['DataSourceID','String','NoNulls',IDLength], - ['Notes','String','Optional',defaultLength]], - 'RepurposedSymbols': [['FgdcIdentifier','String','NoNulls',defaultLength], - ['OldExplanation','String','NoNulls',defaultLength], - ['NewExplanation','String','NoNulls',defaultLength]], -# optional feature classes and tables described in GeMS specification - 'CMUMapUnitPolys': [['MapUnit','String','NoNulls',mapUnitLength], - ['Label','String','NullsOK',IDLength], - ['Symbol','String','NullsOK',defaultLength]], - 'CMULines': [['Type','String','NoNulls',defaultLength], - ['Symbol','String','NullsOK',defaultLength]], - 'CMUPoints': [['Type','String','NoNulls',defaultLength], - ['Label','String','NullsOK',IDLength], - ['Symbol','String','NullsOK',defaultLength]], - 'MiscellaneousMapInformation': [['MapProperty','String','NullsOK',defaultLength], - ['MapPropertyValue','String','NullsOK',memoLength]], - 'LayerList': [['OrderFromTop','Integer','NoNulls'], - ['FeatureDatasetName','String','NoNulls',defaultLength], - ['ElevationObject','String','NullsOK',defaultLength], - ['Description','String','NoNulls',memoLength]], - 'StandardLithology': [['MapUnit','String','NoNulls',mapUnitLength], - ['PartType','String','NoNulls',defaultLength], - ['Lithology','String','NoNulls',defaultLength], - ['ProportionTerm','String','NullsOK',defaultLength], - ['ProportionValue','Single','NullsOK'], - ['ScientificConfidence','String','NoNulls',defaultLength], - ['DataSourceID','String','NoNulls',IDLength]], -# optional feature classes not described in GeMS specification - 'FossilPoints': [['Type','String','NoNulls',defaultLength], - ['StationID','String','NullsOK',IDLength], - ['MapUnit','String','NoNulls',mapUnitLength], - ['Label','String','NullsOK',IDLength], - ['Symbol','String','NullsOK',defaultLength], - ['FieldSampleID','String','NullsOK',defaultLength], - ['AlternateSampleID','String','NullsOK',defaultLength], - ['MaterialAnalyzed','String','NullsOK',defaultLength], - ['PlotAtScale','Single','NoNulls'], - ['LocationConfidenceMeters','Single','NoNulls'], - ['FossilForms','String','NoNulls',memoLength], - ['FossilAge','String','NoNulls',defaultLength], - ['LocationSourceID','String','NoNulls',IDLength], - ['FossilFormsSourceID','String','NoNulls',IDLength], - ['FossilAgeSourceID','String','NullsOK',IDLength], - ['Notes','String','NullsOK',defaultLength]], - 'PhotoPoints': [['Type','String','NoNulls',defaultLength], - ['StationID','String','NullsOK',IDLength], - ['MapUnit','String','NoNulls',mapUnitLength], - ['Label','String','NullsOK',IDLength], - ['Symbol','String','NullsOK',defaultLength], - ['PlotAtScale','Single','NoNulls'], - ['LocationConfidenceMeters','Single','NoNulls'], - ['LocationSourceID','String','NoNulls',IDLength], - ['DataSourceID','String','NoNulls',IDLength], - ['PhotoID','String','NoNulls',IDLength], - ['PhotoSubject','String','NullsOK',defaultLength], - ['ViewDirection','String','NullsOK',defaultLength], - ['ViewWidth','String','NullsOK',defaultLength], - ['Notes','String','NullsOK',defaultLength]] -} - -GeoMaterialConfidenceValues = ["High","Medium","Low"] - -GeoMatConfDict = { 'High': ['The term and definition adequately characterize the overall lithologic nature of rocks and sediments in the map unit. Regarding the subjective term "adequately characterize", we refer to context and objectives of this classification as described in the GeMS documentation.', - 'GeMS documentation'], - 'Medium': ['The term and definition generally characterize the overall lithology of the map unit, but there are one or more significant minor lithologies that are not adequately described by the selected term.', - 'GeMS documentation'], - 'Low': ['The overall lithology of this map unit is not adequately classifiable using this list of terms and definitions, but the term selected is the best available. Or this map unit is insufficiently known to confidently assign a GeoMaterial term.', - 'GeMS documentation'] - } - -DefaultExIDConfidenceValues = [['certain', 'Identity of a feature can be determined using relevant observations and scientific judgment; therefore, one can be reasonably confident in the credibility of this interpretation.','FGDC-STD-013-2006'], - ['questionable','Identity of a feature cannot be determined using relevant observations and scientific judgment; therefore, one cannot be reasonably confident in the credibility of this interpretation. For example, IdentityConfidence = questionable is appropriate when a geologist reasons "I can see some kind of planar feature that separates map units in this outcrop, but I cannot be certain if it is a contact or a fault."','FGDC-STD-013-2006']] - - - -enumeratedValueDomainFieldList = [ - 'Type','LocationMethod','PartType','ProportionTerm','TimeScale', - 'ExistenceConfidence','IdentityConfidence', - 'ScientificConfidence','ParagraphStyle','AgeUnits', 'MapUnit', - 'DataSourceID','DescriptionSourceID','DefinitionSourceID','LocationSourceID', - 'OrientationSourceID','AnalysisSourceID', - 'GeoMaterial','GeoMaterialConfidence' - ] -rangeDomainDict = { - 'Azimuth':['0','360','degrees (angular measure)'], - 'Inclination':['-90','90','degrees (angular measure)'] - } -unrepresentableDomainDict = { - '_ID':'Arbitrary string. Values should be unique within this database.', - 'PlotAtScale':'Positive real number.', - 'OrientationConfidenceDegrees':'Positive real number. Value of -9, -99, or -999 indicates value is unknown.', - 'LocationConfidenceMeters':'Positive real number. Value of -9, -99, or -999 indicates value is unknown.', - 'NumericAge':'Positive real number. Zero or negative value may indicate non-numeric (i.e., limiting) age.', - 'AgePlusError':'Positive real number. Value of -9, -99, or -999 indicates value is unknown.', - 'AgeMinusError':'Positive real number. Value of -9, -99, or -999 indicates value is unknown.', - 'Notes':'Unrepresentable domain. Free text. Values of or #null indicate no entry.', - 'Value':'Real number.', - 'default':'Unrepresentable domain.', - 'MapProperty':'Unrepresentable domain. Free text.', - 'MapPropertyValue':'Unrepresentable domain. Free text.' - } -attribDict = { - '_ID':'Primary key.', - 'Age':'Age of map unit as shown in Description of Map Units. Examples of values are "late Holocene", "Pliocene and Miocene", "Lower Cretaceous".', - 'AgeMinusError':'Negative (younger) age error, measured in AgeUnits. Type of error (RMSE, 1 sigma, 2 sigma, 95% confidence limit) should be stated in Notes field.', - 'AgePlusError':'Positive (older) age error, measured in AgeUnits. Type of error (RMSE, 1 sigma, 2 sigma, 95% confidence limit) should be stated in Notes field.', - 'AgeUnits':'Units for NumericAge, AgePlusError, AgeMinusError.', - 'AlternateSampleID':'Museum #, lab #, etc.', - 'AnalysisSourceID':'Source of analysis; foreign key to table DataSources.', - 'AreaFillPatternDescription':'Text description (e.g., "random small red dashes") provided as a convenience for users who must recreate symbolization.', - 'AreaFillRGB':'{Red, Green, Blue} tuples that specify the suggested color (e.g., "255,255,255", "124,005,255") of area fill for symbolizing MapUnit. Each color value is an integer between 0 and 255, values are zero-padded to a length of 3 digits, and values are separated by commas with no space: NNN,NNN,NNN.', - 'Azimuth':'Strike or trend, measured in degrees clockwise from geographic North. Use right-hand rule (dip is to right of azimuth direction). Horizontal planar features may have any azimuth.', - 'DataSourceID':'Source of data; foreign key to table DataSources.', - 'Definition':'Plain-language definition.', - 'DefinitionSourceID':'Source of definition; foreign key to DataSources.', - 'Description':'Free-format text description of map unit. Commonly structured according to one or more accepted traditions (e.g., lithology, thickness, color, weathering and outcrop characteristics, distinguishing features, genesis, age constraints) and terse.', - 'DescriptionSourceID':'Source of map-unit description; foreign key to table Datasources.', - 'ExistenceConfidence':'Confidence that feature exists.', - 'FgdcIdentifier':'Identifier for symbol from FGDC Digital Cartographic Standard for Geologic Map Symbolization.', - 'FieldSampleID':'Sample ID given at time of collection.', - 'FullName':'Name of map unit including identification of containing higher rank unit(s), e.g., "Shnabkaib Member of Moenkopi Formation".', - 'GeoMaterial':'Categorization of map unit based on lithologic and genetic character, term selected from NGMDB standard term list defined in Appendix A of GeMS documentation, available at http://ngmdb.usgs.gov/Info/standards/GeMS..', - 'GeoMaterialConfidence':'Describes appropriateness of GeoMaterial term for describing the map unit.', - 'GPSX':'Measured GPS coordinate (easting). May differ from map coordinate because of GPS error or (more likely) base map error.', - 'GPSY':'Measured GPS coordinate (northing). May differ from map coordinate because of GPS error or (more likely) base map error.', - 'HierarchyKey':'String that records hierarchical structure. Has form nn-nn-nn, nnn-nnn, or similar. Numeric, left-padded with zeros, dash-delimited. Each HierarchyKey fragment of each row MUST be the same length to allow text-based sorting of table entries.', - 'IdentityConfidence':'Confidence that feature is correctly identified.', - 'Inclination':'Dip or plunge, measured in degrees down from horizontal. Negative values allowed when specifying vectors (not axes) that point above the horizon, e.g., paleocurrents. Types defined as horizontal (e.g., horizontal bedding) shall have Inclination=0.', - 'IndentedName':'Name with addition of leading spaces to help show rank within a hierarchical list.', - 'IsConcealed':'Flag for contacts and faults covered by overlying map unit.', - 'Label':'Plain-text equivalent of the desired annotation for a feature: for example "14 Ma", or "^c" which (when used with the FGDC GeoAge font) results in the geologic map-unit label TRc (with TR run together to make the Triassic symbol).', - 'LocationConfidenceMeters':'Estimated half-width in meters of positional uncertainty envelope; position is relative to other features in database.', - 'LocationSourceID':'Source of location; foreign key to table DataSources.', - 'MapProperty':'Name of map property. Examples include "Scale", "Authors and affiliations", "Magnetic declination".', - 'MapPropertyValue':'Value of map property. Examples = "1:24,000", "G.S. Smith1 and J. Doe2 1-Division of Geology, Some State, 2-Big University", "16.5 degrees"', - 'MapUnit':'Short plain-text identifier of the map unit. Foreign key to DescriptionOfMapUnits table.', - 'MapX':'Station coordinate (easting) as compiled on the base map; base map should be identified in the DataSources record.', - 'MapY':'Station coordinate (northing) as compiled on the base map; base map should be identified in the DataSources record.', - 'MaterialAnalyzed':'Earth-material which was analyzed, e.g., wood, shell, zircon, basalt, whole-rock.', - 'Name':'Name of map unit, as shown in boldface in traditional DMU, e.g., "Shnabkaib Member". Identifies unit within its hierarchical context.', - 'NewExplanation':'Explanation of usage of symbol in this map portrayal', - 'Notes':'Additional information specific to a particular feature or table entry.', - 'NumericAge':'Numeric age of sample, measured in AgeUnits. May be interpreted from one or several analyses; is not necessarily the date calculated from a single set of measurements.', - 'OldExplanation':'Explanatory text from FGDC standard for meaning of symbol', - 'OrientationConfidenceDegrees':'Estimated angular precision of combined azimuth AND inclination measurements, in degrees.', - 'OrientationSourceID':'Source of orientation data; foreign key to table DataSources.', - 'ParagraphStyle':'Token that identifies formatting of paragraph(s) within traditional Description of Map Units that correspond to this table entry.', - 'PlotAtScale':'At what scale (or larger) should this observation or analysis be plotted? At smaller scales, it should not be plotted. Useful to prevent crowding of display at small scales and to display progressively more data at larger and larger scales. Value is scale denominator.', - 'Source':'Plain-text short description that identifies the data source.', - 'StationID':'Foreign key to Stations point feature class.', - 'Symbol':'Reference to a point marker, line symbol, or area-fill symbol that is used on the map graphic to denote the feature: perhaps a star for a K-Ar age locality, or a heavy black line for a fault.', - 'Term':'Plain-language word for a concept. Values must be unique within database as a whole.', - 'Type':'Classifier that specifies what kind of geologic feature is represented by a database element: that a certain line within feature class ContactsAndFaults is a contact, or thrust fault, or water boundary; or that a point in GeochronPoints represents a K-Ar date.', - 'URL':'Universal Resource Locator (URL) or Document Object Identifier (DOI), identifies a document on the World Wide Web.', - 'Value':'Numeric value (e.g., elevation, concentration) associated with an isovalue (contour, isopleth) line. Units identified in feature TYPE definition.', - 'ValueConfidence':'Estimated half-width of uncertainty in numeric value (e.g., elevation, concentration) associated with an isovalue line. Units identified in feature TYPE definition. -9 indicates value is not available.' - } -entityDict = { - 'CartographicLines':'Lines (e.g., cross-section lines) that have no real-world physical existence, such that LocationConfidenceMeters, ExistenceConfidence, and IdentityConfidence attributes are meaningless, and that are never shown as concealed beneath a covering unit.', - 'CMULines':'Lines (box boundaries, internal contacts, brackets) of the Correlation of Map Units diagram.', - 'CMUPoints':'Points (typically, representing outcrops of a map unit too small to show as polygons at map scale) of the Correlation of Map Units diagram.', - 'CMUMapUnitPolys':'Polygons (representing map units) of the Correlation of Map Units diagram.', - 'CMUText':'Text of the Correlation of Map Units diagram.', - 'ContactsAndFaults':'Contacts between map units, faults that bound map units, and associated dangling faults. Includes concealed faults and contacts, waterlines, snowfield and glacier boundaries, and map boundary.', - 'CorrelationOfMapUnits':'CorrelationOfMapUnits is a feature dataset that encodes the Correlation of Map Units (CMU) diagram found on many geologic maps. Spatial reference frame is arbitrary; units may be page inches.', - 'CrossSection':'Feature dataset equivalent to a cross section. Note that spatial reference framework is probably meaningless. Coordinates are within the plane of the section: easting is horizontal distance from the cross-section origin and northing is distance from the vertical datum of the map.', - 'DataSourcePolys':'Polygons that delineate data sources for all parts of the map.', - 'DataSources':'Non-spatial table of sources of all spatial features, sources of some attributes of spatial features, and sources of some attributes of non-spatial table entries.', - 'DescriptionOfMapUnits':'Non-spatial table that captures content of the Description of Map Units (or equivalent List of Map Units and associated pamphlet text) included in a traditional paper geologic map. Has an internal hierarchy expressed by attribute HierarchyKey', - 'GeochronPoints':'Point locations of samples and accompanying geochronological measurements. Type field identifies geochronological method.', - 'GeologicEvents':'Non-spatial table for closely specifying ages of geologic features. Such ages may be tied to features via entries in table ExtendedAttributes.', - 'GeologicLines':'Lines that represent dikes, coal seams, ash beds, fold hinge-surface traces, isograds, and other linear features. All have these properties: (A) They do not participate in map-unit topology. (B) They correspond to features that exist within the Earth and may be concealed beneath younger, covering, material. (C) They are located with an accuracy that likely can be estimated.', - 'GeologicMap':'GeologicMap is a feature dataset equivalent to the map graphic in a paper report: it contains all the geologic content (but not the base map) within the neatline.', - 'GeoMaterialDict':'Non-spatial table that provides values of GeoMaterial, placed in a hierarchy, and their definitions. For further information, see Appendix A in GeMS documentation, available at http://ngmdb.usgs.gov/Info/standards/GeMS.', - 'Glossary':'Non-spatial table that, for certain fields (including all Type fields, Confidence fields, and GeneralLithology), lists the terms that populate these fields, term definitions, and sources for definitions.', - 'IsoValueLines':'Lines that represent structure contours, concentration isopleths, and other lines that share properties of: (A) Having an associated value (e.g., elevation, concentration) that is a real number. (B ) Having a definable uncertainty in their location. (C) Describing an idealized surface that need not be shown as concealed beneath covering map units.', - 'MiscellaneousMapInformation':'Properties of the map report as a whole. May include title, authorship, scale, geologic mapping credit, editing credit, cartography credit, date of approval, local magnetic declination, publication series and number, and base map information.', - 'MapUnitLines':'Lines that record distribution of map units of narrow, linear extent on the particular map horizon. ', - 'MapUnitPolys':'Polygons that record distribution of map units (including water, snowfields, glaciers, and unmapped area) on the particular map horizon. ', - 'MapUnitPoints':'Points that record distribution of map units of point-like extent on the particular map horizon. ', - 'MapUnitOverlayPolys':'Polygons that delineate underlying material, overlying material, or some other aspect of earth materials that is described in table DescriptionOfMapUnits, e.g., dike swarm, colluvium. On a map graphic, such polygons are commonly shown by a patterned overprint.', - 'OrientationPoints':'Point structure data (e.g., bedding attitudes, foliation attitudes, slip vectors measured at a point, etc.), one point per measurement. Multiple measurements at a single station (e.g., bedding and cleavage) should have the same StationID.', - 'OverlayPolys':'Polygons that delineate underlying material, overlying material, or some aspect of earth materials other than the geologic map unit, e.g., dike swarm, alteration zone. On a map graphic, such polygons are commonly shown by a patterned overprint.', - 'RepurposedSymbols':'Non-spatial table that identifies symbols from the FGDC Digital Cartographic Standard for Geologic Map Symbolization (FGDC-STD-013-2006) that are "repurposed" for this map.', - 'StandardLithology':'Non-spatial table for describing the lithologic constituents of geologic map units. Has 1 to many rows per map unit. May be used to extend and supplement the GeneralLithology terms and unstructured free text Description found in the DescriptionOfMapUnits table.', - 'Stations':'Point locations of field observations and (or) samples.', - } - - - -#*************************************************** -tableDict = {} - -# set feature_ID definitions -for table in startDict.keys(): - oldFields = startDict[table] - newfields = [] - for field in oldFields: - newfields.append(field) - newfields.append([table+'_ID','String','NoNulls',IDLength]) - tableDict[table] = newfields - -# build fieldNullsOKDict -fieldNullsOKDict = {} -for table in tableDict.keys(): - for field in tableDict[table]: - tableField = table+' '+field[0] - if field[2] == 'NullsOK': - fieldNullsOKDict[tableField] = True - else: +# -*- coding: cp1252 -*- +# GeMS_Definition.py +# module with definitions for GeMS geodatabase schema for +# ArcGIS geodatabases (personal or file) for geologic map data +# +# Ralph Haugerud, 19 August 2016 +# + +versionString = 'GeMS_Definition.py, version of 28 January 2021' +# fixes errors in Station feature class definition +# 16 Jan 2014: added ObservedMapUnit to Station feature class definition +# 8 April 2016: Fixed ObservedMapUnit. Put _ID field at end of each field list +# 19 August 2016: Began converting to GeMS +# 9 Sept 2016: Removed CMUText definition +# 4 March 2017: Removed ChangeLog definition. Added MapCollarInformation +# 17 Mar 2017: Changed MapCollarInformation to MiscellaneousMapInformation, added associated entity and domain descriptions +# 27 March 2017: order of tables in startDict revised to conform with documentation. Fields reordered and amended to conform with documentation +# 20 May 2017: MapUnitOverlayPolys and OverlayPolys (new names) changed to conform to v2 draft. MapUnitLabelPoints removed. +# 6 October 2017: In IsoValueLines definition, changed LocationConfidenceMeters to ValueConfidence +# 8 October 2017: ValueConfidence and URL added to attribDict[] +# 29 October 2019: Changed StationID to StationsID +# 29 October 2019: Added MapUnitLines, MapUnitPoints to as-needed feature classes +# 4 April 2020: Changed NullsOK to NoNulls for some fields in DescriptionOfMapUnits, to conform with documentation +# 9 April 2020: Changed NullsOK for Notes fields to Optional. Added definition of table LayerList +# 19 July 2020: Added 'Age' to attribDict +# 25 Sept 2020: Swapped Symbol and Label in ContactsAndFaults +# 28 Sept 2020: Removed definitions of CSA feature classes, as this is handled in Create Database and in cross-section projection tools +# 29 October 2020: Changed NoNulls to NullsOK for ObservedMapUnit in Stations per documentation - ET +# 1 December 2020: Added ErrorMeasure to GeochronPoints, to conform with documentation - RH + +# to think about: Maybe change all NoNulls to NullsOK? + +defaultLength = 254 +mapUnitLength = 10 +IDLength = 50 +memoLength = 3000 +booleanLength = 1 + +# attributes are in order Name DataType NullStatus suggestedLength +# _ID is missing, as it is added programatically, below +startDict = { +# required tables and feature classes + 'MapUnitPolys': [['MapUnit','String','NoNulls',mapUnitLength], + ['IdentityConfidence','String','NoNulls',IDLength], + ['Label','String','NullsOK',IDLength], + ['Symbol','String','NullsOK',defaultLength], + ['DataSourceID','String','NoNulls',IDLength], + ['Notes','String','Optional',defaultLength]], + 'ContactsAndFaults': [['Type','String','NoNulls',defaultLength], + ['IsConcealed','String','NoNulls',booleanLength], + ['LocationConfidenceMeters','Single','NoNulls'], + ['ExistenceConfidence','String','NoNulls',IDLength], + ['IdentityConfidence','String','NoNulls',IDLength], + ['Label','String','NullsOK',IDLength], + ['Symbol','String','NullsOK',defaultLength], + ['DataSourceID','String','NoNulls',IDLength], + ['Notes','String','Optional',defaultLength]], + 'DescriptionOfMapUnits': [['MapUnit','String','NullsOK',mapUnitLength], + ['Name','String','NoNulls',defaultLength], + ['FullName','String','NullsOK',defaultLength], + ['Age','String','NullsOK',defaultLength], + ['Description','String','NullsOK',memoLength], + ['HierarchyKey','String','NoNulls',defaultLength], + ['ParagraphStyle','String','NoNulls',defaultLength], + ['Label','String','NullsOK',30], + ['Symbol','String','NullsOK',defaultLength], + ['AreaFillRGB','String','NullsOK',defaultLength], + ['AreaFillPatternDescription','String','NullsOK',defaultLength], + ['DescriptionSourceID','String','NullsOK',IDLength], + ['GeoMaterial','String','NullsOK',defaultLength], + ['GeoMaterialConfidence','String','NullsOK',defaultLength]], + 'DataSources': [['Source','String','NoNulls',500], + ['Notes','String','Optional',300], + ['URL','String','Optional',300]], + 'Glossary': [['Term','String','NoNulls',defaultLength], + ['Definition','String','NoNulls',memoLength], + ['DefinitionSourceID','String','NoNulls',IDLength]], +# as-needed tables and feature classes + 'GenericPoints': [['Type','String','NoNulls',defaultLength], + ['Symbol','String','NullsOK',defaultLength], + ['Label','String','NullsOK',IDLength], + ['LocationConfidenceMeters','Single','NoNulls'], + ['PlotAtScale','Single','NoNulls'], + ['StationID','String','NullsOK',IDLength], + ['MapUnit','String','NoNulls',mapUnitLength], + ['LocationSourceID','String','NoNulls',IDLength], + ['DataSourceID','String','NoNulls',IDLength], + ['Notes','String','Optional',defaultLength]], + 'GenericSamples': [['Type','String','NoNulls',defaultLength], + ['Symbol','String','NullsOK',defaultLength], + ['Label','String','NullsOK',IDLength], + ['FieldSampleID','String','NullsOK',defaultLength], + ['AlternateSampleID','String','NullsOK',defaultLength], + ['MaterialAnalyzed','String','NullsOK',defaultLength], + ['LocationConfidenceMeters','Single','NoNulls'], + ['PlotAtScale','Single','NoNulls'], + ['StationID','String','NullsOK',IDLength], + ['MapUnit','String','NoNulls',mapUnitLength], + ['LocationSourceID','String','NoNulls',IDLength], + ['DataSourceID','String','NoNulls',IDLength], + ['Notes','String','Optional',defaultLength]], + 'OrientationPoints': [['Type','String','NoNulls',defaultLength], + ['Azimuth','Single','NoNulls'], + ['Inclination','Single','NoNulls'], + ['Symbol','String','NullsOK',defaultLength], + ['Label','String','NullsOK',IDLength], + ['LocationConfidenceMeters','Single','NoNulls'], + ['IdentityConfidence','String','NoNulls',50], + ['OrientationConfidenceDegrees','Single','NoNulls'], + ['PlotAtScale','Single','NoNulls'], + ['StationID','String','NullsOK',IDLength], + ['MapUnit','String','NoNulls',mapUnitLength], + ['LocationSourceID','String','NoNulls',IDLength], + ['OrientationSourceID','String','NoNulls',IDLength], + ['Notes','String','Optional',defaultLength]], + 'GeochronPoints': [['Type','String','NoNulls',defaultLength], + ['FieldSampleID','String','NullsOK',defaultLength], + ['AlternateSampleID','String','NullsOK',defaultLength], + ['MapUnit','String','NoNulls',mapUnitLength], + ['Symbol','String','NullsOK',defaultLength], + ['Label','String','NullsOK',IDLength], + ['LocationConfidenceMeters','Single','NoNulls'], + ['PlotAtScale','Single','NoNulls'], + ['MaterialAnalyzed','String','NullsOK',defaultLength], + ['NumericAge','Single','NoNulls'], + ['AgePlusError','Single','NullsOK'], + ['AgeMinusError','Single','NullsOK'], + ['ErrorMeasure','String','NullsOK',defaultLength], + ['AgeUnits','String','NoNulls',IDLength], + ['StationID','String','NullsOK',IDLength], + ['LocationSourceID','String','NoNulls',IDLength], + ['AnalysisSourceID','String','NullsOK',IDLength], + ['Notes','String','Optional',defaultLength]], + 'Stations': [['FieldID','String','NoNulls',IDLength], + ['LocationConfidenceMeters','Single','NoNulls'], + ['ObservedMapUnit','String','NullsOK',mapUnitLength], + ['MapUnit','String','NoNulls',mapUnitLength], + ['Symbol','String','NullsOK',defaultLength], + ['Label','String','NullsOK',IDLength], + ['PlotAtScale','Single','NoNulls'], + ['DataSourceID','String','NoNulls',IDLength], + ['Notes','String','NullsOK',defaultLength], + ['LocationMethod','String','NullsOK',defaultLength], + ['TimeDate','Date','NullsOK'], + ['Observer','String','NullsOK',defaultLength], + ['SignificantDimensionMeters','Single','NullsOK'], + ['GPSX','Double','NoNulls'], + ['GPSY','Double','NoNulls'], + ['PDOP','Single','NullsOK'], + ['MapX','Double','NoNulls'], + ['MapY','Double','NoNulls']], + 'GeologicLines': [['Type','String','NoNulls',defaultLength], + ['IsConcealed','String','NoNulls',booleanLength], + ['LocationConfidenceMeters','Single','NoNulls'], + ['ExistenceConfidence','String','NoNulls',IDLength], + ['IdentityConfidence','String','NoNulls',IDLength], + ['Symbol','String','NullsOK',defaultLength], + ['Label','String','NullsOK',IDLength], + ['DataSourceID','String','NoNulls',IDLength], + ['Notes','String','Optional',defaultLength]], + 'CartographicLines': [['Type','String','NoNulls',defaultLength], + ['Symbol','String','NullsOK',defaultLength], + ['Label','String','NullsOK',IDLength], + ['DataSourceID','String','NoNulls',IDLength], + ['Notes','String','Optional',defaultLength]], + 'IsoValueLines': [['Type','String','NoNulls',defaultLength], + ['Value','Single','NoNulls'], + ['ValueConfidence','Single','NoNulls'], + ['Symbol','String','NullsOK',defaultLength], + ['Label','String','NullsOK',IDLength], + ['DataSourceID','String','NoNulls',IDLength], + ['Notes','String','Optional',defaultLength]], + 'MapUnitLines': [['MapUnit','String','NoNulls',mapUnitLength], + ['IsConcealed','String','NoNulls',booleanLength], + ['LocationConfidenceMeters','Single','NoNulls'], + ['ExistenceConfidence','String','NoNulls',IDLength], + ['IdentityConfidence','String','NoNulls',IDLength], + ['Label','String','NullsOK',IDLength], + ['Symbol','String','NullsOK',defaultLength], + ['PlotAtScale','Single','NoNulls'], + ['DataSourceID','String','NoNulls',IDLength], + ['Notes','String','Optional',defaultLength]], + 'MapUnitPoints': [['MapUnit','String','NoNulls',mapUnitLength], + ['LocationConfidenceMeters','Single','NoNulls'], + ['ExistenceConfidence','String','NoNulls',IDLength], + ['IdentityConfidence','String','NoNulls',IDLength], + ['Label','String','NullsOK',IDLength], + ['Symbol','String','NullsOK',defaultLength], + ['PlotAtScale','Single','NoNulls'], + ['DataSourceID','String','NoNulls',IDLength], + ['Notes','String','Optional',defaultLength]], + 'MapUnitOverlayPolys':[['MapUnit','String','NoNulls',defaultLength], + ['IdentityConfidence','String','NoNulls',IDLength], + ['Label','String','NullsOK',IDLength], + ['Symbol','String','NullsOK',defaultLength], + ['DataSourceID','String','NoNulls',IDLength], + ['Notes','String','Optional',defaultLength]], + 'OverlayPolys': [['Type','String','NoNulls',defaultLength], + ['IdentityConfidence','String','NoNulls',IDLength], + ['Label','String','NullsOK',IDLength], + ['Symbol','String','NullsOK',defaultLength], + ['DataSourceID','String','NoNulls',IDLength], + ['Notes','String','Optional',defaultLength]], + 'DataSourcePolys': [['DataSourceID','String','NoNulls',IDLength], + ['Notes','String','Optional',defaultLength]], + 'RepurposedSymbols': [['FgdcIdentifier','String','NoNulls',defaultLength], + ['OldExplanation','String','NoNulls',defaultLength], + ['NewExplanation','String','NoNulls',defaultLength]], +# optional feature classes and tables described in GeMS specification + 'CMUMapUnitPolys': [['MapUnit','String','NoNulls',mapUnitLength], + ['Label','String','NullsOK',IDLength], + ['Symbol','String','NullsOK',defaultLength]], + 'CMULines': [['Type','String','NoNulls',defaultLength], + ['Symbol','String','NullsOK',defaultLength]], + 'CMUPoints': [['Type','String','NoNulls',defaultLength], + ['Label','String','NullsOK',IDLength], + ['Symbol','String','NullsOK',defaultLength]], + 'MiscellaneousMapInformation': [['MapProperty','String','NullsOK',defaultLength], + ['MapPropertyValue','String','NullsOK',memoLength]], + 'LayerList': [['OrderFromTop','Integer','NoNulls'], + ['FeatureDatasetName','String','NoNulls',defaultLength], + ['ElevationObject','String','NullsOK',defaultLength], + ['Description','String','NoNulls',memoLength]], + 'StandardLithology': [['MapUnit','String','NoNulls',mapUnitLength], + ['PartType','String','NoNulls',defaultLength], + ['Lithology','String','NoNulls',defaultLength], + ['ProportionTerm','String','NullsOK',defaultLength], + ['ProportionValue','Single','NullsOK'], + ['ScientificConfidence','String','NoNulls',defaultLength], + ['DataSourceID','String','NoNulls',IDLength]], +# optional feature classes not described in GeMS specification + 'FossilPoints': [['Type','String','NoNulls',defaultLength], + ['StationID','String','NullsOK',IDLength], + ['MapUnit','String','NoNulls',mapUnitLength], + ['Label','String','NullsOK',IDLength], + ['Symbol','String','NullsOK',defaultLength], + ['FieldSampleID','String','NullsOK',defaultLength], + ['AlternateSampleID','String','NullsOK',defaultLength], + ['MaterialAnalyzed','String','NullsOK',defaultLength], + ['PlotAtScale','Single','NoNulls'], + ['LocationConfidenceMeters','Single','NoNulls'], + ['FossilForms','String','NoNulls',memoLength], + ['FossilAge','String','NoNulls',defaultLength], + ['LocationSourceID','String','NoNulls',IDLength], + ['FossilFormsSourceID','String','NoNulls',IDLength], + ['FossilAgeSourceID','String','NullsOK',IDLength], + ['Notes','String','NullsOK',defaultLength]], + 'PhotoPoints': [['Type','String','NoNulls',defaultLength], + ['StationID','String','NullsOK',IDLength], + ['MapUnit','String','NoNulls',mapUnitLength], + ['Label','String','NullsOK',IDLength], + ['Symbol','String','NullsOK',defaultLength], + ['PlotAtScale','Single','NoNulls'], + ['LocationConfidenceMeters','Single','NoNulls'], + ['LocationSourceID','String','NoNulls',IDLength], + ['DataSourceID','String','NoNulls',IDLength], + ['PhotoID','String','NoNulls',IDLength], + ['PhotoSubject','String','NullsOK',defaultLength], + ['ViewDirection','String','NullsOK',defaultLength], + ['ViewWidth','String','NullsOK',defaultLength], + ['Notes','String','NullsOK',defaultLength]] +} + +GeoMaterialConfidenceValues = ["High","Medium","Low"] + +GeoMatConfDict = { 'High': ['The term and definition adequately characterize the overall lithologic nature of rocks and sediments in the map unit. Regarding the subjective term "adequately characterize", we refer to context and objectives of this classification as described in the GeMS documentation.', + 'GeMS documentation'], + 'Medium': ['The term and definition generally characterize the overall lithology of the map unit, but there are one or more significant minor lithologies that are not adequately described by the selected term.', + 'GeMS documentation'], + 'Low': ['The overall lithology of this map unit is not adequately classifiable using this list of terms and definitions, but the term selected is the best available. Or this map unit is insufficiently known to confidently assign a GeoMaterial term.', + 'GeMS documentation'] + } + +DefaultExIDConfidenceValues = [['certain', 'Identity of a feature can be determined using relevant observations and scientific judgment; therefore, one can be reasonably confident in the credibility of this interpretation.','FGDC-STD-013-2006'], + ['questionable','Identity of a feature cannot be determined using relevant observations and scientific judgment; therefore, one cannot be reasonably confident in the credibility of this interpretation. For example, IdentityConfidence = questionable is appropriate when a geologist reasons "I can see some kind of planar feature that separates map units in this outcrop, but I cannot be certain if it is a contact or a fault."','FGDC-STD-013-2006']] + + + +enumeratedValueDomainFieldList = [ + 'Type','LocationMethod','PartType','ProportionTerm','TimeScale', + 'ExistenceConfidence','IdentityConfidence', + 'ScientificConfidence','ParagraphStyle','AgeUnits', 'MapUnit', + 'DataSourceID','DescriptionSourceID','DefinitionSourceID','LocationSourceID', + 'OrientationSourceID','AnalysisSourceID', + 'GeoMaterial','GeoMaterialConfidence' + ] +rangeDomainDict = { + 'Azimuth':['0','360','degrees (angular measure)'], + 'Inclination':['-90','90','degrees (angular measure)'] + } +unrepresentableDomainDict = { + '_ID':'Arbitrary string. Values should be unique within this database.', + 'PlotAtScale':'Positive real number.', + 'OrientationConfidenceDegrees':'Positive real number. Value of -9, -99, or -999 indicates value is unknown.', + 'LocationConfidenceMeters':'Positive real number. Value of -9, -99, or -999 indicates value is unknown.', + 'NumericAge':'Positive real number. Zero or negative value may indicate non-numeric (i.e., limiting) age.', + 'AgePlusError':'Positive real number. Value of -9, -99, or -999 indicates value is unknown.', + 'AgeMinusError':'Positive real number. Value of -9, -99, or -999 indicates value is unknown.', + 'Notes':'Unrepresentable domain. Free text. Values of or #null indicate no entry.', + 'Value':'Real number.', + 'default':'Unrepresentable domain.', + 'MapProperty':'Unrepresentable domain. Free text.', + 'MapPropertyValue':'Unrepresentable domain. Free text.' + } +attribDict = { + '_ID':'Primary key.', + 'Age':'Age of map unit as shown in Description of Map Units. Examples of values are "late Holocene", "Pliocene and Miocene", "Lower Cretaceous".', + 'AgeMinusError':'Negative (younger) age error, measured in AgeUnits. Type of error (RMSE, 1 sigma, 2 sigma, 95% confidence limit) should be stated in Notes field.', + 'AgePlusError':'Positive (older) age error, measured in AgeUnits. Type of error (RMSE, 1 sigma, 2 sigma, 95% confidence limit) should be stated in Notes field.', + 'AgeUnits':'Units for NumericAge, AgePlusError, AgeMinusError.', + 'AlternateSampleID':'Museum #, lab #, etc.', + 'AnalysisSourceID':'Source of analysis; foreign key to table DataSources.', + 'AreaFillPatternDescription':'Text description (e.g., "random small red dashes") provided as a convenience for users who must recreate symbolization.', + 'AreaFillRGB':'{Red, Green, Blue} tuples that specify the suggested color (e.g., "255,255,255", "124,005,255") of area fill for symbolizing MapUnit. Each color value is an integer between 0 and 255, values are zero-padded to a length of 3 digits, and values are separated by commas with no space: NNN,NNN,NNN.', + 'Azimuth':'Strike or trend, measured in degrees clockwise from geographic North. Use right-hand rule (dip is to right of azimuth direction). Horizontal planar features may have any azimuth.', + 'DataSourceID':'Source of data; foreign key to table DataSources.', + 'Definition':'Plain-language definition.', + 'DefinitionSourceID':'Source of definition; foreign key to DataSources.', + 'Description':'Free-format text description of map unit. Commonly structured according to one or more accepted traditions (e.g., lithology, thickness, color, weathering and outcrop characteristics, distinguishing features, genesis, age constraints) and terse.', + 'DescriptionSourceID':'Source of map-unit description; foreign key to table Datasources.', + 'ExistenceConfidence':'Confidence that feature exists.', + 'FgdcIdentifier':'Identifier for symbol from FGDC Digital Cartographic Standard for Geologic Map Symbolization.', + 'FieldSampleID':'Sample ID given at time of collection.', + 'FullName':'Name of map unit including identification of containing higher rank unit(s), e.g., "Shnabkaib Member of Moenkopi Formation".', + 'GeoMaterial':'Categorization of map unit based on lithologic and genetic character, term selected from NGMDB standard term list defined in Appendix A of GeMS documentation, available at http://ngmdb.usgs.gov/Info/standards/GeMS..', + 'GeoMaterialConfidence':'Describes appropriateness of GeoMaterial term for describing the map unit.', + 'GPSX':'Measured GPS coordinate (easting). May differ from map coordinate because of GPS error or (more likely) base map error.', + 'GPSY':'Measured GPS coordinate (northing). May differ from map coordinate because of GPS error or (more likely) base map error.', + 'HierarchyKey':'String that records hierarchical structure. Has form nn-nn-nn, nnn-nnn, or similar. Numeric, left-padded with zeros, dash-delimited. Each HierarchyKey fragment of each row MUST be the same length to allow text-based sorting of table entries.', + 'IdentityConfidence':'Confidence that feature is correctly identified.', + 'Inclination':'Dip or plunge, measured in degrees down from horizontal. Negative values allowed when specifying vectors (not axes) that point above the horizon, e.g., paleocurrents. Types defined as horizontal (e.g., horizontal bedding) shall have Inclination=0.', + 'IndentedName':'Name with addition of leading spaces to help show rank within a hierarchical list.', + 'IsConcealed':'Flag for contacts and faults covered by overlying map unit.', + 'Label':'Plain-text equivalent of the desired annotation for a feature: for example "14 Ma", or "^c" which (when used with the FGDC GeoAge font) results in the geologic map-unit label TRc (with TR run together to make the Triassic symbol).', + 'LocationConfidenceMeters':'Estimated half-width in meters of positional uncertainty envelope; position is relative to other features in database.', + 'LocationSourceID':'Source of location; foreign key to table DataSources.', + 'MapProperty':'Name of map property. Examples include "Scale", "Authors and affiliations", "Magnetic declination".', + 'MapPropertyValue':'Value of map property. Examples = "1:24,000", "G.S. Smith1 and J. Doe2 1-Division of Geology, Some State, 2-Big University", "16.5 degrees"', + 'MapUnit':'Short plain-text identifier of the map unit. Foreign key to DescriptionOfMapUnits table.', + 'MapX':'Station coordinate (easting) as compiled on the base map; base map should be identified in the DataSources record.', + 'MapY':'Station coordinate (northing) as compiled on the base map; base map should be identified in the DataSources record.', + 'MaterialAnalyzed':'Earth-material which was analyzed, e.g., wood, shell, zircon, basalt, whole-rock.', + 'Name':'Name of map unit, as shown in boldface in traditional DMU, e.g., "Shnabkaib Member". Identifies unit within its hierarchical context.', + 'NewExplanation':'Explanation of usage of symbol in this map portrayal', + 'Notes':'Additional information specific to a particular feature or table entry.', + 'NumericAge':'Numeric age of sample, measured in AgeUnits. May be interpreted from one or several analyses; is not necessarily the date calculated from a single set of measurements.', + 'OldExplanation':'Explanatory text from FGDC standard for meaning of symbol', + 'OrientationConfidenceDegrees':'Estimated angular precision of combined azimuth AND inclination measurements, in degrees.', + 'OrientationSourceID':'Source of orientation data; foreign key to table DataSources.', + 'ParagraphStyle':'Token that identifies formatting of paragraph(s) within traditional Description of Map Units that correspond to this table entry.', + 'PlotAtScale':'At what scale (or larger) should this observation or analysis be plotted? At smaller scales, it should not be plotted. Useful to prevent crowding of display at small scales and to display progressively more data at larger and larger scales. Value is scale denominator.', + 'Source':'Plain-text short description that identifies the data source.', + 'StationID':'Foreign key to Stations point feature class.', + 'Symbol':'Reference to a point marker, line symbol, or area-fill symbol that is used on the map graphic to denote the feature: perhaps a star for a K-Ar age locality, or a heavy black line for a fault.', + 'Term':'Plain-language word for a concept. Values must be unique within database as a whole.', + 'Type':'Classifier that specifies what kind of geologic feature is represented by a database element: that a certain line within feature class ContactsAndFaults is a contact, or thrust fault, or water boundary; or that a point in GeochronPoints represents a K-Ar date.', + 'URL':'Universal Resource Locator (URL) or Document Object Identifier (DOI), identifies a document on the World Wide Web.', + 'Value':'Numeric value (e.g., elevation, concentration) associated with an isovalue (contour, isopleth) line. Units identified in feature TYPE definition.', + 'ValueConfidence':'Estimated half-width of uncertainty in numeric value (e.g., elevation, concentration) associated with an isovalue line. Units identified in feature TYPE definition. -9 indicates value is not available.' + } +entityDict = { + 'CartographicLines':'Lines (e.g., cross-section lines) that have no real-world physical existence, such that LocationConfidenceMeters, ExistenceConfidence, and IdentityConfidence attributes are meaningless, and that are never shown as concealed beneath a covering unit.', + 'CMULines':'Lines (box boundaries, internal contacts, brackets) of the Correlation of Map Units diagram.', + 'CMUPoints':'Points (typically, representing outcrops of a map unit too small to show as polygons at map scale) of the Correlation of Map Units diagram.', + 'CMUMapUnitPolys':'Polygons (representing map units) of the Correlation of Map Units diagram.', + 'CMUText':'Text of the Correlation of Map Units diagram.', + 'ContactsAndFaults':'Contacts between map units, faults that bound map units, and associated dangling faults. Includes concealed faults and contacts, waterlines, snowfield and glacier boundaries, and map boundary.', + 'CorrelationOfMapUnits':'CorrelationOfMapUnits is a feature dataset that encodes the Correlation of Map Units (CMU) diagram found on many geologic maps. Spatial reference frame is arbitrary; units may be page inches.', + 'CrossSection':'Feature dataset equivalent to a cross section. Note that spatial reference framework is probably meaningless. Coordinates are within the plane of the section: easting is horizontal distance from the cross-section origin and northing is distance from the vertical datum of the map.', + 'DataSourcePolys':'Polygons that delineate data sources for all parts of the map.', + 'DataSources':'Non-spatial table of sources of all spatial features, sources of some attributes of spatial features, and sources of some attributes of non-spatial table entries.', + 'DescriptionOfMapUnits':'Non-spatial table that captures content of the Description of Map Units (or equivalent List of Map Units and associated pamphlet text) included in a traditional paper geologic map. Has an internal hierarchy expressed by attribute HierarchyKey', + 'GeochronPoints':'Point locations of samples and accompanying geochronological measurements. Type field identifies geochronological method.', + 'GeologicEvents':'Non-spatial table for closely specifying ages of geologic features. Such ages may be tied to features via entries in table ExtendedAttributes.', + 'GeologicLines':'Lines that represent dikes, coal seams, ash beds, fold hinge-surface traces, isograds, and other linear features. All have these properties: (A) They do not participate in map-unit topology. (B) They correspond to features that exist within the Earth and may be concealed beneath younger, covering, material. (C) They are located with an accuracy that likely can be estimated.', + 'GeologicMap':'GeologicMap is a feature dataset equivalent to the map graphic in a paper report: it contains all the geologic content (but not the base map) within the neatline.', + 'GeoMaterialDict':'Non-spatial table that provides values of GeoMaterial, placed in a hierarchy, and their definitions. For further information, see Appendix A in GeMS documentation, available at http://ngmdb.usgs.gov/Info/standards/GeMS.', + 'Glossary':'Non-spatial table that, for certain fields (including all Type fields, Confidence fields, and GeneralLithology), lists the terms that populate these fields, term definitions, and sources for definitions.', + 'IsoValueLines':'Lines that represent structure contours, concentration isopleths, and other lines that share properties of: (A) Having an associated value (e.g., elevation, concentration) that is a real number. (B ) Having a definable uncertainty in their location. (C) Describing an idealized surface that need not be shown as concealed beneath covering map units.', + 'MiscellaneousMapInformation':'Properties of the map report as a whole. May include title, authorship, scale, geologic mapping credit, editing credit, cartography credit, date of approval, local magnetic declination, publication series and number, and base map information.', + 'MapUnitLines':'Lines that record distribution of map units of narrow, linear extent on the particular map horizon. ', + 'MapUnitPolys':'Polygons that record distribution of map units (including water, snowfields, glaciers, and unmapped area) on the particular map horizon. ', + 'MapUnitPoints':'Points that record distribution of map units of point-like extent on the particular map horizon. ', + 'MapUnitOverlayPolys':'Polygons that delineate underlying material, overlying material, or some other aspect of earth materials that is described in table DescriptionOfMapUnits, e.g., dike swarm, colluvium. On a map graphic, such polygons are commonly shown by a patterned overprint.', + 'OrientationPoints':'Point structure data (e.g., bedding attitudes, foliation attitudes, slip vectors measured at a point, etc.), one point per measurement. Multiple measurements at a single station (e.g., bedding and cleavage) should have the same StationID.', + 'OverlayPolys':'Polygons that delineate underlying material, overlying material, or some aspect of earth materials other than the geologic map unit, e.g., dike swarm, alteration zone. On a map graphic, such polygons are commonly shown by a patterned overprint.', + 'RepurposedSymbols':'Non-spatial table that identifies symbols from the FGDC Digital Cartographic Standard for Geologic Map Symbolization (FGDC-STD-013-2006) that are "repurposed" for this map.', + 'StandardLithology':'Non-spatial table for describing the lithologic constituents of geologic map units. Has 1 to many rows per map unit. May be used to extend and supplement the GeneralLithology terms and unstructured free text Description found in the DescriptionOfMapUnits table.', + 'Stations':'Point locations of field observations and (or) samples.', + } + + + +#*************************************************** +tableDict = {} + +# set feature_ID definitions +for table in startDict.keys(): + oldFields = startDict[table] + newfields = [] + for field in oldFields: + newfields.append(field) + newfields.append([table+'_ID','String','NoNulls',IDLength]) + tableDict[table] = newfields + +# build fieldNullsOKDict +fieldNullsOKDict = {} +for table in tableDict.keys(): + for field in tableDict[table]: + tableField = table+' '+field[0] + if field[2] == 'NullsOK': + fieldNullsOKDict[tableField] = True + else: fieldNullsOKDict[tableField] = False \ No newline at end of file