Skip to content

Commit

Permalink
feat: update for raster data store
Browse files Browse the repository at this point in the history
  • Loading branch information
MDavidson17 committed Mar 14, 2023
1 parent c58ce39 commit 55d4abb
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions tools/generate-argo-cli-commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,25 @@ def _format_date(date: str) -> str:
def _validate_licensor(licensor: str) -> Optional[str]:
if licensor in LICENSORS:
return licensor
elif licensor == "BOPLASS Limited":
if licensor == "BOPLASS Limited":
return "BOPLASS"
elif licensor == "Kapiti Coast District Council" or licensor == "Kapiti District Council":
if licensor == "Kapiti Coast District Council" or licensor == "Kapiti District Council":
return "Kāpiti Coast District Council"
elif licensor == "The Canterbury Aerial Imagery (CAI) Consortium":
if licensor == "The Canterbury Aerial Imagery (CAI) Consortium":
return "Canterbury Aerial Imagery Consortium (CAI)"
elif licensor == "Hawke's Bay Local Authority Shared Services (HBLASS)":
if licensor == "Hawke's Bay Local Authority Shared Services (HBLASS)":
return "Hawke's Bay Local Authority Shared Services (HB LASS)"
elif licensor == "Central Hawkes Bay District Council":
if licensor == "Central Hawkes Bay District Council":
return "Central Hawke's Bay District Council"
elif licensor == "Thames Coromandel District Council":
if licensor == "Thames Coromandel District Council":
return "Thames-Coromandel District Council"
elif licensor == "Waikato Regional Aerial Photography Service (WRAPS) 2017-2019":
if licensor == "Waikato Regional Aerial Photography Service (WRAPS) 2017-2019":
return "Waikato Regional Aerial Photography Service (WRAPS)"
elif licensor == "Northland Aerial Imagery Consortium (NAIC)":
if licensor == "Northland Aerial Imagery Consortium (NAIC)":
return "Northland Aerial Imagery Consortium (NAIC)"
elif " and " in licensor:
if licensor == "AAM NZ Limited":
return "AAM NZ"
if " and " in licensor:
return licensor.replace(" and ", ";")
return None

Expand Down Expand Up @@ -157,6 +159,7 @@ def main() -> None:
continue

file_name = row[ind_target].rstrip("/rgb/2193/").split("/")[-1]
formatted_file_name = file_name.replace("_", "-").replace(".", "-")

if row[ind_basemaps] == "":
get_log().info(
Expand All @@ -173,11 +176,11 @@ def main() -> None:
"create-pull-request": "true"
}
params = {**params, **bm_params}
spi_list.append(command.format(file_name, file_name.replace("_", "-").replace(".", "-")))
spi_list.append(command.format(formatted_file_name, formatted_file_name))
else:
sp_list.append(command.format(file_name, file_name.replace("_", "-").replace(".", "-")))
sp_list.append(command.format(formatted_file_name, formatted_file_name))

with open(f"./{file_name}.yaml", "w", encoding="utf-8") as output:
with open(f"./{formatted_file_name}.yaml", "w", encoding="utf-8") as output:
yaml.dump(
params,
output,
Expand Down

0 comments on commit 55d4abb

Please sign in to comment.