<p></p>
<h3 dir="auto">Problem</h3>
<p dir="auto">Since <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2361570225" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/4908" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/4908/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/4908">#4908</a> 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.</p>
<p dir="auto">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).</p>
<p dir="auto">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.</p>
<h3 dir="auto">Description</h3>
<p dir="auto">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:</p>
<p dir="auto"><code class="notranslate">r*r*abs(sin(lat1) - sin(lat2)) * (lon2 - lon1)</code></p>
<p dir="auto">with longitude and latitude in radians, r being the Earth radius. See also <a href="https://gis.stackexchange.com/questions/59087/calculating-bounding-box-size" rel="nofollow">https://gis.stackexchange.com/questions/59087/calculating-bounding-box-size</a>.</p>
<p dir="auto">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 (<a href="https://en.wikipedia.org/wiki/Haversine_formula" rel="nofollow">https://en.wikipedia.org/wiki/Haversine_formula</a>).</p>
<p dir="auto">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.</p>
<h3 dir="auto">Screenshots</h3>
<p dir="auto"><em>No response</em></p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/4910">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLNA6R6V3X32WFWIWG3ZIGFPZAVCNFSM6AAAAABJSEJTRCVHI2DSMVQWIX3LMV43ASLTON2WKOZSGM3DENBXGMZDQMY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLMHBQVSLGLPKJUFWUDZIGFPZA5CNFSM6AAAAABJSEJTRCWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHIZUD3IM.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/issues/4910</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/4910",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/4910",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>