我们应该如何在Mapbox GL JS上显示Geopackage?
我们使用 wgrib2 将天气雷达数据转换为 NetCDF 格式。我们使用 gdal_translate 将其转换为 GeoPackage 格式。我们在 QGIS 3.10 上创建了一个彩色地图,GeoPackage 按预期出现。
我们希望使用这些文件或这些文件的处理版本在互联网上显示此内容。我们有 Mapbox GL JS 作为候选,但这不是必需的。我们还没有找到显示我们生成的 gpkg 文件的方法。我们怎样才能让它显示出来呢?
https://docs.mapbox.com/mapbox-gl-js/guides/< /a>
我们使用 gdaldem color-relief 生成 png 图像,我们还尝试了以下方法 然而,当我们用这种方法放大地图时,图像质量比较粗糙,无法美观地显示。
https://docs.mapbox.com/mapbox -gl-js/example/image-on-a-map/
由于我们生成的 gpkg 在 QGIS 中正确显示,因此最希望能够显示MapBox 上的 gpkg。但是,如果这是不可能的,我们希望以精美的方式显示该数据,即使以其他格式也是如此。
我们还尝试使用 gdal2tiles.py 生成图块。当我们创建缩放级别为 10 的数据时,它按我们的预期工作。但是,当我们创建缩放级别为 11 的数据时,它花费了超过 12 分钟。由于我们的数据每 5 分钟生成一次,因此我们不能再花更多的时间在图块生成上。
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.
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/
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Mapbox GL JS 专门用于显示矢量切片,但也可以显示栅格切片。如果您无法从 GeoPackage 数据源生成静态栅格切片(因为它们太大且变化太快),则您将需要某种可以读取 GeoPackage 并按需提供栅格切片的服务器。
运行 GeoServer 是实现这一目标的一种方法。它本身支持 GeoPackage,并且可以提供所请求的图块,而无需提前生成所有图块。
还有一个 NetCDF 扩展 可能会让您跳过 GeoPackage 转换步骤。
(您尝试的是生成单个光栅图像,该图像可能不够详细,无法满足您的需求)。
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).