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
306 stars 58 forks source link

Unable to display big Geotiff data #29

Open jcimoch opened 5 years ago

jcimoch commented 5 years ago

Describe the bug When trying to use some GeoTif coming from this site https://www.faa.gov/air_traffic/flight_info/aeronav/digital_products/ifr/ I'm unable to display them in leaflet. Firstly the library is processing the image for few minutes on web worker, then I'm getting info that basically it was processed successfully however layer is empty.

To Reproduce Steps to reproduce the behavior:

  1. Download any geotif from https://www.faa.gov/air_traffic/flight_info/aeronav/digital_products/ifr/
  2. Use example code from readme with this file
  3. After few minutes of processing, there will be nothing to show on the map

Is it connected with the size of the image? I wanted to scaled it down to see if that's the issue, however I don't have a software which preserves embeded tags of geotiff, so after such procedure the format is corrupted (tried gimp/krita/photoshop)

When using some small geotiff like this ones https://github.com/stuartmatthews/stuartmatthews.github.io/tree/master/leaflet-geotiff/tif

everything is working as expected, so I don't think it's something on my side of code

DanielJDufour commented 5 years ago

Hi, @jcimoch . Just wanted to let you know I saw this. I'll try to take a look by Monday. Thanks! Have a nice weekend :-)

jcimoch commented 4 years ago

Hi, thanks, I've also tried it on your app http://app.geotiff.io/load. The same symptoms

jcimoch commented 4 years ago

@DanielJDufour any progress on that?

DanielJDufour commented 4 years ago

Unfortunately, I haven't had much luck. The GeoTIFFs use an afine transformation for each pixel, which georaster doesn't currently support. They also take a large time to decode. I'm going to try and see if I can warp the tiffs to 4326 projection and host one as a cloud optimized geotiff.

jcimoch commented 4 years ago

@DanielJDufour do you think it would be possible to reproject it with this tool https://github.com/mapbox/rasterio/tree/32605d0788421a277384eec9766b52b69375a374 ? Also do you have any tips regarding cloud optimized geotiff? what hosting do you use? some onpremise or cloud?

DanielJDufour commented 4 years ago

You might be able to reproject with Raster IO, but I'm not sure.

I reprojected it with the following command using gdal:

 gdalwarp -t_srs EPSG:4326 ENR_L01.tif -r cubic ENR_L01_4326.tif -co TILED=YES -co COMPRESS=JPEG -co BLOCKXSIZE=32 -co BLOCKYSIZE=32

And then created overviews (like pyramids/sampled views for different zoom levels) with the following:

gdaladdo ENR_L01_4326.tif 2 4 8 16

And uploaded it to Amazon S3.

I created a demo with it here: https://geotiff.github.io/georaster-layer-for-leaflet/tests/ifr.html

And you can view the source code here: https://github.com/GeoTIFF/georaster-layer-for-leaflet/blob/master/tests/ifr.html