facebook / Rapid

The OpenStreetMap editor driven by open data, AI, and supercharged features
https://rapideditor.org
ISC License
505 stars 92 forks source link

WMS bbox token for the whole area in-view as well as corresponding resolution #1519

Open Swarkin opened 3 weeks ago

Swarkin commented 3 weeks ago

Description

Some map imagery servers are optimized to instead of serving tiles, to take a bbox and a requested resolution to provide the entire map in one request, and this does not play well with the way RapiD does it currently, which is a lot of individual tiny requests. This results in really long wait times, as these servers usually process request in sequence instead of parallel like tile servers do. Because of that, I'd like to request the addition of a view_bbox, view_width (in px) and view_height (in px) tokens available for requests in the custom map field.

Swarkin commented 3 weeks ago

An example for this is https://geoservices.bayern.de/od/wms/dop/v1/dop20?language=ger&FORMAT=image%2Fpng&TRANSPARENT=TRUE&VERSION=1.1.1&SERVICE=WMS&REQUEST=GetMap&LAYERS=by_dop20c&STYLES=&SRS=EPSG%3A3857&WIDTH=256&HEIGHT=256&BBOX={bbox}. (This imagery only covers Bavaria in Germany!) Zooming in and out too fast results in a blank black background that takes a long time to load back in, which is very annoying while editing.

bhousel commented 2 weeks ago

Thanks for reporting - this does get requested occasionally, the last one I'm aware of is https://github.com/openstreetmap/iD/issues/7473 (which was closed as "low impact").

But yes, it's possible for WMS sources to accept different bboxes than just the square tiles that we use everywhere else. I'd have to think a bit about how we'd implement this.