Skip to content

Commit

Permalink
Add tests for filter_bbox, filter_spatial and mask_polygon
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Jan 3, 2024
1 parent 8513cd3 commit bac7055
Show file tree
Hide file tree
Showing 9 changed files with 1,452 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ This folder contains test cases for the openEO processes.
- [x] exp
- [x] extrema
- [x] filter_bands*
- [ ] filter_bbox*
- [ ] filter_spatial*
- [x] filter_bbox*
- [x] filter_spatial*
- [x] filter_temporal*
- [x] first
- [x] floor
Expand All @@ -77,7 +77,7 @@ This folder contains test cases for the openEO processes.
- [x] lt
- [x] lte
- [x] mask*
- [ ] mask_polygon*
- [x] mask_polygon*
- [x] max
- [x] mean
- [x] median
Expand All @@ -99,7 +99,6 @@ This folder contains test cases for the openEO processes.
- [x] reduce_dimension*
- [x] rename_dimension
- [x] rename_labels
- [ ] resample_spatial*
- [x] round
- [x] sd
- [x] sgn
Expand Down Expand Up @@ -140,6 +139,7 @@ We don't expect that we can provide meaningful test cases for these processes.
- load_uploaded_files (experimental)
- load_url (experimental)
- predict_curve (experimental)
- resample_spatial
- run_udf
- run_udf_externally (experimental)
- sar_backscatter (experimental)
Expand Down
50 changes: 50 additions & 0 deletions tests/assets/epsg25832.wkt2
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
PROJCRS["ETRS89 / UTM zone 32N",
BASEGEOGCRS["ETRS89",
ENSEMBLE["European Terrestrial Reference System 1989 ensemble",
MEMBER["European Terrestrial Reference Frame 1989"],
MEMBER["European Terrestrial Reference Frame 1990"],
MEMBER["European Terrestrial Reference Frame 1991"],
MEMBER["European Terrestrial Reference Frame 1992"],
MEMBER["European Terrestrial Reference Frame 1993"],
MEMBER["European Terrestrial Reference Frame 1994"],
MEMBER["European Terrestrial Reference Frame 1996"],
MEMBER["European Terrestrial Reference Frame 1997"],
MEMBER["European Terrestrial Reference Frame 2000"],
MEMBER["European Terrestrial Reference Frame 2005"],
MEMBER["European Terrestrial Reference Frame 2014"],
ELLIPSOID["GRS 1980",6378137,298.257222101,
LENGTHUNIT["metre",1]],
ENSEMBLEACCURACY[0.1]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
ID["EPSG",4258]],
CONVERSION["UTM zone 32N",
METHOD["Transverse Mercator",
ID["EPSG",9807]],
PARAMETER["Latitude of natural origin",0,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8801]],
PARAMETER["Longitude of natural origin",9,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8802]],
PARAMETER["Scale factor at natural origin",0.9996,
SCALEUNIT["unity",1],
ID["EPSG",8805]],
PARAMETER["False easting",500000,
LENGTHUNIT["metre",1],
ID["EPSG",8806]],
PARAMETER["False northing",0,
LENGTHUNIT["metre",1],
ID["EPSG",8807]]],
CS[Cartesian,2],
AXIS["(E)",east,
ORDER[1],
LENGTHUNIT["metre",1]],
AXIS["(N)",north,
ORDER[2],
LENGTHUNIT["metre",1]],
USAGE[
SCOPE["Engineering survey, topographic mapping."],
AREA["Europe between 6°E and 12°E: Austria; Belgium; Denmark - onshore and offshore; Germany - onshore and offshore; Norway including - onshore and offshore; Spain - offshore."],
BBOX[38.76,6,84.33,12.01]],
ID["EPSG",25832]]
157 changes: 157 additions & 0 deletions tests/assets/xytb-s2-small-filtered.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
{
"type": "datacube",
"nodata": NaN,
"order": ["bands", "t", "y", "x"],
"dimensions": {
"bands": {
"type": "bands",
"values": ["blue", "green", "red", "nir"],
},
"t": {
"type": "temporal",
"values": ["2020-06-01T00:00:00Z", "2020-06-03T00:00:00Z", "2020-06-06T00:00:00Z", "2020-06-08T00:00:00Z", "2020-06-11T00:00:00Z", "2020-06-13T00:00:00Z"],
},
"y": {
"type": "spatial",
"axis": "y",
"values": [5757495.0, 5757485.0, 5757475.0],
"reference_system": "EPSG:25832"
},
"x": {
"type": "spatial",
"axis": "x",
"values": [404865.0, 404875.0, 404885.0, 404895.0],
"reference_system": "EPSG:25832"
}
},
"data": [
[
[
[1037.0, 1087.0, 1124.0, 1197.0],
[921.0, 1030.0, 1051.0, 1138.0],
[793.0, 796.0, 795.0, 905.0]
],
[
[2006.0, 2005.0, 2000.0, 2015.0],
[1969.0, 1965.0, 1979.0, 2025.0],
[1950.0, 1963.0, 1988.0, 2021.0]
],
[
[6379.0, 6360.0, 6253.0, 6205.0],
[6261.0, 5995.0, 5545.0, 5389.0],
[6016.0, 5738.0, 5521.0, 5135.0]
],
[
[7246.0, 7317.0, 7301.0, 7279.0],
[7303.0, 7281.0, 7292.0, 7320.0],
[7288.0, 7258.0, 7270.0, 7282.0]
],
[
[1714.0, 1785.0, 1908.0, 1998.0],
[1561.0, 1690.0, 1840.0, 1930.0],
[1523.0, 1646.0, 1757.0, 1789.0]
],
[
[1083.0, 1250.0, 1207.0, 1302.0],
[1006.0, 1114.0, 1102.0, 1227.0],
[962.0, 958.0, 950.0, 1054.0]
]
],
[
[
[971.0, 983.0, 1030.0, 1071.0],
[806.0, 886.0, 850.0, 962.0],
[636.0, 627.0, 591.0, 795.0]
],
[
[1905.0, 1914.0, 1900.0, 1891.0],
[1778.0, 1801.0, 1816.0, 1834.0],
[1772.0, 1764.0, 1765.0, 1811.0]
],
[
[6301.0, 6300.0, 6244.0, 6295.0],
[6162.0, 6154.0, 6128.0, 6053.0],
[5847.0, 5532.0, 5515.0, 5408.0]
],
[
[6802.0, 6809.0, 6799.0, 6767.0],
[6844.0, 6853.0, 6837.0, 6820.0],
[6871.0, 6876.0, 6867.0, 6839.0]
],
[
[1703.0, 1729.0, 1795.0, 1793.0],
[1435.0, 1508.0, 1638.0, 1746.0],
[1329.0, 1466.0, 1576.0, 1645.0]
],
[
[997.0, 1091.0, 1079.0, 1120.0],
[847.0, 935.0, 927.0, 1025.0],
[796.0, 765.0, 765.0, 851.0]
]
],
[
[
[789.0, 911.0, 943.0, 974.0],
[560.0, 726.0, 714.0, 877.0],
[407.0, 452.0, 439.0, 568.0]
],
[
[1947.0, 1890.0, 1848.0, 1828.0],
[1916.0, 1877.0, 1838.0, 1814.0],
[1867.0, 1822.0, 1788.0, 1791.0]
],
[
[6921.0, 7022.0, 7121.0, 7217.0],
[6845.0, 6790.0, 6874.0, 6936.0],
[6706.0, 6719.0, 6627.0, 6561.0]
],
[
[7125.0, 7102.0, 7102.0, 7058.0],
[7113.0, 7099.0, 7116.0, 7092.0],
[7176.0, 7158.0, 7156.0, 7119.0]
],
[
[1759.0, 1888.0, 1824.0, 1704.0],
[1336.0, 1417.0, 1541.0, 1647.0],
[1205.0, 1313.0, 1464.0, 1555.0]
],
[
[727.0, 948.0, 960.0, 1034.0],
[573.0, 726.0, 698.0, 851.0],
[523.0, 513.0, 516.0, 643.0]
]
],
[
[
[2705.0, 2019.0, 1872.0, 1629.0],
[2523.0, 1632.0, 1478.0, 1443.0],
[2458.0, 1504.0, 1206.0, 1287.0]
],
[
[2868.0, 2787.0, 2729.0, 2676.0],
[2908.0, 2782.0, 2691.0, 2662.0],
[2955.0, 2808.0, 2771.0, 2785.0]
],
[
[7451.0, 7567.0, 7565.0, 7595.0],
[7338.0, 7169.0, 7027.0, 6983.0],
[7022.0, 6554.0, 6165.0, 6084.0]
],
[
[7470.0, 7410.0, 7424.0, 7407.0],
[7474.0, 7467.0, 7456.0, 7470.0],
[7487.0, 7485.0, 7487.0, 7515.0]
],
[
[2862.0, 2772.0, 2746.0, 2716.0],
[2788.0, 2613.0, 2631.0, 2723.0],
[2916.0, 2607.0, 2618.0, 2641.0]
],
[
[3151.0, 2241.0, 2058.0, 1645.0],
[2592.0, 1917.0, 1577.0, 1408.0],
[2851.0, 2079.0, 1787.0, 1753.0]
]
]
]
}
Loading

0 comments on commit bac7055

Please sign in to comment.