Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix zonal statistics does not correctly handle coordinate transforms
Fixes #26858
- Loading branch information
1 parent
607b44b
commit 3e5f9ef
Showing
5 changed files
with
67 additions
and
2 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
python/plugins/processing/tests/testdata/custom/dem_zones.geojson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"name": "dem_zones", | ||
"features": [ | ||
{ "type": "Feature", "properties": { "zone": "zone 1" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 18.670940771920002, 45.789720648616203 ], [ 18.670601888719101, 45.7786128103632 ], [ 18.680241233101299, 45.778386888229299 ], [ 18.680580116302298, 45.790134839195098 ], [ 18.670940771920002, 45.789720648616203 ] ] ] } }, | ||
{ "type": "Feature", "properties": { "zone": "zone 2" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 18.696733548880299, 45.804631509457501 ], [ 18.6881861614789, 45.8046691631464 ], [ 18.6969218173253, 45.787687349410596 ], [ 18.696733548880299, 45.804631509457501 ] ] ] } }, | ||
{ "type": "Feature", "properties": { "zone": "zone 3" }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 18.688731551630401, 45.791979281616896 ], [ 18.688842747680699, 45.791921624405603 ], [ 18.6888309809029, 45.791878087327703 ], [ 18.6887509668137, 45.791858672144301 ], [ 18.688731551630401, 45.791979281616896 ] ] ] } } | ||
] | ||
} |
10 changes: 10 additions & 0 deletions
10
python/plugins/processing/tests/testdata/expected/zonal_stats_crs.geojson
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"type": "FeatureCollection", | ||
"name": "zonal_stats_crs", | ||
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } }, | ||
"features": [ | ||
{ "type": "Feature", "properties": { "zone": "zone 1", "_count": 11016.0, "_sum": 1717611.2636108398, "_mean": 155.91968623918299 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 18.670940771920002, 45.789720648616203 ], [ 18.670601888719101, 45.7786128103632 ], [ 18.680241233101299, 45.778386888229299 ], [ 18.680580116302298, 45.790134839195098 ], [ 18.670940771920002, 45.789720648616203 ] ] ] } }, | ||
{ "type": "Feature", "properties": { "zone": "zone 2", "_count": 7239.0, "_sum": 1348285.545715332, "_mean": 186.25301087378534 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 18.696733548880299, 45.804631509457501 ], [ 18.6881861614789, 45.8046691631464 ], [ 18.6969218173253, 45.787687349410596 ], [ 18.696733548880299, 45.804631509457501 ] ] ] } }, | ||
{ "type": "Feature", "properties": { "zone": "zone 3", "_count": 0.77731787596712487, "_sum": 128.34554148638338, "_mean": 165.11332809206039 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ 18.688731551630401, 45.791979281616896 ], [ 18.688842747680699, 45.791921624405603 ], [ 18.6888309809029, 45.791878087327703 ], [ 18.6887509668137, 45.791858672144301 ], [ 18.688731551630401, 45.791979281616896 ] ] ] } } | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters