Skip to content

Commit

Permalink
Map areas added to schema (#5)
Browse files Browse the repository at this point in the history
Map area geom added
  • Loading branch information
marshHawk4 authored Mar 20, 2024
1 parent 4f4c7d4 commit f6b7bb6
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions cdr_schemas/georeference.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
from enum import Enum


class PointType(str, Enum):
class GeomType(str, Enum):
Point = "Point"
Polygon = "Polygon"


class Geom_Point(BaseModel):
Expand All @@ -15,7 +16,7 @@ class Geom_Point(BaseModel):
"""

coordinates: List[Optional[Union[float, int]]]
type: PointType = PointType.Point
type: GeomType = GeomType.Point


class Pixel_Point(BaseModel):
Expand All @@ -25,7 +26,12 @@ class Pixel_Point(BaseModel):
"""

coordinates: List[Union[float, int]]
type: PointType = PointType.Point
type: GeomType = GeomType.Point


class Map_Area(BaseModel):
coordinates: List[List[Union[float, int]]]
type: GeomType = GeomType.Polygon


class GroundControlPoint(BaseModel):
Expand Down Expand Up @@ -103,6 +109,8 @@ class ProjectionResult(BaseModel):
Name of file uploaded for this projection.
""",
)




class GeoreferenceResult(BaseModel):
Expand All @@ -117,6 +125,15 @@ class GeoreferenceResult(BaseModel):
Projection Coordinate System for the map. ie ["EPSG:32612", "EPSG:32613"]
""",
)
map_area: Optional[Map_Area] = Field(
...,
description="""
Polygon bordering the map area for this georeference result. There can
be many map areas on a cog so this would be the pixel polygon of one of those
areas that has been found.
The optional projections attached to this GeoreferenceResult should be referring to this area.
"""
)
projections: Optional[List[ProjectionResult]] = Field(
...,
description="""
Expand All @@ -126,7 +143,6 @@ class GeoreferenceResult(BaseModel):
)



class GeoreferenceResults(BaseModel):
"""
Georeference Results.
Expand Down

0 comments on commit f6b7bb6

Please sign in to comment.