[OSM-dev] Scale of downloaded images seems to vary.
Michael Reichert
osm-ml at michreichert.de
Thu Jan 11 19:51:01 UTC 2018
Hi,
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.
https://github.com/Zverik/Nik4/blob/master/nik4.py#L289
Best regards
Michael
--
Per E-Mail kommuniziere ich bevorzugt GPG-verschlüsselt. (Mailinglisten
ausgenommen)
I prefer GPG encryption of emails. (does not apply on mailing lists)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20180111/149fb6e9/attachment.sig>
More information about the dev
mailing list