计算 2 个纵向间隔的并集(可能环绕 180 度)
故事:
我有一个 LatLongBounds
类,它通过纬度间隔(以北和南为界 - 对于这个问题并不重要)和纵向间隔(以北和南为界)表示地球表面的一个区域。东和西;均标准化为范围 [-180, 180] - 负数为西风方向)。
为了能够表示跨越 180 度子午线的区域,西边的值可以设置为大于东边(例如,范围西边 = 170,东边 = -170 将跨越所述子午线)。实际上,纵向间隔可以以 180 度(或等效的 -180 度)环绕。
我的问题:
有人对如何计算可能以 180 度环绕的两个纵向间隔的最小并集有任何建议吗?
谢谢。
The story:
I have a LatLongBounds
class that represents an area on the surface of the earth by a latitudinal interval (bounded by north & south - not important to this question) and a longitudinal interval (bounded by east and west; both normalized to a range [-180, 180] - negative being a westerly direction).
In order to be able to represent an area that straddles the 180 degree meridian the value of west may be set to be greater than east (eg. the range west = 170, east = -170 will straddle said meridian). In effect the longitudinal interval may wrap around at 180 degrees (or equivalently -180 degrees).
My Question:
Does anyone have any suggestions as to how I can calculate the minimum union of two longitudinal intervals that may wrap around at 180 degrees.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是你要考虑你的“领域”的“方向”。对于您的示例 (170E,170W),如果您考虑 a 和 b 之间的范围,则这是一个较小的区域,但如果您考虑 b 和 a 之间的区域,则这是一个很大的区域。坐标总是以相同的顺序给出吗?
“最小并集”是指交集吗?
在进行这些计算时,您可能会考虑更改坐标系,将其中一个半球中的所有坐标添加 180 度,并始终沿同一方向“行进”。
The issue is which "direction" to you want to consider your "area". With your example (170E,170W), this is a smaller area if you consider the range to be between a and b, but a large area if you consider the area between b and a. Will the coordinates always be given in the same order?
By "minimum union", do you mean the intersection?
You might consider changing your coordinate system while you are doing these calculations, adding 180 degrees to all coordinates in one of the hemispheres, and always "traveling" in the same direction.