Skip to content
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

PMTiles detected but not displayed when selected. #260

Open
TwinTurbine opened this issue Feb 5, 2024 · 10 comments
Open

PMTiles detected but not displayed when selected. #260

TwinTurbine opened this issue Feb 5, 2024 · 10 comments

Comments

@TwinTurbine
Copy link

Hi,

Having uploaded two custom maps to my Raspberry 2 server running Raspbian Bullseye with Node Red 3.1.3 and node-red-contrib-web-worldmap 4.6.1 I'm having trouble viewing these map in any of the worldmap nodes.

Both the Dashboard as well as the Location node will list the PMTile maps perfectly but from there on they behave a bit differently. The Dashboard Worldmap node will just continue to show the default OSM whereas the Location map switches to a solid, gray background, when any of the custom maps are selected.

I don't think there's any problem with the maps as they are perfectly viewable in the online PMTiles Viewer, but one never knows of course. Below the metadata of one of the files can be seen, if that helps.

root directory: offset=127 len=78
metadata: offset=205 len=157
leaf directories: offset=362 len=89731
tile data: offset=90093 len=1712617545
num addressed tiles: 38133
num tile entries: 38133
num tile contents: 38133
clustered: true
internal compression: 2
tile compression: 1
tile type: 2
min zoom: 2
max zoom: 12
min lon, min lat, max lon, max lat: 10.8247509, 55.2757111, 24.9699917, 69.1247384
center zoom: 2
center lon, center lat: 17.8973713, 62.2002247

{
"description": "FK100K_PNG8",
"format": "png",
"maxzoom": "12",
"minzoom": "0",
"name": "FK100K PNG8",
"type": "OVERLAY",
"version": "1.1"
}

Kind regards and thanks for a fantastic contribution to Node Red!

@dceejay
Copy link
Owner

dceejay commented Feb 6, 2024

Can you maybe try an extract of a map segment by using the command line pmtiles utility to extract an area from https://docs.protomaps.com/basemaps/downloads ?
or try this zipped up World-level5.pmtiles.zip file (unzip first of course) - Note: you may need to zoom out to see anything at this zoom level.

I suspect it may be down to the colours/styling of layers - what is the source of your pmtiles file ?

Also maybe try adding a file pmtiles.opts (into your .node-red dir with something like..

{
    "maxDataZoom": 12,
    "maxZoom": 18,
    "dark": false
}

As the max zoom you have in the data seems to say 12 whereas I think I default to 15.

@TwinTurbine
Copy link
Author

Hi again,

I tried World-level5.pmtiles and it seemed to be viewable when zooming out. I also tried the pmtiles.opts but that only made my objects/things that I would like to plot on the map disappear.

The Pmtiles file that I would like to view is originally an MBTiles file generated from a rasterized map. It might be the reason of the problem but I just found it strange the the PMTiles Viewer will render the same file perfectly.

@dceejay
Copy link
Owner

dceejay commented Feb 12, 2024

yeah - so most likely the way the features are coloured, but then again I did think it was a man for vector type maps rather than raster. (but happy to be proven wrong). How large is your map (or a section of it ?) - As in can you send it to me - or point me at a temporary download and I could have a look over the next few days.

@Koloblix
Copy link

Have same issue, with an self generated *.PMTile.
To work around, I installed tileserver-gl via NPM, then started it via tileserver-gl --file <PATH_TO_PMTILE>. In Node-Red Worldmap set Basemap to "Custom Map Provider" with URL "http://127.0.0.1:8080/data/pmtiles/{z}/{x}/{y}.jpeg". (You have to change to .png if sourcefiles are png.)
That workes for me using DOP20 orthographical photos to generate a map.

@dceejay
Copy link
Owner

dceejay commented Feb 15, 2024

Must admit I thought tileserver-gl worked with mbtiles rather than pmtiles - but maybe it does both... nice if it does.

(just checked - as YES IT DOES ! - that is nice - yes tileserver is indeed easy to setup as well - and would also be running as a separate thread so a good option in my book.)

@Rajduino
Copy link

I just started exploring the offline maps on node-red using this world map plugin.
I am also facing the same problem.
As I understand, there can be multiple random named overlays in .pmtiles files as it should. Is there any way to choose between those overlays? I am not getting the options to select between them automatically after the .pmtiles is detected by node-red. Can I in any way pass the name of the overlays to select using any msg.payload command? Also none of the layers are visible from the .pmtiles file according to my exploration. Thank You.

@TwinTurbine
Copy link
Author

The PMTile file I tried to use within Worldmap was generated from an MBTiles file using the PMTile CLI. As I mentioned earlier it was therafter perfectly rendered using the PMTiles Viewer. So it seems to me that the PMTiles format does support raster MBTiles. Since then I've tried the Tileserver-GL and that works great as an alternative. I only have to dig a little bit deeper into the software in order to be able to serve different maps (scales) for different zoom levels. It would be nice if the Worldmap plugin could be made to serve raster PMTiles as I really like the possibility to switch between different maps in an easy way. AFAIK it's only possible to connect one custom map source to Worldmap.

@dceejay
Copy link
Owner

dceejay commented Feb 28, 2024

You can only configure one source in the config page - but you can inject other new layers with sources at startup time if you need.

@TwinTurbine
Copy link
Author

Thanks for the tip, still learing as you can understand. Injecting several layers works great so that covers my needs. Just one question regarding that: Is it possible to add several layers without activating them all at the same time?

@TwinTurbine
Copy link
Author

Sorry, found the solution to my last question in the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants