How should we display GeoPackage on Mapbox GL JS?

515 Views Asked by At

We used wgrib2 to convert weather radar data into NetCDF format. We converted it to GeoPackage format using gdal_translate. We created a Color Map on QGIS 3.10 and the GeoPackage appeared as expected.

enter image description here

We would like to display this on the Internet using these files or processed versions of these files. We have Mapbox GL JS as a candidate for that but it is not required. We have not found a way to display the gpkg files we have generated. How can we get it to display?

https://docs.mapbox.com/mapbox-gl-js/guides/

We generated png images using gdaldem color-relief and we also tried the following method However, when we zoomed in on the map with this method, the quality of the image was rough and it could not be displayed beautifully.

https://docs.mapbox.com/mapbox-gl-js/example/image-on-a-map/

enter image description here

Since the gpkg we generated displays correctly in QGIS, it would be most desirable to be able to display the gpkg on MapBox. However, if that is not possible, we would like to display that data beautifully, even in another format.

We also tried to generate tiles using gdal2tiles.py. It worked as we expected when we created data up to zoom level 10. However, when we created the data for zoom level 11, it took more than 12 minutes. Since our data is generated every 5 minutes, we cannot spend any more time on tile generation.

1

There are 1 best solutions below

7
On

Mapbox GL JS specialises in displaying vector tiles, but can also display raster tiles. If you can't generate static raster tiles from your GeoPackage data source (because they're too big and change too fast), you'll need some kind of server that can read GeoPackage and serve up raster tiles on demand.

Running GeoServer would be one way to do that. It supports GeoPackage natively and could serve up the requested tiles without having to generate them all in advance.

There is also a NetCDF extension that might let you skip the GeoPackage conversion step.

(What you tried was generating a single raster image, which was probably insufficiently detailed for your needs).