mapbox / vt-pbf

Serialize Mapbox Vector Tiles to binary protobufs in javascript.
Other
186 stars 38 forks source link

Possibility to use other projections ? #22

Open gerbsen opened 6 years ago

gerbsen commented 6 years ago

Hey there, I've described my case here and got the suggestion to re-add the issue here. To sum this up:

We have written our own vectortiles service based on vt-pbf, which queries a really large database and transports the tiles in gzipped-geojson (which have to be in 4326 as per the spec, I believe) to our clients. Currently the geometries in our database are still in 4326, but I thought it would be useful to transform those to 3857 in order to save the transformation from 4326 to 3857 in the frontend.

This is probably also relevant.

@anandthakker replied:

@gerbsen if you're using vt-pbf to generate vector tiles from GeoJSON data, then yes, the input data are assumed to be in 4326 per the spec.

Is what you're looking for an option to vt-pbf allowing the input to be already projected into 3857? If so, please open an issue in the vt-pbf repo describing your use case / request: https://github.com/mapbox/vt-pbf. This is something we've done in other MVT-generating tools -- see, for example, mapbox/tippecanoe#217

cheers, daniel

attn: @abenrob

anandthakker commented 6 years ago

I think an option like this would make sense -- @springmeyer second opinion?

springmeyer commented 6 years ago

I'm a little confused and not totally following this conversation. But I will try to help by saying that:

Pat28 commented 6 years ago

What about other coordinate systems? For instance in WMTS you can define your own TileMatrixSet, see this sample from Swiss that is currently in use.

http://wmts.geo.admin.ch/1.0.0/WMTSCapabilities.xml

<TileMatrixSet><ows:Identifier>21781_25</ows:Identifier>
<ows:SupportedCRS>urn:ogc:def:crs:EPSG:21781</ows:SupportedCRS>
<!-- This tileMatrixSet in **only** for tiles generated through TileGenerator ! -->
<TileMatrix>
<ows:Identifier>0</ows:Identifier>
<ScaleDenominator>14285750.5715</ScaleDenominator>
<TopLeftCorner>420000.0 350000.0</TopLeftCorner>
<TileWidth>256</TileWidth>
<TileHeight>256</TileHeight>
<MatrixWidth>1</MatrixWidth>
<MatrixHeight>1</MatrixHeight>
</TileMatrix>
etc