openskope / skope-interface

The new SKOPE web portal interface.
https://www.openskope.org
4 stars 2 forks source link

Insert scale on Map view. #182

Open Zodiase opened 6 years ago

Zodiase commented 6 years ago

See https://github.com/openlayers/openlayers/issues/5503#issuecomment-229473998

For the scale line to make sense (measuring horizontal distance at the center of the view), the projection has to be conformal, which means it needs to be something like EPSG:3857, for example.

Zodiase commented 6 years ago

Overlays seem to not load after changing to EPSG:3857.

kintigh commented 6 years ago

For what it is worth it looks like it is off by a factor of about 120,000

Zodiase commented 6 years ago

@kintigh If you take a look at the comment in another issue I linked above, from my understanding of it, the scale line control is doing exactly it's supposed to (in other words it was not wrong but we were using/reading it wrong). Previously when we saw the reading was funny, the map was using EPSG:4326 projection, in which case the measurement should be read as "the vertical distance at the center of the view" or "the horizontal distance at the equator". In conformal projections such as EPSG:3857, the measurement is what we expect it to be (horizontal distance at the center of the view). But I can't say why the control can't be smarter and take projection into consideration and do the proper thing. There must be a GIS reason behind it (as the linked comment says, in non-conformal projections we are asking the wrong question).

Now the reading looks correct after switching to EPSG:3857, but the switch is causing problems when loading variable overlays from GeoServer. The loaded overlay tiles are all empty.

Zodiase commented 6 years ago

image

As you can see with EPSG:3857 the reading is much more reasonable.

kintigh commented 6 years ago

Yes the above looks reasonable, but what we are seeing isn't just a difference in the vertical and horizontal scales and the projection. That can't account for a factor of 120,000.