Overview
bedrock-ge follows a pipeline architecture: Parse → Map → Transform → Validate → Export
ags.py- Main entry point with ags_to_brgi_db_mapping() function that auto-detects AGS3/4 format and routes to appropriate parserags3.py- AGS3 parser with ags3_to_dfs() and ags3_to_brgi_db_mapping() functionsags4.py- AGS4 parser (leverages python_ags4 library)
Data Models & Configuration
Section titled “Data Models & Configuration”mapping_models.py- Pydantic models defining how source data maps to Bedrock schema: BedrockGIMapping(Project, Location, InSitu, Sample, Lab, Other)schemas.py- Pandera validation schemas ensuring data quality:BedrockGIDatabase,BedrockGIGeospatialDatabasesqlmodels.py- SQLModel definitions for database persistence
Mapping
Section titled “Mapping”mapper.py- Main transformation engine withmap_to_brgi_db()function:- Generates unique IDs and foreign key relationships
- Applies mapping configurations to create final database
- Validates data using schemas
Geospatial Processing
Section titled “Geospatial Processing”geospatial.py- 3D geometry creation withcreate_brgi_geodb():- Creates LineString geometries for boreholes
- Interpolates test positions along 3D borehole paths
- Handles coordinate reference system transformations
Utilities & I/O
Section titled “Utilities & I/O”io_utils.py- File handling with smart encoding detection and type coercionwrite.py- Export functions for GeoPackage, Excel, and other formatsdb_operations.py- Database merging with merge_dbs() functionvalidate.py- Data validation utilities for referential integrity