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

Unable to render raster type PM Tiles from offline .pmtiles file #3166

Open
navisinghnz9 opened this issue Jan 22, 2025 · 4 comments
Open

Unable to render raster type PM Tiles from offline .pmtiles file #3166

navisinghnz9 opened this issue Jan 22, 2025 · 4 comments

Comments

@navisinghnz9
Copy link

I am trying to render raster type PM Tiles from offline .pmtiles file in Qt c++ application.

I am seeing a blank screen

However, I am able to render vector type PM Tiles from offline .pmtiles file in the Qt c++ application.

I was wondering if there is any example of rendering .pmtiles of raster types - from https:// and file:// sources.

Not sure if this is a bug in the maplibre-native.

@tdcosta100
Copy link
Collaborator

Hi, @navisinghnz9. Do you have a sample raster .pmtiles file, so we can reproduce your issue?

@navisinghnz9
Copy link
Author

Hi @tdcosta100

I am attaching the sample file here. Attached the file as .zip, pls unzip it.

region_8653_combined_shaded_relief.zip

@tdcosta100
Copy link
Collaborator

tdcosta100 commented Feb 6, 2025

It worked here for me:

Image

I used this style:

{
  "version": 8,
  "id": "pmtiles-test",
  "name": "PMTiles Test",
  "sources": {
    "raster_tiles": {
      "maxzoom": 20,
      "tileSize": 256,
      "type": "raster",
      "url": "pmtiles://file://<pmtiles directory>/region_8653_combined_shaded_relief.pmtiles"
    }
  },
  "layers": [
    {
      "id": "background",
      "type": "background",
      "paint": {"background-color": "rgb(128,128,128)"}
    },
    {
      "id": "raster_tiles",
      "type": "raster",
      "source": "raster_tiles",
      "maxzoom": 20
    }
  ]
}

And this command line (in Windows):

mbgl-render.exe --style file://<style directory>/pmtiles_test.json --lon=152.25 --lat=-23.2502 --zoom=10 --output out.png

Of course you have to replace the <pmtiles directory> and <style directory> with the actual path of your files.

@navisinghnz9
Copy link
Author

@tdcosta100 Thank you very much!

I have tested this working with maplibre-native on my side.
I was wondering when this will be supported in the maplibre-native-qt SDK as well.

(Just checked, the "main" of maplibe-native inside maplibre-native-qt/vendor/ is quite behind in the commit history at "0a4e5a4")

Thanks

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

2 participants