GeoTIFF / georaster-layer-for-leaflet

Display GeoTIFFs and soon other types of raster on your Leaflet Map
https://geotiff.github.io/georaster-layer-for-leaflet-example/
Apache License 2.0
300 stars 58 forks source link

Support Cloud Optimized GeoTIFFs #10

Closed DanielJDufour closed 5 years ago

DanielJDufour commented 5 years ago

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] Users want to display large COGs, but don't want to have to download the whole thing in order to visualize it.

Describe the solution you'd like A clear and concise description of what you want to happen. 1) Add COG support to https://github.com/GeoTIFF/georaster by using https://github.com/geotiffjs/geotiff.js (This is being tracked in a separate issue here) 2) Use new version of georaster developed in (1) and update code in georaster-layer-for-leaflet.js to dynamically get values from GeoRaster rather than getting them all when layer is initialized

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered. Not sure, but open to solutions :-)

Additional context Add any other context or screenshots about the feature request here.

DanielJDufour commented 5 years ago

@mhiley

mhiley commented 5 years ago

@DanielJDufour When we were working on COG support PR's back in January, I think one question that came up is "how do we know raster min/max to determine a color scale range, if we can't read the entire raster?". I think this STAC extension might be useful in thinking about that problem:

https://github.com/radiantearth/stac-spec/pull/470

DanielJDufour commented 5 years ago

Awesome! Thanks for sharing!

m-mohr commented 5 years ago

How does https://github.com/cholmes/cog-map make it for OpenLayers? It would be really helpful to get COG support for Leaflet soon. I'm STAC contributor and can help out with an STAC extension...

DanielJDufour commented 5 years ago

@m-mohr , I think cog-map is using a Lambda process to tile the imagery and isn't doing it completely client side. Theoretically we should be able to do it all client-side.

COG support for georaster-layer-for-leaflet is nearly complete, but I haven't had the bandwidth to take it over the goal line. Current issue is that Leaflet's awesome Grid Layer provides multiple grid cells by default, but this leads to too many network request to read the remote COG. Perhaps, by increasing the tile for each grid cell in leaflet would help?

Definitely, open to help and pull requests!

Here's a link to the relevant code: https://github.com/GeoTIFF/georaster-layer-for-leaflet/blob/master/georaster-layer-for-leaflet.js#L190

DanielJDufour commented 5 years ago

Also, thank you for all your work on STAC and pushing that forward!!!! I'd love to be more involved, but unfortunately haven't found the time.

m-mohr commented 5 years ago

Oh, yes, going through cog-map sources I see that it uses the Radiant.Earth API for the COGs. Yeah, more looking for a client-side version, too. Unfortunately, client-side seems to be a bit flaky with geotiff.js, e.g. UTM support isn't there yet?!

PS: There's probably a STAC sprint later this year in the Washington, DC area. Maybe a good opportunity to get involved. ;-)

DanielJDufour commented 5 years ago

AFAIK, geotiff.js and georaster-layer-for-leaflet support UTM. Here's some of the relevant code in this lib: https://github.com/GeoTIFF/georaster-layer-for-leaflet/blob/master/georaster-layer-for-leaflet.js#L306. I know I've tested it on at least one UTM NDVI raster and it worked, but I haven't tested UTM support comprehensively.

Do you have a UTM geotiff that isn't working?

Yeah. Would be great to participate in a STAC sprint!

CarlQLange commented 5 years ago

COG support for georaster-layer-for-leaflet is nearly complete, but I haven't had the bandwidth to take it over the goal line. Current issue is that Leaflet's awesome Grid Layer provides multiple grid cells by default, but this leads to too many network request to read the remote COG. Perhaps, by increasing the tile for each grid cell in leaflet would help?

Hey, do you have a test case for this to help me (or another interested party) to check out the issue? Thanks for all your great work!

DanielJDufour commented 5 years ago

I'm closing this issue now as basic support for COGs has been added. A lot more stuff to do though, like stitching together COGs client side when each band is stored in a different cog like Landsat does.