geometry - st_isvalid 和 st_issimple 有什么区别?

标签 geometry postgis

在Postgis中有两个非常相似的函数。一是st_isValid ,另一个是st_isSimple 。我想了解多边形两者之间的区别。对于 st_isValid 我们有:

Some of the rules of polygon validity feel obvious, and others feel arbitrary (and in fact, are arbitrary).

  • Polygon rings must close.
  • Rings that define holes should be inside rings that define exterior boundaries.
  • Rings may not self-intersect (they may neither touch nor cross one another).
  • Rings may not touch other rings, except at a point.

对于 st_isSimple,我们有:

Returns true if this Geometry has no anomalous geometric points, such as self intersection or self tangency. For more information on the OGC's definition of geometry simplicity and validity, refer to "Ensuring OpenGIS compliancy of geometries"

这是否意味着任何有效的多边形都自动是简单的?

最佳答案

这两个函数都会检查几何图形的相似 OGC 定义合规性,但是为不同的几何图形定义(按维度);

根据 OGC 定义

  • 一个 [Multi]LineString 可以(应该)简单

  • 一个 [Multi]Polygon 可以(应该)有效

这意味着

  • 一个简单 [Multi]LineString始终被视为有效

  • 有效 [Multi]Polygon总是被认为是简单的(例如,它必须至少有一个简单封闭的 LineString 环)

因此答案是肯定的


严格来说,对“错误”几何类型使用 OGC 定义功能的固有检查是没有用的。

PostGIS 然而,自由地扩展了 ST_IsValid 的功能。对所有几何类型使用正确的检查

关于geometry - st_isvalid 和 st_issimple 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58586973/

相关文章:

c++ - 给定相机和 View 平面的 2D 点的 3D 坐标

Javascript Canvas沿圆轴旋转图像

javascript - 在 three.js 中将面数组添加到 BufferGeometry

sql - 使用最近邻法在 PostGIS 中绘制一条线

Python 圆适合对随机噪声不太敏感的数据点

python - 确定两个已知点之间具有给定弧长的抛物线

postgresql - 输入几何具有未知(0)几何(尽管使用了 st_transform)

postgresql - 结合多个索引的 Postgres

django - 告诉 Django 使用哪个数据库模板

python postgis ST_Contains 查询失败