-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added metadata schema * added metadata schema * added extra area
- Loading branch information
1 parent
3ce0789
commit ba7d11b
Showing
3 changed files
with
91 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
from typing import List, Union, Optional | ||
from enum import Enum | ||
from pydantic import BaseModel, Field, ConfigDict | ||
|
||
|
||
class MapShapeTypes(str, Enum): | ||
"""Enum for the possible values of map_shape field of MapMetadata.""" | ||
|
||
rectangular = "rectangular" | ||
non_rectangular = "non_rectangular" | ||
|
||
|
||
class MapColorSchemeTypes(str, Enum): | ||
"""Enum for the possible values of map_color_scheme field of MapMetadata""" | ||
|
||
full_color = "full_color" | ||
monochrome = "monochrome" | ||
grayscale = "grayscale" | ||
|
||
|
||
class MapMetaData(BaseModel): | ||
title: Optional[str] = Field( | ||
..., | ||
description=""" | ||
Title of the map/cog. | ||
""", | ||
) | ||
year: Optional[int] = Field( | ||
..., | ||
description=""" | ||
Year the map was made. i.e. 2012 | ||
""", | ||
) | ||
crs: Optional[str] = Field( | ||
..., | ||
description=""" | ||
CRS of the map. i.e. "EPSG:4267" | ||
""", | ||
) | ||
authors: Optional[List[str]] = Field( | ||
..., | ||
description=""" | ||
Authors of the map | ||
""", | ||
) | ||
organization: Optional[str] = Field( | ||
..., | ||
description=""" | ||
Organization that created the map | ||
""", | ||
) | ||
scale: Optional[int] = Field( | ||
..., | ||
description=""" | ||
Scale of the map. 24000 would be equivalent to 1:24000 | ||
""", | ||
) | ||
quadrangle_name: Optional[str] = Field( | ||
..., | ||
description=""" | ||
If map is based on a quadrangle location we can save the name here. | ||
""", | ||
) | ||
map_shape: Optional[MapShapeTypes] = Field( | ||
..., | ||
description=""" | ||
If the map area(s) has a rectangle shape. | ||
""", | ||
) | ||
map_color_scheme: Optional[MapColorSchemeTypes] | ||
publisher: Optional[str] | ||
state: Optional[str] | ||
|
||
model: str | ||
model_version: str | ||
|
||
model_config = ConfigDict(protected_namespaces=()) | ||
|
||
|
||
class CogMetaData(BaseModel): | ||
cog_id: str | ||
system: str | ||
system_version: str | ||
multiple_maps: Optional[bool] | ||
map_metadata: Optional[List[MapMetaData]] |