-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: provide support for PMTiles format files? #212
Comments
Same case here. I am using pmtiles for dem source. I am interested in use maplibre-contour. Thanks. |
Yep! This is a known limitation of the plugin. I'm working to move this functionality into maplibre so you don't need this plugin anymore: maplibre/maplibre-style-spec#583. Then you'll be able to use the pmtiles plugin for dem tiles that power a built-in contour source you can render line and label layers from. |
While this may take longer than expected, maybe it will be simpler to allow overriding the |
I spent some time yesterday to see if I could add in the pmtiles npm plugin into maplibre-contour and modify its fetchTile to use pmtiles.getZxy(). I am testing with this branch and you can see the changes I have made so far at main...acalcutt:maplibre-contour:pmtiles_test I think I have it at least reading the tiles, because when testing on https://wifidb.net/demo/pmtiles/contour/ I can see it is loading the hillshade , which is coming from the However right now I haven't been able to get the contour part of this working. I can see from the console.log's I added that it is trying to load them. it is getting neighbor tiles, but the isolines seem to be blank at the end. I am wondering if maybe this relates to not specifying a tile type when i convert the pmtiles array buffer to blob....but I am not really sure. I am honestly not the best with typscript or promises so I have been asking google ai a lot of questions just to get this far, so if anyone has any ideas to get get this working I am up for suggestions. The PMtiles support is somewhat based on the work i did in tileserver-gl at https://github.com/maptiler/tileserver-gl/blob/master/src/pmtiles_adapter.js |
Actually it looks like I did get it working. It was failing because my source was 'terrarium' but I had it set to 'mapbox' in the DemSource |
How are you generating the pmtiles, is it based on the open contour dataset? |
That particular file is made from GEBCO bathymetry data from https://www.gebco.net/data_and_products/gridded_bathymetry_data/ I made it using this code from my repo at https://github.com/acalcutt/GEBCO_to_MBTiles , mainly this code the uses gdal and rio-rgbify to make a terrairum file with a custom version of rio-rgbify https://github.com/acalcutt/GEBCO_to_MBTiles/blob/main/create_terrarium.sh (for terrarium) I also have code to do the same from the JAXA dataset at Both processes make mbtiles files, which i then converted with the pmtiles tool https://github.com/protomaps/PMTiles?tab=readme-ov-file#creating-pmtiles The GEBCO file is 11GB. I used it in this example mainly because I already had it in that location |
One nice thing about maplibre-cuntour is that even though the dem only goes to zoom 8, you are still able to use higer zoom levels on your lines and still get nice crisp looking lines at high zoom levels |
Unrelated but I wanted to ask what specific advantages of PMTiles are you all looking for, for this purpose. Is it simplicity of one file. I'm encountering the issues related to the browser is not caching range requests at all, but it does cache the png tiles fine which helps reduce network traffic. So i'm just trying to understand what benefits the PMTiles format would provide in this use case, besides perhaps performance? |
I've created the following PR: #359 to allow both replacing the fetch tile and decode image method for local dem manager, which will allow running this plugin in node environment for example. |
About PMTiles format : https://github.com/protomaps/PMTiles
The current initialization of demSource is as follows:
If support for pmtiles format could be implemented, for example:
The pmtiles format is very promising. It would be great if your plug-in could support this format.
Anyway,Thanks for this great plugin :)
The text was updated successfully, but these errors were encountered: