azgs-geomapmaker / GeMS-Toolbox

MIT License
0 stars 0 forks source link

Implement "standardized export" #5

Open aazaff opened 6 years ago

aazaff commented 6 years ago

The GeMs specification requires that in addition to releasing the proprietary ESRI File Geodatabase, that they also release proprietary ESRI Shapefile versions (ugh).

Importantly, they do not simply want each table to be written out as an individual shapefile, which could easily be achieved using ogr2ogr. Rather, they want attributes from different tables to be joined in a specific way to make the master shapefiles. Their guidance is as follows.

To create the MapUnitPolys shapefile, join DescriptionOfMapUnits (via the MapUnit field) and DataSources (via DataSourceID field) tables to the MapUnitPolys feature class. Map long field names from the database to short (10 characters or less), DBF-compatible names and export to a polygon shapefile. In the exported table, delete the OBJECTID_ID, Source, and Notes fields from the DescriptionOfMapUnits and DataSources tables (see Table 2). If the DescriptionOfMapUnits source field contains important information that is not conveyed by the MapUnitPolys source, consider updating the MapUnitPolys source. Field-name translation should be documented in an accompanying text file. Certain fields (e.g., Text field in DescriptionOfMapUnits) are likely to be truncated to fit the 255-character limit for DBF fields; this is unfortunate, but acceptable.

To create the ContactsAndFaults shapefile, join Glossary (Type field joins to Term in Glossary) and DataSources (via the DataSourceID field) tables to the ContactsAndFaults feature class. Delete OBJECTID_ID, RuleID, Override, DataSourceID, Glossary_ID, Glossary DefinitionSourceID, and DefinitionSource Notes fields (Table 3). Map long field names from the database to short, DBFcompatible names and export to a line shapefile. Other feature classes may be exported to shapefiles following similar procedures.

The USGS has already released a python tool to do this, but our toolbar should have a more general implementation that can export to multiple file formats (e.g., geojson, kml).