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

is it possible to export tiles #408

Open
toqeer786 opened this issue Dec 7, 2022 · 9 comments
Open

is it possible to export tiles #408

toqeer786 opened this issue Dec 7, 2022 · 9 comments

Comments

@toqeer786
Copy link

hii. is it possible to export tiles in PNGs format because i want to use tiles for my offline project

@wipfli
Copy link
Contributor

wipfli commented Dec 7, 2022

Planetiler creates vector tiles. You can render them in MapLibre GL JS for example. I would search for difference between vector tiles and raster tiles to learn more about the two

@acalcutt
Copy link

acalcutt commented Dec 7, 2022

You can export them to pbf with mbutil, like

./mb-util --image_format=pbf input.mbtiles output_folder`

For example, https://github.com/maplibre/demotiles/tree/gh-pages/tiles-omt

**note, in that tiles-omt example, I also had to uncompress the pbfs with something like

cd output_folder
gzip -d -r -S .pbf *
find . -type f -exec mv '{}' '{}'.pbf \;

(this came from the bottom of https://openmaptiles.org/docs/host/tileserver-php/ )

But like @wipfli said, these aren't images

you could use something like maplibre-native to render pngs with a style, but that would take a bit of work. . For example, tileserver-gl is able to generate static images using the node maplibre-native like this

@acalcutt
Copy link

acalcutt commented Dec 7, 2022

Although I will say, it is a pain dealing with flat exported files like that because it can be a LOT of files. In my opinion mbtiles is a lot more portable. PMtiles can also be very portable.

@msbarry
Copy link
Contributor

msbarry commented Dec 7, 2022

You could also serve the generated mbtiles file with tileserver-gl. It exposes an api that renders raster tiles from the vector tiles and you can download all of the pngs from that to another mbtiles file, for example pointing something like tilelive-copy at the API endpoint.

@toqeer786
Copy link
Author

You could also serve the generated mbtiles file with tileserver-gl. It exposes an api that renders raster tiles from the vector tiles and you can download all of the pngs from that to another mbtiles file, for example pointing something like tilelive-copy at the API endpoint.

hello @msbarry i had try this when i serve the mbtiles file it only give me an option to vector view in tileserver-gl ,,can you explain how it can be possible i want to convert mbtiles into folder format ( pngs) i successfully tried to convert it through a tool (mbutil) it sucessfully convrert it but unfortunately it give me a fatal error "Reading PNG image file" Not a png file

@wipfli
Copy link
Contributor

wipfli commented Dec 20, 2022

@toqeer786 why do you need png tiles? If you use MapLibre GL JS, you do not need the png tiles, instead, you can use vector tiles directly...

@wipfli
Copy link
Contributor

wipfli commented Dec 20, 2022

Planetiler converts OpenStreetMap data to vector tiles. If you need raster tiles, you need to convert the vector tiles to raster tiles. This can be done for example with tileserver-gl or with MapLibre GL Native node bindings.

@toqeer786
Copy link
Author

Hi @wipfli i need it pngs form to use it in my project and can you please share link as you said node bindings ? how can i convert vector tiles to raster tiles ,,i had try alots of tools like rasterize-vector tiles ,mbutil , but id didnt help

@wipfli
Copy link
Contributor

wipfli commented Dec 20, 2022

https://github.com/maplibre/maplibre-gl-native/tree/main/platform/node and @acalcutt is the expert on how to use this...

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