openstreetmap / openstreetmap-website

The Rails application that powers OpenStreetMap
https://www.openstreetmap.org/
GNU General Public License v2.0
2.16k stars 908 forks source link

Scale bar in bottom corner too small to be useful #5114

Open VolkerRaab opened 3 weeks ago

VolkerRaab commented 3 weeks ago

Problem

Measuring distances on the map requires a scale. This is present in principle in the bottom corner given both in metric and imperial units. However, I find it way too small to be useful. When I try to measure the distance between two points I try to zoom in for best precision which means that the two are in approximately opposite corners. (Quick try: image width 1780px, scale bar 69px. That is not even 4% of the width or 3% of the diagonal.) To estimate the distance I then have to guess whether it is more like 15 times the scale bar or more like 20 times. This frequently does not really help. NB: google maps has the same issue.

Description

The scale bar should be at least 1/3 of the image width. Being in the bottom corner I don't see issues with it covering up more important information even when considerably bigger.

Screenshots

No response

mmd-osm commented 3 weeks ago

To measure distances, I find scales fairly unreliable, regardless of their length on the map. You always have the issue that you cannot rotate the map to align it with horizontal scales. With web mercator projection, this is even getting worse when trying to measure long distances across oceans (spoiler: it's not a straight line, if your longitude differs!)

image

Maybe you could try out if something like https://ppete2.github.io/Leaflet.PolylineMeasure/demo1.html would cover your requirement?

Part of https://ppete2.github.io/Leaflet.PolylineMeasure/

VolkerRaab commented 3 weeks ago

Oh, that was quick!

As I am not a "flat-earther" I get your point with the curvatures ;-) However this is not an issue for getting to the next-best pizza-place within the county.

Commenting on your suggestion: (a) it is very nice, particularly when segments are involved! Good to know. (b) but it is an external app which may not have all features of the "general" openstreetmap.org, like POI, Hospitals, etc. (c) having such a feature on the "regular" openstreetmap would be great but a lot more work than just enlarging the existing bar.

So I insist that it wouldn't hurt to enlarge the existing scale bar even though it obviously has its deficiencies.

mmd-osm commented 3 weeks ago

Well, I'm assuming that you're not using your helicopter to get to your pizza place and would need to know the straightline distance. Why don't you use one of the available routing options instead? They support walking, bike and car across 3 different routing engines.

VolkerRaab commented 3 weeks ago

In fact I prefer a catapult to a helicopter (which brings back the issue of curved trajectories). But to see how wide Monterey-Bay is or how long Death Valley would involve straight lines. I am not saying there are no alternative ways to find out. But the bar in its present state is unusable IMHO.

AntonKhorev commented 3 weeks ago

For testing I have some code that replaces actual routing engines in the directions mode with fake ones that just tell the distance between from/to points. Maybe we can make it an actual selectable routing engine? Then you'll be able to measure distances using the "directions from/to here" context menu.

VolkerRaab commented 3 weeks ago

That would already be a very viable compromise: a "routing" just straight from a starting point to an end point. Thanks.

mmd-osm commented 3 weeks ago

Maybe one of the routing engines already supports direct line routing out of the box. That would make this even easier to build.

mmd-osm commented 3 weeks ago

By the way, Leaflet also has a param to set the max width of the scale:

In app/assets/javascripts/index.js:

  // L.control.scale()
  //   .addTo(map);

  L.control.scale ({maxWidth:400}).addTo (map);
tomhughes commented 3 weeks ago

Can somebody explain how any of this helps with mapping? It sounds like you want it as an end user feature which would be out of scope....

AntonKhorev commented 3 weeks ago

How does the existing scale bar help with mapping?

VolkerRaab commented 3 weeks ago

Thanks to @tomhughes: programming is probably out of scope and I am not asking for any. As opposed to programming my first suggestion (as I understand it) is essentially changing one parameter for the existing map display: the length of the scale bar. If I want to (roughly) know the distance between New York and Washington I open the map and zoom in to see the distance is "three thumbs". But then the scale bar is too short to convert "three thumbs" into miles... Most of the times for a quick info this is enough and fiddling with routing, start and end points and the question of car/train/bicycle and the routing engine much too inconvenient...

HolgerJeromin commented 3 weeks ago

If I want to (roughly) know the distance between New York and Washington I open the map and zoom in to see the distance is "three thumbs".

Tom asked the question "Can somebody explain how any of this helps with mapping?" The main philosophy of this website is to make openstreetmap mapping better and easier but not to produce tools for "generic useful map stuff". Routing was for example included to find routing errors in osm data.

gravitystorm commented 3 weeks ago

How does the existing scale bar help with mapping?

It can help in sparsely mapped areas, or at high latitudes, to figure out whether features (like forests or coastlines) have been mapped to a reasonable accuracy. For example, if the coastline has corners around 1km apart, that suggests more detail could be added.

But in general it's not super important, which is why having a small scale bar in the corner is proportionate. It's there to indicate roughly what scale of map you are looking at, for when you have no further context. It's not supposed to be a measuring tool.

As above, we need some reasonable mapping use-case (and we mean, a use-case for OpenStreetMap volunteer mappers) to consider adding more functionality.

AntonKhorev commented 3 weeks ago

Tom asked the question "Can somebody explain how any of this helps with mapping?"

Last time I wanted to measure distances was when I wanted to know how far away certain contributors place pois from where they really are.