inbo / niche_vlaanderen

Python package to run the NICHE Vlaanderen model
https://inbo.github.io/niche_vlaanderen/
MIT License
5 stars 0 forks source link

Validation: what happens when extent shp is larger than raster #307

Closed cecileherr closed 1 year ago

cecileherr commented 1 year ago

niche_vlaanderen version: dev 1.1 Python version: 3 Operating System: Win

I tested the validation module with a vegetation shapefile (bwk) with a (slightly) larger extent than the input rasters of the model and I think there might be a problem in this case.

Could you check these points please?

Example based on Brasschaat + shp in attachment (you will need to change the paths for the bwk though) bwk_fake_brasschaat.zip

simplebr = nv.Niche()
simplebr.run_config_file(path_nv + "tests/data/bwk/niche_brasschaat/simple.yaml")

from niche_vlaanderen.bwk_overlay import NicheOverlay

# with extent = same as rasters
no_simplebr_fkok = NicheOverlay(niche=simplebr, map= path_ch + "testcase_extra/brasschaat/bwk/bwk_fake_extentok.shp")
no_simplebr_fkok.overlay()

no_simplebr_fkok.summary

# with extent = larger than rasters
no_simplebr_fkl = NicheOverlay(niche=simplebr, map= path_ch + "testcase_extra/brasschaat/bwk/bwk_fake_extentlarger.shp")
no_simplebr_fkl.overlay()

no_simplebr_fkl.summary
johanvdw commented 1 year ago

image

In this case: the second polygon (half covering the niche model): the area of the polygon is 600 ha, but the overlap with the map is only 70% so the area used for area_effective should be reduced. In the last polygon (outside the niche domain) effective area should become 0.

cecileherr commented 1 year ago

just as a reference in the future: this a better version of test shapefiles bwk_fake_extentok_mini.zip