[OSM-dev] Scale of downloaded images seems to vary.

Bjoern Hassler bjohas+mw at gmail.com
Sun Dec 31 17:04:19 UTC 2017


Dear friends,

I'm trying to make sense of the scales for map images downloaded from OSM.
For the download, you can choose the scale, and I had assumed that I could
use this to convert to an actual map scale.

The downloaded png/jpg etc seem to be at 72dpi. I had assumed I could just
convert pixels at 72dpi to actual dimensions (using the scale).

However - as far as I can tell - this doesn't work. Maybe I've made a
mistake somewhere, but the dimensions calculated from

   - "feature in pixels" / (72/2.54 pixels/cm) * scale = "feature size" in
   cm
   - lat-lon (e.g. bounding box provided)

Doesn't match. Moreover, the difference doesn't seem to be a constant
offset or ratio, but possibly latitude dependent.

Maybe the scale offered during download is not meant to be a geographic
scale? Maybe I've misunderstood something?

There are two worked examples below, that show the issue.

Any thoughts?
Bjoern

(and a Happy New Year!!)


*Example 1:*

I had a look for long straight roads ... (Trivia: http://www.
dangerousroads.org/rankings23/3759-the-10-longest-straight-
roads-in-the-world.html - "Located in the heart of Saudi Arabia, the
Highway 10  is 120 miles (193km) stretch of straightness. This asphalted
road links Haradh and Al Batha. It’s a straight road running right through
the desert for 2 h 1 min.")

- Open 'share',
- set scale to 1:50000,
- adjust view port so that "Image will show standard layer at 932x..."
- Go here: http://www.openstreetmap.org/#map=13/24.1349/49.3083

On the map, there's a road (East/West), with two turn-off: First, a power
line at the Eastern edge (running North/South). In the west, there are two
turn-off, the second (straight one) being 11.9 km from the power line
(according to JOSM). In the image, you've got those right at the edges.
>From the bounding box (hidden fields), I calculate 11.62km. Given that the
roads are just showing either side of the image, that's bang on.

Now download PNG, which will have with 932. I am assuming I have a PNG
(72dpi = 28.35 dots per cm), at scale 1:50,000. I calculate:

932 pixels / (72/2.54 pixels/cm) * 50000 = 16.4 km.

So there's a difference between the dimensions calculated from the pixels
and the distance calculated from lat/lon.

*Full details for Example 1:*

Z/L/L #13/24.1727/49.3090
bbox = [24.119651808471247,49.249992370605476 ->
24.22567631717543,49.368095397949226]
Pixel dim: 939 x 924;
Natural image dim (72dpi): 331 mm x 326 mm, 1 : 50000
Real world dim (from pixels): 16.563 km x 16.298 km, 1 : 1
Real world dim (latlon): 11.981 km x 11.789 km, 1 : 1
Ratio: 1.382438861530757 ; 1.3824751887352615

*Example 2:*

Another example from the above list:

Z/L/L #13/48.6536/-101.3485
bbox = [48.615207636211146,-101.44741058349611 ->
48.69198023486001,-101.24965667724611]
Pixel dim: 1572 x 924;
Natural image dim (72dpi): 555 mm x 326 mm, 1 : 50000
Real world dim (from pixels): 27.728 km x 16.298 km, 1 : 1
Real world dim (latlon): 14.526 km x 8.537 km, 1 : 1
Ratio: 1.908853091009225 ; 1.909101557924329

The distance (along the highway) from the turnoffs to Undip / Lansford
airstrips is 8.1km in JOSM. So the latlon calculation is correct. However,
the dimension calculated from the pixels isn't.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20171231/63299d90/attachment.html>


More information about the dev mailing list