如何创建线以可视化PostGIS中多边形要素之间的差异?
我有一个polygon_b带有某些面要素的PostGIS表。还有一个表格polygon_a,其中包含与多边形相同的多边形,polygon_b但变化较小。现在,我想创建线条以可视化多边形要素之间的差异。 我想这ST_ExteriorRing和ST_Difference将做的工作,但在WHERE子句似乎是相当棘手。 CREATE VIEW line_difference AS SELECT row_number() over() AS gid, g.geom::geometry(LineString, yourSRID) AS geom FROM (SELECT (ST_Dump(COALESCE(ST_Difference(ST_ExteriorRing(polygon_a.geom), ST_ExteriorRing(polygon_b.geom))))).geom AS geom FROM polygon_a, polygon_b WHERE -- ? ) AS g; 谁能帮我? 编辑1 正如“倾斜”所发布的,我已经尝试过,ST_Overlaps(polygon_a.geom, polygon_b.geom) AND NOT ST_Touches(polygon_a.geom, polygon_b.geom)但结果与预期不符。 CREATE VIEW line_difference AS SELECT row_number() over() AS gid, g.geom::geometry(LineString, your_SRID) AS …