From f6b7bb68b7981e375d922fd934a0958972f81624 Mon Sep 17 00:00:00 2001 From: marshHawk4 Date: Wed, 20 Mar 2024 12:06:49 -0400 Subject: [PATCH] Map areas added to schema (#5) Map area geom added --- cdr_schemas/georeference.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/cdr_schemas/georeference.py b/cdr_schemas/georeference.py index 1e12d68..e6c5460 100644 --- a/cdr_schemas/georeference.py +++ b/cdr_schemas/georeference.py @@ -4,8 +4,9 @@ from enum import Enum -class PointType(str, Enum): +class GeomType(str, Enum): Point = "Point" + Polygon = "Polygon" class Geom_Point(BaseModel): @@ -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): @@ -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): @@ -103,6 +109,8 @@ class ProjectionResult(BaseModel): Name of file uploaded for this projection. """, ) + + class GeoreferenceResult(BaseModel): @@ -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=""" @@ -126,7 +143,6 @@ class GeoreferenceResult(BaseModel): ) - class GeoreferenceResults(BaseModel): """ Georeference Results.