Skip to content

UW-xDD/cdr_schemas

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CDR Schemas

Development

Formatting Code

poetry run format

Verify Changes

# verify types (mypy)
poetry run types

# lint
poetry run lint

Build local package

poetry build -f sdist

Update Schema Diagrams

To generate schemas you will need to run poetry install --with docs to install the proper dependencies

poetry run docs

Schemas

Georeference

georeference
classDiagram

    class GroundControlPoint {
        gcp_id: str
        map_geom: Geom_Point
        px_geom: Pixel_Point
        confidence: Optional[float]
        model: str
        model_version: str
        crs: Optional[str]
    }

    class GeoreferenceResults {
        cog_id: str
        georeference_results: Optional[list[GeoreferenceResult]]
        gcps: Optional[list[GroundControlPoint]]
        system: str
        system_version: str
    }

    class GeomType {
        <<Enumeration>>
        Point: str = 'Point'
        LineString: str = 'LineString'
        Polygon: str = 'Polygon'
    }

    class Area_Extraction {
        type: GeomType = GeomType.Polygon
        coordinates: list[list[list[Union[float, int]]]]
        bbox: Optional[list[Union[float, int]]]
        category: AreaType
        text: Optional[str]
        confidence: Optional[float]
        model: Optional[str]
        model_version: Optional[str]
    }

    class ProjectionResult {
        crs: str
        gcp_ids: list[str]
        file_name: str
    }

    class Pixel_Point {
        rows_from_top: Union[float, int]
        columns_from_left: Union[float, int]
        type: GeomType = GeomType.Point
    }

    class GeoreferenceResult {
        likely_CRSs: Optional[list[str]]
        map_area: Optional[Area_Extraction]
        projections: Optional[list[ProjectionResult]]
    }

    class Geom_Point {
        latitude: Union[float, int, NoneType]
        longitude: Union[float, int, NoneType]
        type: GeomType = GeomType.Point
    }

    Area_Extraction ..> AreaType
    Area_Extraction ..> GeomType
    Geom_Point ..> GeomType
    Pixel_Point ..> GeomType
    GroundControlPoint ..> Pixel_Point
    GroundControlPoint ..> Geom_Point
    GeoreferenceResult ..> ProjectionResult
    GeoreferenceResult ..> Area_Extraction
    GeoreferenceResults ..> GeoreferenceResult
    GeoreferenceResults ..> GroundControlPoint


Loading

Metadata

metadata
classDiagram

    class MapMetaData {
        title: Optional[str]
        year: Optional[int]
        crs: Optional[str]
        authors: Optional[list[str]]
        organization: Optional[str]
        scale: Optional[int]
        quadrangle_name: Optional[str]
        map_shape: Optional[MapShapeTypes]
        map_color_scheme: Optional[MapColorSchemeTypes]
        publisher: Optional[str]
        state: Optional[str]
        model: str
        model_version: str
    }

    class MapShapeTypes {
        <<Enumeration>>
        rectangular: str = 'rectangular'
        non_rectangular: str = 'non_rectangular'
    }

    class MapColorSchemeTypes {
        <<Enumeration>>
        full_color: str = 'full_color'
        monochrome: str = 'monochrome'
        grayscale: str = 'grayscale'
    }

    class CogMetaData {
        cog_id: str
        system: str
        system_version: str
        multiple_maps: Optional[bool]
        map_metadata: Optional[list[MapMetaData]]
    }

    MapMetaData ..> MapShapeTypes
    MapMetaData ..> MapColorSchemeTypes
    CogMetaData ..> MapMetaData


Loading

Feature Results

feature results
classDiagram

    class PolygonLegendAndFeauturesResult {
        id: str
        crs: str
        cdr_projection_id: Optional[str]
        map_unit: Optional[MapUnit]
        abbreviation: Optional[str]
        legend_bbox: Optional[list[Union[float, int]]]
        category: Optional[str]
        color: Optional[str]
        description: Optional[str]
        pattern: Optional[str]
        polygon_features: Optional[PolygonFeatureCollection]
    }

    class CogMetaData {
        cog_id: str
        system: str
        system_version: str
        multiple_maps: Optional[bool]
        map_metadata: Optional[list[MapMetaData]]
    }

    class FeatureResults {
        cog_id: str
        line_feature_results: Optional[list[LineLegendAndFeaturesResult]]
        point_feature_results: Optional[list[PointLegendAndFeaturesResult]]
        polygon_feature_results: Optional[list[PolygonLegendAndFeauturesResult]]
        cog_area_extractions: Optional[list[Area_Extraction]]
        cog_metadata_extractions: Optional[list[CogMetaData]]
        system: str
        system_version: str
    }

    class LineLegendAndFeaturesResult {
        id: str
        crs: str
        cdr_projection_id: Optional[str]
        name: Optional[str]
        description: Optional[str]
        legend_bbox: Optional[list[Union[float, int]]]
        line_features: Optional[LineFeatureCollection]
    }

    class Area_Extraction {
        type: GeomType = GeomType.Polygon
        coordinates: list[list[list[Union[float, int]]]]
        bbox: Optional[list[Union[float, int]]]
        category: AreaType
        text: Optional[str]
        confidence: Optional[float]
        model: Optional[str]
        model_version: Optional[str]
    }

    class PointLegendAndFeaturesResult {
        id: str
        crs: str
        cdr_projection_id: Optional[str]
        name: Optional[str]
        description: Optional[str]
        legend_bbox: Optional[list[Union[float, int]]]
        point_features: Optional[list[PointFeatureCollection]]
    }

    Area_Extraction ..> AreaType
    Area_Extraction ..> GeomType
    LineLegendAndFeaturesResult ..> LineFeatureCollection
    PointLegendAndFeaturesResult ..> PointFeatureCollection
    PolygonLegendAndFeauturesResult ..> PolygonFeatureCollection
    PolygonLegendAndFeauturesResult ..> MapUnit
    CogMetaData ..> MapMetaData
    FeatureResults ..> PolygonLegendAndFeauturesResult
    FeatureResults ..> CogMetaData
    FeatureResults ..> LineLegendAndFeaturesResult
    FeatureResults ..> Area_Extraction
    FeatureResults ..> PointLegendAndFeaturesResult


Loading

Point Feature

point feature
classDiagram

    class GeoJsonType {
        <<Enumeration>>
        Feature: str = 'Feature'
        FeatureCollection: str = 'FeatureCollection'
    }

    class Point {
        coordinates: list[Union[float, int]]
        type: GeomType = GeomType.Point
    }

    class PointFeatureCollection {
        type: GeoJsonType = GeoJsonType.FeatureCollection
        features: list[PointFeature]
    }

    class PointFeature {
        type: GeoJsonType = GeoJsonType.Feature
        id: str
        geometry: Point
        properties: PointProperties
    }

    class PointProperties {
        model: Optional[str]
        model_version: Optional[str]
        confidence: Optional[float]
        bbox: Optional[list[Union[float, int]]]
        dip: Optional[int]
        dip_direction: Optional[int]
    }

    class GeomType {
        <<Enumeration>>
        Point: str = 'Point'
        LineString: str = 'LineString'
        Polygon: str = 'Polygon'
    }

    class PointLegendAndFeaturesResult {
        id: str
        crs: str
        cdr_projection_id: Optional[str]
        name: Optional[str]
        description: Optional[str]
        legend_bbox: Optional[list[Union[float, int]]]
        point_features: Optional[list[PointFeatureCollection]]
    }

    Point ..> GeomType
    PointFeature ..> PointProperties
    PointFeature ..> GeoJsonType
    PointFeature ..> Point
    PointFeatureCollection ..> PointFeature
    PointFeatureCollection ..> GeoJsonType
    PointLegendAndFeaturesResult ..> PointFeatureCollection


Loading

Line Feature

line feature
classDiagram

    class GeoJsonType {
        <<Enumeration>>
        Feature: str = 'Feature'
        FeatureCollection: str = 'FeatureCollection'
    }

    class LineFeatureCollection {
        type: GeoJsonType = GeoJsonType.FeatureCollection
        features: Optional[list[LineFeature]]
    }

    class GeomType {
        <<Enumeration>>
        Point: str = 'Point'
        LineString: str = 'LineString'
        Polygon: str = 'Polygon'
    }

    class Line {
        coordinates: list[list[Union[float, int]]]
        type: GeomType = GeomType.LineString
    }

    class LineProperty {
        model: Optional[str]
        model_version: Optional[str]
        confidence: Optional[float]
        dash_pattern: Optional[DashType] = None
        symbol: Optional[str]
    }

    class LineLegendAndFeaturesResult {
        id: str
        crs: str
        cdr_projection_id: Optional[str]
        name: Optional[str]
        description: Optional[str]
        legend_bbox: Optional[list[Union[float, int]]]
        line_features: Optional[LineFeatureCollection]
    }

    class DashType {
        <<Enumeration>>
        solid: str = 'solid'
        dash: str = 'dash'
        dotted: str = 'dotted'
    }

    class LineFeature {
        type: GeoJsonType = GeoJsonType.Feature
        id: str
        geometry: Line
        properties: LineProperty
    }

    Line ..> GeomType
    LineProperty ..> DashType
    LineFeature ..> Line
    LineFeature ..> GeoJsonType
    LineFeature ..> LineProperty
    LineFeatureCollection ..> GeoJsonType
    LineFeatureCollection ..> LineFeature
    LineLegendAndFeaturesResult ..> LineFeatureCollection


Loading

Polygon Feature

polygon feature
classDiagram

    class PolygonLegendAndFeauturesResult {
        id: str
        crs: str
        cdr_projection_id: Optional[str]
        map_unit: Optional[MapUnit]
        abbreviation: Optional[str]
        legend_bbox: Optional[list[Union[float, int]]]
        category: Optional[str]
        color: Optional[str]
        description: Optional[str]
        pattern: Optional[str]
        polygon_features: Optional[PolygonFeatureCollection]
    }

    class GeoJsonType {
        <<Enumeration>>
        Feature: str = 'Feature'
        FeatureCollection: str = 'FeatureCollection'
    }

    class PolygonFeatureCollection {
        type: GeoJsonType = GeoJsonType.FeatureCollection
        features: Optional[list[PolygonFeature]]
    }

    class PolygonFeature {
        type: GeoJsonType = GeoJsonType.Feature
        id: str
        geometry: Polygon
        properties: PolygonProperty
    }

    class PolygonProperty {
        model: Optional[str]
        model_version: Optional[str]
        confidence: Optional[float]
    }

    class GeomType {
        <<Enumeration>>
        Point: str = 'Point'
        LineString: str = 'LineString'
        Polygon: str = 'Polygon'
    }

    class Polygon {
        coordinates: list[list[list[Union[float, int]]]]
        type: GeomType = GeomType.Polygon
    }

    class MapUnit {
        age_text: Optional[str]
        b_age: Optional[float]
        b_interval: Optional[str]
        lithology: Optional[str]
        name: Optional[str]
        t_age: Optional[float]
        t_interval: Optional[str]
        comments: Optional[str]
    }

    Polygon ..> GeomType
    PolygonFeature ..> Polygon
    PolygonFeature ..> PolygonProperty
    PolygonFeature ..> GeoJsonType
    PolygonFeatureCollection ..> PolygonFeature
    PolygonFeatureCollection ..> GeoJsonType
    PolygonLegendAndFeauturesResult ..> PolygonFeatureCollection
    PolygonLegendAndFeauturesResult ..> MapUnit


Loading

Cog Metadata

cog metadata
classDiagram

    class MapMetaData {
        title: Optional[str]
        year: Optional[int]
        crs: Optional[str]
        authors: Optional[list[str]]
        organization: Optional[str]
        scale: Optional[int]
        quadrangle_name: Optional[str]
        map_shape: Optional[MapShapeTypes]
        map_color_scheme: Optional[MapColorSchemeTypes]
        publisher: Optional[str]
        state: Optional[str]
        model: str
        model_version: str
    }

    class MapShapeTypes {
        <<Enumeration>>
        rectangular: str = 'rectangular'
        non_rectangular: str = 'non_rectangular'
    }

    class MapColorSchemeTypes {
        <<Enumeration>>
        full_color: str = 'full_color'
        monochrome: str = 'monochrome'
        grayscale: str = 'grayscale'
    }

    class CogMetaData {
        cog_id: str
        system: str
        system_version: str
        multiple_maps: Optional[bool]
        map_metadata: Optional[list[MapMetaData]]
    }

    MapMetaData ..> MapShapeTypes
    MapMetaData ..> MapColorSchemeTypes
    CogMetaData ..> MapMetaData


Loading

Document

document
classDiagram

    class Document {
        id: UUID
        title: str
        is_public: bool
        xdd_id: Optional[str] = None
        doi: Optional[str] = None
        pages: Optional[int] = None
        page_width: Optional[int] = None
        page_height: Optional[int] = None
        ingest_date: Optional[datetime] = None
        ingest_batch: Optional[str] = None
        xdd_link: Optional[str] = None
        doi_link: Optional[str] = None
    }

    Document ..> datetime
    Document ..> UUID


Loading

About

cdr schemas for integration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.9%
  • Shell 1.1%