简体   繁体   English

平面地图上的边界框VS球面即直线与大圆距离

[英]Bounding box on flat map VS Spherical i.e. straight line vs great circle distance

I am designing an application in which I have to tell whether an item like fb video or instagram photo lies inside a region or originated from particular region for example Melbourne. 我正在设计一个应用程序,我必须告诉我,像fb视频或instagram照片这样的项目是在一个区域内还是来自特定区域,例如墨尔本。

So till now, when I want to find bounding box for some country for example: Australia, Melbourne. 所以到现在为止,我想找一些国家的边界​​盒子,例如:澳大利亚,墨尔本。

  • I just go to this website http://boundingbox.klokantech.com/ . 我只是去这个网站http://boundingbox.klokantech.com/
  • Draw a rectangle encompassing Melbourne. 绘制一个包含墨尔本的矩形。
  • To know its GeoJson : [[[144.5937418,-38.4338593],[145.5125288,-38.4338593],[145.5125288,-37.5112737],[144.5937418,-37.5112737],[144.5937418,-38.4338593]]] 要知道它的GeoJson:[[[144.5937418,-38.4338593],[145.5125288,-38.4338593],[145.5125288,-37.5112737],[144.5937418,-37.5112737],[144.5937418,-38.4338593]]]

But, after reading great circle it says: 但是,在阅读了大圆后,它说:

Now, I am really confused, till now I thought bounding box is a rectangle and hence if I know diagonally opposite point I can draw it and any point inside it, will belong to the region rectangle encompasses. 现在,我真的很困惑,直到现在我认为边界框是一个矩形,因此如果我知道对角线相反的点我可以绘制它和它内部的任何点,将属于区域矩形包含。 But, with curved boundary the point can exist inside or outside. 但是,对于弯曲的边界,该点可以存在于内部或外部。

  • So, in below image you can see, I will always be sure that point y, z will be in melbourne. 所以,在下图中你可以看到,我将永远确定点y,z将在墨尔本。
  • But, with curved bounding box, it may not cover whole melbourne and hence I am never sure whether point lies inside melbourne or not. 但是,对于弯曲的边界框,它可能无法覆盖整个墨尔本,因此我无法确定点是否位于墨尔本内部。

在此输入图像描述

You need to make a distinction between the box itself and its representation on a flat surface. 您需要区分框本身及其在平面上的表示。 You can read about map projection to understand why/how a straight line on the curved hearth is represented as a curve on a flat sheet of paper. 您可以阅读有关地图投影的信息,以了解弯曲炉床上的直线为什么/如何在平面纸上表示为曲线。

Now, for your function to work, the most important thing is to be consistent and always use the same projection (or absence of projection!) between all of the data. 现在,为了使您的功能正常工作,最重要的是保持一致并始终在所有数据之间使用相同的投影(或没有投影!)。 You have an un-projected lat-long bounding box (so with coordinates expressed in degrees)? 你有一个未投影的lat-long边界框(坐标用度数表示)? Fine, just have your points in lat-long as well. 很好,也可以在lat-long中获得积分。 Then assess if the point is inside or not. 然后评估该点是否在内部。 The easiest is to use postgis functions like ST_WITHIN . 最简单的方法是使用像ST_WITHIN这样的postgis函数。 It is then up to you to display it or not, either as lat-long (straight line) or by first projecting it (curved line). 然后由您决定是否显示,无论是拉长(直线)还是首先投影(曲线)。

Just to make it easier to understand, think of a simpler question: Is a point south of the 30S parallel? 为了使其更容易理解,想一个更简单的问题:30S以南的一个点是否平行? If put on paper, the 30S will be a curved line, but you can still know you are south of it if you latitude is smaller than -30. 如果放在纸上,30S将是一条曲线,但如果你的纬度小于-30,你仍然可以知道你在它的南边。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何基于大圆线定义Postgis多边形 - How do i define a postgis polygon based on a great circle line Python-边界框/圆库 - Python - Bounding Box/Circle Library 为什么使用此“大圆距离”公式和Google Earth工具获得不同的值来计算空间中两点之间的距离? - Why I obtain different values calculating distance between two point in the space using this “Great-circle distance” formula and Google Earth tool? 自动化R中的大圆图制作 - Automating great-circle map production in R PostGIS中具有纬度/长度SRID的实际(大圆)距离? - Real (Great Circle) distance in PostGIS with lat/long SRID? 支持Great Circle Distance和多边形的快速python GIS库 - Fast python GIS library that supports Great Circle Distance and polygon Geoserver - 如何绘制代表两点之间的大圆的测地线 - Geoserver - How do I draw a geodesic line that represents the great circle between two points 制作边界框以处理地图上的标签碰撞 - Making bounding box for handling label collision on a map 使用Matplotlib / Cartopy / Python无法以高缩放级别(即缩小)检索地图图块 - Unable to retrieve map tiles at high zoom level (i.e. zoomed out) with Matplotlib/Cartopy/Python 如何将球面三角形映射到平面三角形? - How do I map a spherical triangle to a plane triangle?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM