mapbox / mapnik-vector-tile

Mapnik implemention of Mapbox Vector Tile specification
BSD 3-Clause "New" or "Revised" License
553 stars 117 forks source link

Think about optimizing mercator projection #229

Closed joto closed 6 years ago

joto commented 7 years ago

The mercator projection code in src/vector_tile_projection.ipp could be optimized. See https://github.com/osmcode/mercator-projection .

I have added the optimized version to libosmium. But OSM data is special, because we know it only has ~1cm resolution. So I am very confident, the optimizations will not lead to any problems, because while they change the numeric value of the mercator coordinates, the difference is way below what is in the OSM data in the first place.

For vector tiles that might work with generic GIS data from any source, this is somewhat different. The source data could be much more detailed. Usual uses of vector tiles for rendering are not affected I would think, but who knows what people are using vector tiles for and in what resolutions? There could at least be a compile time option or so to switch mercator projection implementations. Any opinions?

/cc @springmeyer @oxidase

flippmoke commented 7 years ago

I believe our implementation comes directly from mapnik, so perhaps would be better to update there? /cc @artemp

springmeyer commented 6 years ago

bump @artemp