geospatial - 球面几何和地理上的 ST_Intersect 有什么区别?
问题描述
我遇到了一种特殊情况,我试图找到(部分)位于多边形中的任何地理空间对象。当我使用WGS84 SRIDST_Intersect
在两个几何图形上应用该函数时,多边形和多边形以北的点的交集按预期返回:FALSE
SELECT ST_Intersects(
ST_GeomFromText('POLYGON((-12 0,12 0,12 50.7,-12 50.7,-12 0))', 4326),
ST_GeomFromText('POINT(6.0 50.9)', 4326)
);
现在,当我运行相同的查询时,查询返回的是两个地理而不是几何TRUE
:
SELECT ST_Intersects(
ST_GeogFromText('POLYGON((-12 0,12 0,12 50.7,-12 50.7,-12 0))'),
ST_GeogFromText('POINT(6 50.9)')
);
我希望地理版本使用最短的大圆距离来创建多边形,而几何版本在平面上创建多边形,然后才将其投影到WGS84椭圆上。
有人可以验证或揭穿我的怀疑吗?
我正在使用 PostGis 2.4.4 运行 postgresql 9.6
解决方案
Operations on geography
data type are done over a sphere. Operations on geometry
data type are done over a plane.
The shortest line joining two points on a plane is a straight line.
The shortest line joining two points on a sphere is an arc. This arc is called the great circle arc and is build by intersecting the sphere with a plan going through the 2 points and the center of the earth.
Consequently, the arc going through -12;50.7N and +12;50.7N with pass through a point near 0;51.3N. This holds true for lines but also for polygon boundaries.
This doc has some interesting graphics to understand the concepts behind the geography
type
推荐阅读
- c++ - 如何从 strtok() 访问令牌?
- flutter - Flutter:构建和添加小部件时列溢出
- sql - PostgreSQL , SQL: 具有两种场景的启动脚本
- verilog - 2 对 1 多路复用器,带 1 个单端口 ram
- amazon-web-services - 领域图集和 aws s3 的最佳实践认证概念
- xml - XML DOM——读取同一时间的两个节点
- biztalk - BizTalk 一种方式发送端口自定义行为 AfterReceiveReply 未触发
- react-native - React native 为什么会报错:× inputRange must be monotonically non-decreasing 0,NaN,NaN,NaN?
- kubernetes - 如何访问 rpi k8s 集群上的服务
- archive - 访问存档文件中的 Chromium OS 源代码