maplibre / maplibre-native

MapLibre Native - Interactive vector tile maps for iOS, Android and other platforms.
https://maplibre.org
BSD 2-Clause "Simplified" License
1.09k stars 319 forks source link

GeoTIFF support #2930

Open aiqibaobei opened 1 month ago

aiqibaobei commented 1 month ago

Dear MapLibre Development Team,

I hope this message finds you well. I am exploring the capabilities of the MapLibre library and would like to know if it supports loading large GeoTIFF files directly. If this functionality is not natively supported, could you provide guidance on how to implement this using GDAL or other libraries to handle large GeoTIFF files effectively within a MapLibre environment?

Thank you for your assistance!

ntadej commented 1 month ago

I would propose to ask this at the main https://github.com/maplibre/maplibre-native repository as I am not familiar with that functionality specifically.

louwers commented 1 month ago

MapLibre Native supports image sources, maybe that is an option for you.

Right now there is no special support for GeoTIFF as far as I am aware.

aiqibaobei commented 1 month ago

Yes, I have tried to add some small GeoTIFFs using the following code: sources: { "image": { "type": "image", "url": "https://maplibre.org/maplibre-gl-js/docs/assets/radar.gif", "coordinates": [ [-80.425, 46.437], [-71.516, 46.437], [-71.516, 37.936], [-80.425, 37.936] ] } } However, I found that when the TIFF becomes large, loading becomes very sluggish. Perhaps the underlying code is converting it to PNG format. My goal is to use GDAL to dynamically load the original images within a certain range when the map moves or zooms, and to use thumbnails when the camera height is higher, similar to QGIS. It seems that I should customize a source and layer. Do you have any ideas or suggestions? Will your team add similar functionality in the future? It seems that the native library has the potential to load GeoTIFFs.

kebekus commented 1 month ago

@aiqibaobei As far as I understand, loading images is supported, but MapLibre was never designed to handle large images efficiently. However, there is a clean solution for your problem: use MBTiles instead. MBTiles are designed to contain pre-computes graphic assetts for various zoom levels and will be rendered with blazing speed, even on low-end or handheld devices.

aiqibaobei commented 1 month ago

@aiqibaobei As far as I understand, loading images is supported, but MapLibre was never designed to handle large images efficiently. However, there is a clean solution for your problem: use MBTiles instead. MBTiles are designed to contain pre-computes graphic assetts for various zoom levels and will be rendered with blazing speed, even on low-end or handheld devices.

Thank you for the suggestion!