Skip to content

Commit

Permalink
added test case for New Zealand Land+EEZ intersecting habitat
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielJDufour committed Sep 30, 2023
1 parent 7e4ce2d commit 6e3bd32
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
4 changes: 3 additions & 1 deletion data/create_expected_truth_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
["./antimeridian/right-edge.shp", "gfwfiji_6933_COG.tiff"],
["./antimeridian/right-edge.shp", "gfwfiji_6933_COG.tiff", { "boundless": False, "nodata": -9999 }],
["./antimeridian/split.shp", "gfwfiji_6933_COG_Binary.tif"],
["./antimeridian/across.shp", "gfwfiji_6933_COG_Binary.tif"]
["./antimeridian/across.shp", "gfwfiji_6933_COG_Binary.tif"],

["./geojson-test-data/EEZ_Land_v3_202030_New_Zealand.geojson", "./geotiff-test-data/nz_habitat_anticross_4326_1deg.tif"]
]

for i, (geom, raster, *opts) in enumerate(test_cases):
Expand Down
12 changes: 12 additions & 0 deletions data/expected_data.txt
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,17 @@ case: 13
sum: 29,211,252.0


case: 14
vector: ./geojson-test-data/EEZ_Land_v3_202030_New_Zealand.geojson
raster: ./geotiff-test-data/nz_habitat_anticross_4326_1deg.tif
opts: []
result:
count: 454
min: 1.0
max: 71.0
sum: 4,512.0


sum
test.tiff
108343045.40000004
Expand All @@ -168,6 +179,7 @@ Cyprus: 790,242.0625
Jamaica: 2,332,581.75
Lebanon: 5,554,060.0
Macedonia: 2,239,499.25
New Zealand: 0.0
Nicaragua: 5,066,313.5
Ukraine: 12,697,956.0
Uruguay: 3,303,090.0
1 change: 1 addition & 0 deletions data/gadm/extract_countries.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const countries_to_extract = new Set([
"Nicaragua",
"Lebanon",
"Macedonia",
"New Zealand",
"Uruguay",
"Ukraine"
]);
Expand Down
7 changes: 7 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ bash setup.sh
cd ..
echo "---------- Finished Setting up GeoTIFF Data ----------"

# setup test-data
echo "---------- Setting up GeoJSON Test Data ----------"
cd geojson-test-data
bash setup.sh
cd ..
echo "---------- Finished Setting up GeoJSON Data ----------"

# setup gadm
echo "---------- Setting up GADM Data ----------"
cd gadm
Expand Down

0 comments on commit 6e3bd32

Please sign in to comment.