[openstreetmap/openstreetmap-website] Set bounding box size limits based on surface dimensions (Issue #4910)
Christoph Hormann
notifications at github.com
Wed Jun 19 14:02:36 UTC 2024
### Problem
Since #4908 introduces bounding box size limits not only for reading data but also for writing data it becomes even more pertinent to implement these size limits in a meaningful way.
Right now these are determined in equirectangular projection (i.e. geographic coordinates treated as cartesian), which is not adequate. This has lead to mapping using the OSM API for reading data being practically impossible at high latitudes in most cases. The workaround has been to use Overpass instead. With changeset submission becoming subject to a size limit as well there is, however, no similar workaround available. This would, as is, lead to many edits in polar regions becoming impossible to mapping newcomers (plenty of normal existing geometries there, coastline ways, landcover polygons, will exceed the limits).
Since the purpose of these limits is to set reasonable limits (in terms of potential data volume for reading, in terms of spatial extent of a map edit for writing) setting these limits based on surface dimensions is the more appropriate method.
### Description
The area and linear size of a bounding box should be calculated/approximated using spherical trigonometry rather than equirectangular projection. For the bounding box area that is:
```r*r*abs(sin(lat1) - sin(lat2)) * (lon2 - lon1)```
with longitude and latitude in radians, r being the Earth radius. See also https://gis.stackexchange.com/questions/59087/calculating-bounding-box-size.
For the linear size it depends a bit on what exactly you want to measure - a strait away solution would be to calculate the diagonal using haversine (https://en.wikipedia.org/wiki/Haversine_formula).
The limits of course would need to re-specified in terms of kilometers/square kilometers rather than degrees. 0.25 square degrees at the equator amounts to about 3000 square kilometers.
### Screenshots
_No response_
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/4910
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/issues/4910 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240619/07319041/attachment-0001.htm>
More information about the rails-dev
mailing list