georaster-layer-for-leaflet
georaster-layer-for-leaflet copied to clipboard
Add GeoJSON Mask Option
new GeoRasterLayer({
georaster,
bounds: geojson
})
This would mean only display within the bounds.
Might be more intuitive to say:
new GeoRasterLayer({
georaster,
mask: geojson
})
@m-mohr
How much effort would this be?
Hi,
You did a excellent work which saved me a lot to work on georaster files.
Can you please help, how to remove the excess layer (outside the polygon), I want the clip/mask the georaster layer with polygon on leaflet and here I'm using 4326 projection. Here I'm attaching the screen shot for reference
.
Hi, @prakashmani2495. Thanks for helping validate this important use case. You can't clip/mask with GeoRasterLayer yet, but it's a high priority to me to get this done. I've been working on some of the dependencies for this task, which you can view here: https://observablehq.com/@danieljdufour/clip-and-reproject-a-geotiff-with-geowarp.
Unfortunately, it'll probably take a few days of concerted effort to get this done. I should have time in a couple months when my schedule lightens a little.
In the interim, you could try cropping your GeoTIFF before visualization using gdalwarp's cutline functionality.
Let me know if you have any more questions. Happy to answer and sorry for the delay. I too want this feature very much! :-)
Hi Daniel,
Thank you for the quick response. Will try using gdalwarp's cutline functionality. Please make this a priority item, since I wanted this feature urgently.
This was completed. You can find the documentation here: https://github.com/GeoTIFF/georaster-layer-for-leaflet/blob/master/ADVANCED.md#masking