News for hackers. Stuff that matters.
Re:Openstreetmap, a global map for worldwide insight by berkes on Friday July 03, 2020 @09:36AM (#23723879)
In addition, modern browsers can display vector tiles directly. Mobile and apps have a somewhat harder time with this. https://www.maptiler.com/ has a good introduction for this wrt Open Street Map.
Re:Openstreetmap, a global map for worldwide insight by bdon on Friday July 03, 2020 @10:04AM (#23724116)
Vector tiles with OpenLayers doesn't feel as smooth to me compared to MapboxGL or Tangram https://openlayers.org/en/latest/examples/mapbox-style.html but it seems to be improving rapidly.
Re:Openstreetmap, a global map for worldwide insight by for_xyz on Saturday July 04, 2020 @05:00AM (#23731096)
Last time I checked (almost 2 years ago) OpenLayers did not support webgl backend for vector graphics. That's why it was slower.
Re:Openstreetmap, a global map for worldwide insight by jokoon on Friday July 03, 2020 @02:53PM (#23726465)
Aren't those vector tiles a little heavy, since they're likely json?

Of course I can guess a lot of data can be removed and simplified, but still, PNG seem lighter...

Re:Openstreetmap, a global map for worldwide insight by nbadg on Friday July 03, 2020 @07:01PM (#23728370)
I believe, but haven't bothered to profile, that they're lighter. You can also pre-"render" the vector tiles and store them in eg S3. All styling is done in-browser, which means you can do neat things like swap out the styles client-side for dark mode without needing to reload map tiles.

The primary standard for vector tiles is Mapbox Vector Tiles (it's an open standard), which is really just a sqlite database following a particular schema.

My own personal experience developing against both png and vector tiles over the past few months is that vector tiles are better in just about every way for the kinds of things you use maps for in apps. I expect that some dataviz applications, though, would be better served by raster tiles, since you'd end up generating a raster overlay anyways.

Re:Openstreetmap, a global map for worldwide insight by durkie on Friday July 03, 2020 @03:27PM (#23726747)
It depends on the application, but I don't think they're necessarily larger in size. I believe the format is quite compressed (Mapbox Vector Tile/MVT, which I believe is a variant of protocol buffers).

Many vector tile encoders have wide flexibility in geometry simplification/removal depending on zoom layer and this helps big time with tile size. I find them to be quite nice in lower bandwidth situations because you can overzoom them and still have them look good: if you zoom in and the tiles for the next zoom level haven't loaded, the vector geometry is still able to look decent, rather than pixellated like a raster tile.

Re:Openstreetmap, a global map for worldwide insight by nbadg on Friday July 03, 2020 @07:03PM (#23728385)
You're mixing up the formats slightly: MVT is sqlite with a particular schema; OSM raw data is PBF with a particular schema.
Re:Openstreetmap, a global map for worldwide insight by durkie on Saturday July 04, 2020 @03:15PM (#23734286)
Isn't mbtiles sqlite?
Re:Openstreetmap, a global map for worldwide insight by nbadg on Sunday July 05, 2020 @02:50AM (#23737040)
It might be that pbfs are stored inside sqlite? The whole thing is really incredibly confusing to be honest.

What I can tell you is that my vector slippymap XHR is requesting .pbf files, so that would definitely imply protobuffers as the wire format. Ultimately that's using t-rex and mapbox-gl.js, so... not sure if there's something intermediate. But the mapbox docs say sqlite? I'm just very confused now.

Re:Openstreetmap, a global map for worldwide insight by maxerickson on Sunday July 05, 2020 @12:36PM (#23739915)
Re:Openstreetmap, a global map for worldwide insight by nbadg on Monday July 06, 2020 @05:34PM (#23753044)
Yep, versus https://docs.mapbox.com/help/glossary/mbtiles/ -- I had them backwards. My confusion might have been because of the name similarities (mbtiles vs mvt), which took me 3 tries to even just type correctly.
Re:Openstreetmap, a global map for worldwide insight by jokoon on Friday July 03, 2020 @04:54PM (#23727533)
Compressed? Are you saying decompression is done with JS?