generated from linz/template-python-hello-world
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: generate title & description from inputs * test: autogenerate title & description tests * fix: sort imports * fix: mypy & pylint * fix: don't allow/account for empty string * test: test for no empty strings j * fix: fix broken test * fix: lifecycle should never be none * fix: add choices to parameters * fix: name variable datetime only when is a datetime type * fix: add example for Historical Imagery Survey Number * fix: required field doesn't need default * fix: add nullable_str to argparse type remove now unecessary code * fix: make subtypes enums * fix: don't need to set to None * fix: Improved way of managing event and ending with a . * fix: remove unused param * fix: tidy choices enum listing * fix: gsd cannot be none * fix: str='' is the same as str=None * fix: typo * fix: use enum dictionary to map regions * fix: update tests * fix: nit * fix: list enums correctly * fix: args copy paste error * fix: rename subtype -> category to match metadata name and basemaps * fix: use kwargs to resolve too many args * fix: add pseudo * to make params keyword args * refactor: subtype -> category * refactor: parameters and relocate * fix: formatting * Update scripts/stac/imagery/metadata_constants.py Co-authored-by: Alice Fage <[email protected]> * fix: merge conflict --------- Co-authored-by: Alice Fage <[email protected]>
- Loading branch information
1 parent
4e84901
commit dd3e282
Showing
7 changed files
with
531 additions
and
54 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,69 @@ | ||
from datetime import datetime | ||
from enum import Enum | ||
from typing import Optional, TypedDict | ||
|
||
|
||
class CollectionTitleMetadata(TypedDict): | ||
""" | ||
region: Region of Dataset | ||
gsd: Dataset Ground Sample Distance | ||
start_date: Dataset capture start date | ||
end_date: Dataset capture end date | ||
lifecycle: Dataset status | ||
Optional: | ||
location: Optional location of dataset, e.g. Hutt City | ||
event: Optional details of capture event, e.g. Cyclone Gabrielle | ||
historic_survey_number: Optional historic imagery survey number, e.g. SNC88445 | ||
""" | ||
|
||
category: str | ||
region: str | ||
gsd: str | ||
start_datetime: datetime | ||
end_datetime: datetime | ||
lifecycle: str | ||
location: Optional[str] | ||
event: Optional[str] | ||
historic_survey_number: Optional[str] | ||
|
||
|
||
class SubtypeParameterError(Exception): | ||
def __init__(self, category: str) -> None: | ||
self.message = f"Unrecognised/Unimplemented Subtype Parameter: {category}" | ||
|
||
|
||
class ImageryCategories(str, Enum): | ||
SATELLITE = "Satellite Imagery" | ||
URBAN = "Urban Aerial Photos" | ||
RURAL = "Rural Aerial Photos" | ||
AERIAL = "Aerial Photos" | ||
HISTORICAL = "Scanned Aerial Photos" | ||
|
||
|
||
class ElevationCategories(str, Enum): | ||
DEM = "DEM" | ||
DSM = "DSM" | ||
|
||
|
||
HUMAN_READABLE_REGIONS = { | ||
"antarctica": "Antarctica", | ||
"auckland": "Auckland", | ||
"bay-of-plenty": "Bay of Plenty", | ||
"canterbury": "Canterbury", | ||
"gisborne": "Gisborne", | ||
"global": "Global", | ||
"hawkes-bay": "Hawke's Bay", | ||
"manawatu-whanganui": "Manawatū-Whanganui", | ||
"marlborough": "Marlborough", | ||
"nelson": "Nelson", | ||
"new-zealand": "New Zealand", | ||
"northland": "Northland", | ||
"otago": "Otago", | ||
"pacific-islands": "Pacific Islands", | ||
"southland": "Southland", | ||
"taranaki": "Taranaki", | ||
"tasman": "Tasman", | ||
"waikato": "Waikato", | ||
"wellington": "Wellington", | ||
"west-coast": "West Coast", | ||
} |
Oops, something went wrong.