Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: round footprints to 8 decimal places TDE-1237 #1088

Merged
merged 7 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/format-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ jobs:
docker run -v "${{ runner.temp }}:/tmp/" topo-imagery python3 standardise_validate.py --from-file ./tests/data/aerial.json --preset webp --target-epsg 2193 --source-epsg 2193 --target /tmp/cutline/ --collection-id 123 --start-datetime 2023-01-01 --end-datetime 2023-01-01 --cutline ./tests/data/cutline_aerial.fgb --gsd 10m --create-footprints=true
cmp --silent "${{ runner.temp }}/cutline/BG35_1000_4829.tiff" ./scripts/tests/data/output/BG35_1000_4829_cut.tiff

- name: End to end test - Footprint
run: |
docker run -v "${{ runner.temp }}:/tmp/" topo-imagery python3 standardise_validate.py --from-file ./tests/data/aerial.json --preset webp --target-epsg 2193 --source-epsg 2193 --target /tmp/ --collection-id 123 --start-datetime 2023-01-01 --end-datetime 2023-01-01 --gsd 10m --create-footprints=true
jq 'select(.xy_coordinate_resolution == 1E-8) // error("Wrong or missing X/Y coordinate resolution")' "${{ runner.temp }}/BG35_1000_4829_footprint.geojson"
blacha marked this conversation as resolved.
Show resolved Hide resolved
cmp --silent <(jq "del(.features[0].properties.location, .xy_coordinate_resolution)" "${{ runner.temp }}/BG35_1000_4829_footprint.geojson") <(jq "del(.features[0].properties.location, .xy_coordinate_resolution)" ./scripts/tests/data/output/BG35_1000_4829_footprint.geojson)

- name: End to end test - Thumbnails (Topo50/Topo250)
run: |
docker run -v "${{ runner.temp }}:/tmp/" topo-imagery python3 thumbnails.py --from-file ./tests/data/thumbnails.json --target /tmp/
Expand Down
3 changes: 3 additions & 0 deletions scripts/standardising.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ def standardising(
f"EPSG:{EpsgNumber.WGS_1984.value}",
"-max_points",
"unlimited",
# Round to 8 decimal places to reduce unnecessary complexity
"-lco",
"COORDINATE_PRECISION=8",
"-simplify",
str(get_buffer_distance(gsd_to_float(gsd))),
],
Expand Down
31 changes: 31 additions & 0 deletions scripts/tests/data/output/BG35_1000_4829_footprint.geojson
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"type": "FeatureCollection",
"name": "footprint",
"crs": {
"type": "name",
"properties": {
"name": "urn:ogc:def:crs:OGC:1.3:CRS84"
}
},
"xy_coordinate_resolution": 1e-8,
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[
[
[175.78216634, -38.85027165],
[175.78241902, -38.85675232],
[175.78794458, -38.85662046],
[175.7876914, -38.85013982],
[175.78216634, -38.85027165]
]
]
]
}
}
]
}
Loading