<div dir="ltr">Benjamin Stadin,<br><br>As an author of the specification, I have to disagree with you on the support for other projections. There is no limitation on vector tiles being required to being in mercator. The specification in fact mentions that other projections may be used: <br><br><a href="https://github.com/mapbox/vector-tile-spec/tree/master/2.1#3-projection-and-bounds">https://github.com/mapbox/vector-tile-spec/tree/master/2.1#3-projection-and-bounds</a><br><br>While it is not accessible via the node-mapnik bindings, we do in fact support encoding as different projections in mapnik-vector-tile. We have implemented the decoder so that it could accept other projections, but have not added a mapnik datasource that would support them, but if there is demand for such a thing we could do it.<br><br>Your comments about the entire stack of Mapbox supporting mostly mercator could be very accurate, but this is not at all related to the Vector Tile Specification. We purposefully attempt to make our tools as projection-less as possible and hope that others find awesome ways to build upon the standard.<br><br>"<span style="font-size:12.8px">But what data is </span><span style="font-size:12.8px">shown at which zoom level is defined by the styling" -- This is not true because you could make your data not even provide data at certain zoom levels. At Mapbox we do this quite often, street data is never included at very low zoom levels. Therefore, the style isn't the only control here. In fact, I would encourage you to view styling and rendering of vector tiles as an entirely different topic. <br></span><br>"<span style="font-size:12.8px">There is enough interest from our side that we¹d be interested in </span><span style="font-size:12.8px">contributing (maybe monetary or with code, or both) to define and implement a better general purpose tile format." -- Any issues you might have with the Mapbox Vector Tile Specification or any ideas you might have with the format are very much welcome. We want to make sure the spec migrates for community needs. Please see <a href="https://github.com/mapbox/vector-tile-spec/blob/master/CONTRIBUTING.md">https://github.com/mapbox/vector-tile-spec/blob/master/CONTRIBUTING.md</a> for how you might help!</span><br><br><span style="font-size:12.8px">Finally, I would like to stress that while Mapbox Vector Tiles were designed to be for rendering, it was well known during their design that they could be used for other applications. This was especially true when I was writing 2.0 of the specification as I tried to limit what would be considered even the most common uses of vector tiles.<br><br>Thanks,<br><br>Blake Thompson </span></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 1, 2016 at 4:27 PM, Stefan Keller <span dir="ltr"><<a href="mailto:sfkeller@gmail.com" target="_blank">sfkeller@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Ben<br>
<br>
Thanks for explaining - Petr and I are the maintainers of OSM2Vectortiles.<br>
I like projections (and also GeoPackage :-) ).<br>
But reprojection is solved here, since OGR/QGIS can transform on the fly.<br>
This thread is about Petr's question about a reader "for mapbox-like<br>
vector tiles stored in MBTiles or downloaded from a url...".<br>
<br>
So I'd like to come back to the issue:<br>
1. of a generic MVT decoder/enoder library (C++ or Python) => Blake?<br>
2. and of a "feature provider" in an interactive environment (like<br>
QGIS) or a file/stream converter (like OGR) => anybody?<br>
<br>
:Stefan<br>
<br>
<br>
<br>
2016-02-02 0:04 GMT+01:00 Stadin, Benjamin<br>
<<a href="mailto:Benjamin.Stadin@heidelberg-mobil.com">Benjamin.Stadin@heidelberg-mobil.com</a>>:<br>
<div class="HOEnZb"><div class="h5">> Hi Stefan,<br>
><br>
> A vector tile may contain data for several zoom levels. But what data is<br>
> shown at which zoom level is defined by the styling, not by the data<br>
> itself. It is handled on client side, by the web (or native) tile<br>
> renderer.<br>
><br>
> The path is the same as with mercator tiles (zoomLevel/x/y):<br>
> <a href="https://example.com/17/65535/43602.mvt" rel="noreferrer" target="_blank">https://example.com/17/65535/43602.mvt</a><br>
><br>
><br>
> The tile for zoom level 17 may contain features of class „building“, and<br>
> the style definition may contain a rule that filters type „building“ for<br>
> zoomLevels <= 18.<br>
><br>
> ~Ben<br>
><br>
> Am 01.02.16, 20:16 schrieb "gdal-dev on behalf of Stefan Keller" unter<br>
> <<a href="mailto:gdal-dev-bounces@lists.osgeo.org">gdal-dev-bounces@lists.osgeo.org</a> on behalf of <a href="mailto:sfkeller@gmail.com">sfkeller@gmail.com</a>>:<br>
><br>
>>That's good news!<br>
>>We'll be happy to add Python bindings to such a generic C++ library<br>
>>for Mapbox vector tiles.<br>
>>We have still some time (say few weeks?) left here to decide to<br>
>>contribute either to these bindings or to Mapzen's pure Python lib.<br>
>><br>
>>One reason why I'm insisting on Python (bindings) - besides easier<br>
>>testing with QGIS - is the following:<br>
>>AFAIK with vector tiles we have to deal with quite a new kind of<br>
>>feature provider:<br>
>>One which contains "zoom levels" and one which "suddenly" changes<br>
>>feature class at different zoom levels.<br>
>>If a client like QGIS consumes vector tiles from OGR in a one-shot<br>
>>call, how should the client deal with such "zoom level" dependent<br>
>>issues?<br>
>>So my thinking is, to consume only the most appropriate zoom level,<br>
>>probably only within current map canvas...<br>
>><br>
>>:Stefan<br>
>><br>
>>2016-02-01 18:27 GMT+01:00 Flippmoke <<a href="mailto:flippmoke@gmail.com">flippmoke@gmail.com</a>>:<br>
>>><br>
>>> Stefan,<br>
>>><br>
>>> I am not aware of any libraries besides mapnik vector tile that have<br>
>>>been attempting to implement v2 specification. I think mapzen's<br>
>>>implementation might be best? We have been wanting to add vector tiles<br>
>>>to the python mapnik bindings for quite some time but we don't have the<br>
>>>time to do it right now.<br>
>>><br>
>>> I will try to think this week about how we could make a generic C++<br>
>>>library quickly for Mapbox vector tiles.<br>
>>><br>
>>> Thanks,<br>
>>><br>
>>> Blake Thompson<br>
>>><br>
>>>> On Feb 1, 2016, at 1:06 AM, Stefan Keller <<a href="mailto:sfkeller@gmail.com">sfkeller@gmail.com</a>> wrote:<br>
>>>><br>
>>>> Hi Blake<br>
>>>><br>
>>>> It's clear to me that a good generic c++ library for encoding and<br>
>>>> decoding vector tiles is needed.<br>
>>>> On the other hand, I'd like to experiment with vector tiles and<br>
>>>> related QGIS parallel loading issues for which Python is more<br>
>>>> convenient.<br>
>>>><br>
>>>> It seems that Mapzen's [1] Python implementation is further along.<br>
>>>> Or do you know if Jesse (or somebody) is still working on Mapbox's<br>
>>>>variant [2] ?<br>
>>>><br>
>>>> :Stefan<br>
>>>><br>
>>>> [1] <a href="https://github.com/mapzen/mapbox-vector-tile" rel="noreferrer" target="_blank">https://github.com/mapzen/mapbox-vector-tile</a><br>
>>>> [2] <a href="https://github.com/mapbox/vector-tile-py" rel="noreferrer" target="_blank">https://github.com/mapbox/vector-tile-py</a><br>
>>>><br>
>>>><br>
>>>> 2016-01-31 23:22 GMT+01:00 Flippmoke <<a href="mailto:flippmoke@gmail.com">flippmoke@gmail.com</a>>:<br>
>>>>> All,<br>
>>>>><br>
>>>>> The first thing that is going to be required likely is a good generic<br>
>>>>>c++ library for encoding and decoding vector tiles IMO.<br>
>>>>><br>
>>>>> I have spent a lot of time working on developing the mapnik vector<br>
>>>>>tile library to be a solid implementation, especially around all the<br>
>>>>>work done for 2.0 of Mapbox vector tile specification. I would love to<br>
>>>>>eventually help make this a generalized implementation so that it is<br>
>>>>>portable to a library like GDAL.<br>
>>>>><br>
>>>>> We have talked about doing something like this at Mapbox but will<br>
>>>>>require a good deal of time, so it hasn't been pushed forward yet. The<br>
>>>>>other issues that come to mind to me is that some of the libraries<br>
>>>>>that mapnik vector tile depends upon most likely need good custom<br>
>>>>>implementations if we wanted to make it more generic.<br>
>>>>><br>
>>>>> The reason for this is that I would prefer for it to be a header only<br>
>>>>>library with no dependencies. Adding more dependencies for GDAL seems<br>
>>>>>like it could be a mess.<br>
>>>>><br>
>>>>> Blake Thompson<br>
>>>>><br>
>>>>>> On Jan 31, 2016, at 10:10 AM, Stefan Keller <<a href="mailto:sfkeller@gmail.com">sfkeller@gmail.com</a>><br>
>>>>>>wrote:<br>
>>>>>><br>
>>>>>> Hi Petr, Blake, Even and everybody<br>
>>>>>><br>
>>>>>> I'm (besides Petr) the other maintainer of OSM2VectorTiles.<br>
>>>>>> I'd already asked Even a similar question.<br>
>>>>>> I'm advising now an intern to implement such a MVT Vector Tiles<br>
>>>>>>reader<br>
>>>>>> client in Python if possible as part of a QGIS plugin.<br>
>>>>>> And I'm interested not to do redundant implementations.<br>
>>>>>> Are there any news on this matter?<br>
>>>>>><br>
>>>>>> :Stefan<br>
>>>>>> Prof. at HSR and leader of Geometa Lab<br>
>>>>>><br>
>>>>>> @Even: Regarding OGR MVT development can you send to me (directly) a<br>
>>>>>> contact name of the group which won the bidding?<br>
>>>>>><br>
>>>>>><br>
>>>>>> 2016-01-06 15:24 GMT+01:00 Petr Pridal <<a href="mailto:petr.pridal@klokantech.com">petr.pridal@klokantech.com</a>>:<br>
>>>>>>> Hi everybody,<br>
>>>>>>><br>
>>>>>>> thanks for the comments. Regarding the technical details:<br>
>>>>>>><br>
>>>>>>>> Each Tile is its own discrete dataset therefore the hardest part<br>
>>>>>>>>would be<br>
>>>>>>>> merging of features into the original features across tiles. You<br>
>>>>>>>>could use<br>
>>>>>>>> some complicated merging technique, but that could be very<br>
>>>>>>>>expensive.<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> The driver could require "id" parameter, which specifies name of an<br>
>>>>>>> attribute with unique identifier on the features shared across the<br>
>>>>>>>tiles.<br>
>>>>>>> Both MapBox vector tiles and OSM2VectorTiles tiles have an unique<br>
>>>>>>>non-zero<br>
>>>>>>> "osm_id" in place. The first version of driver could read only<br>
>>>>>>>features with<br>
>>>>>>> such ID. The identifier does not have to be always filled, but<br>
>>>>>>>often it is,<br>
>>>>>>> especially in deeper zoom levels derived purely from OpenStreetMap<br>
>>>>>>>- but<br>
>>>>>>> yeh, a completely general stitching would be much harder.<br>
>>>>>>><br>
>>>>>>> The clipping + merging of shapes itself can be implemented with<br>
>>>>>>>underlaying<br>
>>>>>>> GEOS library functions.<br>
>>>>>>><br>
>>>>>>> BTW It is possible to examine vector tiles data in pure JavaScript<br>
>>>>>>>X-Ray<br>
>>>>>>> viewer (no WebGL support on browser required) made in OpenLayers3:<br>
>>>>>>> <a href="http://klokantech.github.io/ol3-sandbox/vector/xray.html" rel="noreferrer" target="_blank">http://klokantech.github.io/ol3-sandbox/vector/xray.html</a><br>
>>>>>>><br>
>>>>>>> or with WebGL-enabled webbrowser with higher performance MapBox GL<br>
>>>>>>>JS<br>
>>>>>>> powered X-Ray:<br>
>>>>>>> <a href="http://klokantech.github.io/mapbox-gl-js-offline-example/xray.html" rel="noreferrer" target="_blank">http://klokantech.github.io/mapbox-gl-js-offline-example/xray.html</a><br>
>>>>>>><br>
>>>>>>> A debug viewer for each vector tile (made in OL3) decoded in pure<br>
>>>>>>> JavaScript:<br>
>>>>>>> <a href="http://klokantech.github.io/ol3-sandbox/vector/tile-inspector.html" rel="noreferrer" target="_blank">http://klokantech.github.io/ol3-sandbox/vector/tile-inspector.html</a><br>
>>>>>>><br>
>>>>>>> The OGR driver could be also practical for the unsimplified /<br>
>>>>>>>ungeneralised<br>
>>>>>>> MBTiles with OSM data available at:<br>
>>>>>>><a href="http://osmlab.github.io/osm-qa-tiles/" rel="noreferrer" target="_blank">http://osmlab.github.io/osm-qa-tiles/</a><br>
>>>>>>><br>
>>>>>>>><br>
>>>>>>>> If you wanted to simply view vector tile data it could get<br>
>>>>>>>>confusing as<br>
>>>>>>>> well since most vector tiles need a buffer when they are used for<br>
>>>>>>>> visualization programs. This is important for things like labeling<br>
>>>>>>>>on maps<br>
>>>>>>>> etc. Therefore, you could get a large amount of overlapping data<br>
>>>>>>>>on tiles if<br>
>>>>>>>> you loaded them all in at once.<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> Clipping on border of each tile must be applied before stitching<br>
>>>>>>>the vector<br>
>>>>>>> features together - so the buffer is removed. Buffer is there only<br>
>>>>>>>for<br>
>>>>>>> visualisation and labeling.<br>
>>>>>>><br>
>>>>>>>><br>
>>>>>>>> As far as writing a simple decoder -- the mapnik-vector-tile<br>
>>>>>>>>decoder isn't<br>
>>>>>>>> currently able to decode vector tiles into a form not supported by<br>
>>>>>>>>mapnik.<br>
>>>>>>>> Therefore, OGR would not be able to easily use this.<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> Correct. It can't be used directly (GDAL can't link against), but<br>
>>>>>>>the<br>
>>>>>>> relevant code can be extracted and reused directly. For basic<br>
>>>>>>>decoding<br>
>>>>>>> critical is the Protobuf library (which is already in GDAL) and<br>
>>>>>>><br>
>>>>>>><a href="https://github.com/mapbox/mapnik-vector-tile/blob/master/proto/vector" rel="noreferrer" target="_blank">https://github.com/mapbox/mapnik-vector-tile/blob/master/proto/vector</a><br>
>>>>>>>_tile.proto<br>
>>>>>>> + the code for converting pixel coordinates in features to relevant<br>
>>>>>>>geo<br>
>>>>>>> coordinates and GEOS-based merging of features.<br>
>>>>>>><br>
>>>>>>>> We plan to write a generalized encoder and decoder eventually so<br>
>>>>>>>>that any<br>
>>>>>>>> other library can plugin with out the mapnik requirement.<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> This would be amazing.<br>
>>>>>>><br>
>>>>>>>> If you have any questions specifically about Mapnik Vector Tile or<br>
>>>>>>>>the<br>
>>>>>>>> Mapbox Vector Tile Specification feel free to ask me. I would note<br>
>>>>>>>>that you<br>
>>>>>>>> guys will want to update your vector tiles once the V2<br>
>>>>>>>>specification changes<br>
>>>>>>>> are into Mapnik-Vector-Tile.<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> Cool! Thanks. Our world tiles are generated via Docker containers<br>
>>>>>>>on a<br>
>>>>>>> cluster of computers - using Mapnik via Tilelive directly - so<br>
>>>>>>>upgrades on<br>
>>>>>>> Mapnik-Vector-Tile will propagate to the open-source rendering<br>
>>>>>>>software.<br>
>>>>>>> I expect V2 spec will mean also new MapBox Streets V7, right?<br>
>>>>>>><br>
>>>>>>>> I see you mention MVT in MBTiles. Is it a recognized practice ? I<br>
>>>>>>>>don't<br>
>>>>>>>> see<br>
>>>>>>>> mention of that neither in the MVT spec (<br>
>>>>>>>> <a href="https://github.com/mapbox/vector-" rel="noreferrer" target="_blank">https://github.com/mapbox/vector-</a><br>
>>>>>>>> tile-spec/tree/master/2.0 ) nor the MBTiles one (<br>
>>>>>>>> <a href="https://github.com/mapbox/mbtiles-spec/blob/master/1.2/spec.md" rel="noreferrer" target="_blank">https://github.com/mapbox/mbtiles-spec/blob/master/1.2/spec.md</a> ),<br>
>>>>>>>>although<br>
>>>>>>>> I<br>
>>>>>>>> guess it is just a matter of storing a MVT blob in the tile_data<br>
>>>>>>>>column.<br>
>>>>>>><br>
>>>>>>><br>
>>>>>>> Yes. MapBox Studio Classic generates such MBTiles with Vector Tiles<br>
>>>>>>>inside -<br>
>>>>>>> and Mapnik reads them directly when rasterising. Storing the vector<br>
>>>>>>>tiles in<br>
>>>>>>> SQLite make sense - and it simplifies deployment, and you can then<br>
>>>>>>>easily<br>
>>>>>>> have complete world on each node of a cluster of tileservers. If<br>
>>>>>>>you don't<br>
>>>>>>> want to upgrade your base map too often, this approach is pretty<br>
>>>>>>>efficient<br>
>>>>>>> and removes the centralised database as typical bottleneck.<br>
>>>>>>><br>
>>>>>>> I did some tests on vector tiles vs raster in MBTiles and<br>
>>>>>>>documented these<br>
>>>>>>> in README.md at and<br>
>>>>>>><a href="https://github.com/klokantech/vector-tiles-sample" rel="noreferrer" target="_blank">https://github.com/klokantech/vector-tiles-sample</a> before<br>
>>>>>>> we started to work on OSM2VectorTiles project.<br>
>>>>>>> There are also sample data and offline MapBox GL JS viewer in that<br>
>>>>>>>repo.<br>
>>>>>>> Vector tiles can be hosted also "unpacked", just as files in<br>
>>>>>>>folders on a<br>
>>>>>>> standard web server - exactly like GDAL2Tiles or MapTiler.com does<br>
>>>>>>>by<br>
>>>>>>> default for raster tiles.<br>
>>>>>>><br>
>>>>>>> If OGR driver is implemented, the primary source should be probably<br>
>>>>>>>reading<br>
>>>>>>> from an URL via curl.<br>
>>>>>>><br>
>>>>>>> Reading PBFs from an MBTiles (or another SQLite) is just the most<br>
>>>>>>>practical<br>
>>>>>>> portable alternative to it.<br>
>>>>>>><br>
>>>>>>> Technically people may store the tiles in different ways - for<br>
>>>>>>>example<br>
>>>>>>> Wikimedia guys (<a href="http://maps.wikimedia.org/" rel="noreferrer" target="_blank">http://maps.wikimedia.org/</a> and<br>
>>>>>>> <a href="https://github.com/kartotherian/" rel="noreferrer" target="_blank">https://github.com/kartotherian/</a>) use Cassandra for tile storage, I<br>
>>>>>>>guess<br>
>>>>>>> MapBox internally is also on a different storage for production<br>
>>>>>>>servers ...<br>
>>>>>>> for transfers and streaming tilesets there is the - but tiles are<br>
>>>>>>>ALWAYS<br>
>>>>>>> exposed via HTTP.<br>
>>>>>>><br>
>>>>>>> Regards,<br>
>>>>>>><br>
>>>>>>> Petr<br>
>>>>>>> --<br>
>>>>>>> Petr Pridal, Ph.D.<br>
>>>>>>> CEO<br>
>>>>>>><br>
>>>>>>> Klokan Technologies GmbH<br>
>>>>>>> Hofnerstrasse 98, 6314 Unterageri, Switzerland<br>
>>>>>>> Tel: <a href="tel:%2B41%20%280%2941%20511%2026%2012" value="+41415112612">+41 (0)41 511 26 12</a><br>
>>>>>>> Email: <a href="mailto:info@klokantech.com">info@klokantech.com</a><br>
>>>>>>> Web: <a href="http://www.klokantech.com/" rel="noreferrer" target="_blank">http://www.klokantech.com/</a><br>
>>>>>>><br>
>>>>>>> _______________________________________________<br>
>>>>>>> gdal-dev mailing list<br>
>>>>>>> <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
>>>>>>> <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
>>_______________________________________________<br>
>>gdal-dev mailing list<br>
>><a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
>><a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
><br>
</div></div></blockquote></div><br></div>