Am 11.01.2018 um 10:54 schrieb Tom Hughes:
> Looks like we are using 90dpi actually. The key code is here:
> https://github.com/openstreetmap/chef/blob/master/cookbooks/tile/templates/default/export.erb#L121
> We project the bounding box from EPSG:4326 lat/lon to spherical mercator
> which gives us coordinates on a projected sheet measuring roughly
> 40075016m on each edge (2 x PI x assumed earth radius).
> We then divide by the scale factor and then convert metres to pixels by
> dividing by 0.00028 which comes from:
>   1 / 39.701 / 90
> Where we divide by 39.701 to convert from metres to inches and then by a
> further 90 to convert to pixels at 90 dpi.

Nik4 goes one step beyond and multiplies the scale by (1 / cos(lat)).
lat is the latitude of the centre of the rendered image. That's a pretty
good approximation.

Best regards


Per E-Mail kommuniziere ich bevorzugt GPG-verschlüsselt. (Mailinglisten
I prefer GPG encryption of emails. (does not apply on mailing lists)

Attachment: signature.asc
Description: OpenPGP digital signature

dev mailing list

Reply via email to