georaster-layer-for-leaflet icon indicating copy to clipboard operation
georaster-layer-for-leaflet copied to clipboard

Add GeoJSON Mask Option

Open DanielJDufour opened this issue 4 years ago • 6 comments

new GeoRasterLayer({
    georaster,
    bounds: geojson
})

This would mean only display within the bounds.

DanielJDufour avatar Apr 17 '20 00:04 DanielJDufour

Might be more intuitive to say:

new GeoRasterLayer({
    georaster,
    mask: geojson
})

DanielJDufour avatar Jul 04 '21 20:07 DanielJDufour

@m-mohr

DanielJDufour avatar Jul 23 '21 14:07 DanielJDufour

How much effort would this be?

m-mohr avatar Aug 13 '21 09:08 m-mohr

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 Screenshot

.

prakashmani2495 avatar Feb 20 '22 16:02 prakashmani2495

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! :-)

DanielJDufour avatar Feb 20 '22 17:02 DanielJDufour

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.

prakashmani2495 avatar Feb 21 '22 02:02 prakashmani2495

This was completed. You can find the documentation here: https://github.com/GeoTIFF/georaster-layer-for-leaflet/blob/master/ADVANCED.md#masking

DanielJDufour avatar Aug 26 '22 08:08 DanielJDufour