←back to thread

OpenStreetMap's New Vector Tiles

(tech.marksblogg.com)
486 points marklit | 6 comments | | HN request time: 0.757s | source | bottom
Show context
DemocracyFTW2 ◴[] No.42182817[source]
One clear advantage of the new SVG format is, apparently, that Arabic script is now, finally!, rendered the way it was always intended—left-to-right with unconnected letters /s
replies(5): >>42183178 #>>42183255 #>>42183421 #>>42183525 #>>42187652 #
1. memsom ◴[] No.42183421[source]
I wish they were SVG, that would make rendering them less of a headache.

There is still no good library which takes in a MVT tile and spits out the appropriate PNG or JPEG for rendering in via a tile base mapping engine. There is still no good cross platform mapping engine that can render vector tiles in a way that is easy to consume. There are certainly engines on specific platforms, but unless we use something like Leaflet or OpenLayers it is hard to make it work with native APIs on, say Windows, MacOs, Linux, iOS or Android without needing to adding a whole browser engine on top of your app.

replies(3): >>42183631 #>>42185033 #>>42190571 #
2. dvdkon ◴[] No.42183631[source]
There are plenty non-web vector map renderers, but they generally provide a full GUI widget, not a simple "extent -> png" function. I don't think creating that would be too much work, though: Just set one of those libraries to render to a texture.

Maplibre Native even seems to have a headless "render to PNG" backend: https://github.com/maplibre/maplibre-native/tree/main/platfo...

3. mxfh ◴[] No.42185033[source]
If I would like to print vector-tile based maps to pdfs for handout's or something, is there any CPU renderer, server- or client-side that could output SVGs instead of rasterizing on GPU to bitmap at some point?

I havent yet come across any renderer that would do this even partially, even before opening the whole can of worms that is text rendering.

Closest thing I'm aware of might be ArcGIS Maps for Adobe Creative Cloud but would need something that's more like a library and preferably FOSS.

replies(2): >>42186764 #>>42186785 #
4. InsertUser ◴[] No.42186764[source]
Recent versions of QGIS support vector tiles in the MVT format (like these ones). So with a suitable style you should be able to create a layout using vector tiles and print.

Assuming you meet the relevant attribution/license requirements for the various bits you choose of course. I don't think any usage policy has been published for these tiles yet.

Unfortunately there are some translation issues with styles for MVT sources so you might need to do a bit of fixing if you don't want to go the route of a paid plan with MapTiler (third party provider) who have a plugin.

There's also a list of "print map" generators of varying types here: https://wiki.openstreetmap.org/wiki/OSM_on_Paper

5. dvdkon ◴[] No.42186785[source]
QGIS can do this. It's a large dependency and loads Mapbox/Maplibre styles by converting them to internal ones, so it might look a little different than the standard Maplibre renderer, but you get the benefit of easily editing those styles.
6. chrisdalke ◴[] No.42190571[source]
Yup. I work a lot with MVTs and one of the headaches is, after you have your nice shiny state-of-the-art maps, turning them back into PNG raster tiles for all the various clients that can't natively render vector tiles.

This link is shrinking though! There's slowly growing support. Leaflet and OpenLayers are fundamentally limited by being canvas-based, so there's only so much they can do.

QGIS has one of the fastest, cleanest MVT renderers I've seen, but I don't know how easy that would be to extract out.

PostGIS is the best platform for generating vector tiles, but it's extremely clunky. On the projects I'm working on (eg https://vectorcharts.com/) I do extensive processing in PostGIS, but then encode to vector tiles in bespoke C++ code.