hiddewie / osm-cycling-maps

Generating beatiful cycling maps using Mapnik and OpenStreetMap data
https://hiddewie.github.io/map-it
MIT License
34 stars 5 forks source link

Fix scale #124

Closed hiddewie closed 3 years ago

hiddewie commented 3 years ago

The Mercator projection uses meters as its unit, but these are projected meters. The factor between real world meters and unit meters is defined by latitude.

Because of the factor (missing in the code), the scale of generated maps will be incorrect. This was found when generating a clone of another paper map with a fixed bounding box and scale.

This PR fixes the scale of generated maps by calculating the (average) factor between the Mercator projection meters and real world meters.