0

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.

Ganessa
  • 782
  • 2
  • 7
  • 24

1 Answers1

0

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).

Steve Bennett
  • 114,604
  • 39
  • 168
  • 219
  • Thanks Steve, we generated MVT vector tiles from the same data but that was too time consuming. We tried PNG raster tiles this time, but that was also too time consuming. This data is generated every 5 minutes, so we can't spend more than 5 minutes generating tiles. We were able to convert a NetCDF file to a GeoPackage file in seconds and it was a lightweight file, less than 1 MB. And it scaled beautifully in QGIS with ease. This is what we want, and we want to display it on the web, not in QGIS. We didn't know about GeoServer so we will look into it. – Ganessa Apr 01 '22 at 00:13
  • Yep. The web is not the desktop. You will have to think differently about architecture and data transfer. – Steve Bennett Apr 01 '22 at 06:08
  • Since you recommended GeoServer to me, you probably know a lot about GeoServer. We installed GeoServer on EC2 but we don't understand how to use it. In this case we just want to create tiles from GeoPackage. What must we do in this case? We placed the gpkg file under the data folder, created a workspace, and then selected GeoPackage under Vector Data Source in Stores and specified the gpkg file. What SQL should we specify here? We know that the gpkg file is SQLite and that there are tables in the file. Perhaps we should specify SQL for this. – Ganessa Apr 01 '22 at 09:18
  • You can ask questions about geoserver on gis.stackexchange.com – Steve Bennett Apr 02 '22 at 08:27
  • Thank you. We will continue to inquire there. https://gis.stackexchange.com/questions/427826/how-should-we-display-geopackage-on-mapbox-gl-js – Ganessa Apr 03 '22 at 06:34
  • Also, small nitpick, but I didn't "recommend" GeoServer. I suggested it as a possible solution to your issue. There may be other and better solutions. – Steve Bennett Apr 03 '22 at 21:51
  • Steve, I really appreciate your tips. I see. I am not a native English speaker and I don't really understand the difference between recommend and suggested. I don't care what the difference is between recommend and suggested as long as what I want can be achieved. I would want a way to realize it more than that comment. Since you seem so knowledgeable about GeoServer, I'd be glad to know how to solve our problem rather than the difference between recommending and suggested! – Ganessa Apr 04 '22 at 02:50