Skip to content

Commit

Permalink
feat: add published-path parameter to the standardise_validate script
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfouquet committed Oct 28, 2024
1 parent 8abd002 commit 11f0a49
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/standardise_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ def parse_args() -> argparse.Namespace:
parser.add_argument(
"--from-file", dest="from_file", required=True, help="The path to a json file containing the input tiffs"
)
parser.add_argument(
"--published-path",
dest="published_path",
help=("The path of the published dataset. Example: 's3://nz-imagery/wellington/porirua_2024_0.1m/rgb/2193/'"),
required=False,
)
parser.add_argument("--source-epsg", dest="source_epsg", required=True, help="The EPSG code of the source imagery")
parser.add_argument(
"--target-epsg",
Expand Down Expand Up @@ -155,6 +161,7 @@ def main() -> None:
arguments.current_datetime,
file.get_gdalinfo(),
file.get_derived_from_paths(),
arguments.published_path,
)
write(stac_item_path, dict_to_json_bytes(item.stac), content_type=ContentType.GEOJSON.value)
get_log().info("stac_saved", path=stac_item_path)
Expand Down
17 changes: 17 additions & 0 deletions scripts/tests/data/BQ25_10000_0305.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "Feature",
"id": "BQ25_10000_0305",
"assets": {
"visual": {
"href": "./BQ25_10000_0305.tiff",
"type": "image/tiff; application=geotiff; profile=cloud-optimized",
"file:checksum": "12205f300ac3bd1d289da1517144d4851050e544c43c58c23ccfcc1f6968f764a45a",
"created": "2024-10-01T10:31:00Z",
"updated": "2024-10-01T10:31:00Z"
}
},
"properties": {
"created": "2024-10-01T10:31:00Z",
"updated": "2024-10-01T10:31:00Z"
}
}
1 change: 1 addition & 0 deletions scripts/tests/data/output/BQ25_10000_0305.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type": "Feature", "stac_version": "1.0.0", "id": "BQ25_10000_0305", "links": [{"href": "./BQ25_10000_0305.json", "rel": "self", "type": "application/geo+json"}, {"href": "./collection.json", "rel": "collection", "type": "application/json"}, {"href": "./collection.json", "rel": "parent", "type": "application/json"}], "assets": {"visual": {"href": "/tmp/BQ25_10000_0305.tiff", "file:checksum": "1220a2fb26080135bb39515795a61046db5155ffecf74901a1ac544a983839ae6b86", "created": "2024-10-01T10:31:00Z", "updated": "2024-10-28T21:42:00Z", "type": "image/tiff; application=geotiff; profile=cloud-optimized"}}, "stac_extensions": ["https://stac-extensions.github.io/file/v2.0.0/schema.json", "https://stac-extensions.github.io/processing/v1.2.0/schema.json"], "properties": {"created": "2024-10-01T10:31:00Z", "updated": "2025-01-03T08:24:00Z", "processing:datetime": "2025-01-03T08:24:00Z", "processing:software": {"gdal": "GDAL 3.9.0, released 2024/05/07", "linz/topo-imagery": "https://github.com/linz/topo-imagery/commit/"}, "processing:version": "", "start_datetime": "2022-12-31T11:00:00Z", "end_datetime": "2022-12-31T11:00:00Z", "datetime": null}, "geometry": {"type": "Polygon", "coordinates": [[[173.0860059, -41.3030235], [173.0860913, -41.367879], [173.1434853, -41.3678217], [173.143343, -41.3029664], [173.0860059, -41.3030235]]]}, "bbox": [173.0860059, -41.367879, 173.1434853, -41.3029664], "collection": "123"}
6 changes: 6 additions & 0 deletions scripts/tests/data/resupply.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"output": "BQ25_10000_0305",
"input": ["./tests/data/BQ25_10000_0305.tiff"]
}
]

0 comments on commit 11f0a49

Please sign in to comment.