I want to filter a large, national exposure dataset by the extents of regional hazard rasters, so that RiskScape doesn’t check the exposure layer on one side of the country when the hazard is at the other end. What would be the most efficient way to do that?
It depends somewhat on what your model is doing. RiskScape is generally pretty quick at checking if a given point is within a GeoTIFF’s bounds or not. However, if you’re dealing with large exposure features like linestring or polygon geometry, it becomes a lot more work.
Generally you’ll want to take the bounds of the GeoTIFF and check the exposure falls within those bounds. You can get the bounds with:
bounds(bookmark('region-specific.tif'))
If both features are in the same CRS, you can check for an intersection (true/false) with:
This works best as the ‘on’ condition in a join step. However, if the layers are in different CRSs then you’ll have to reproject the geometry first.
If you have a large CSV full of GeoTIFFs then you can turn the bounds of all the GeoTIFFs into a coverage lookup, and then sample that to find matching regions/GeoTIFFs.