[postgis-devel] Possible bug in intersection of polygons

Sandro Santilli strk at kbt.io
Thu Nov 3 07:02:51 PDT 2022


On Wed, Nov 02, 2022 at 12:37:31PM +0100, Juan Pedro Pérez Alcántara wrote:

> As you can see in the screenshot, I have several polygons with a clean
> topology. A st_intersection of them, isolating only LINESTRING and
> MULTILINESTRING solutions, returns the green lines. As you can see, the
> clean topology produces clean results: all frontiers are correctly
> identified but the segment in black. I've thoroughly analyzed this segment,
> studying the as_ewkt() representation of both polygons and identifying the
> common primitive, they are identical coordinate by coordinate, but I'm at a
> loss at why st_intersection is unable to compute this exactly common
> primitive.

(E)WKT converts the stored values, using floating point numbers, to TEXT
representation so comparing EWKT may not be sufficient.

You didn't show a query so I'm just guessing you're using
ST_Intersection(a.poly, b.poly) as a way to find frontiers.

Did you consider using postgis topology to do this frontiers spotting ?
You may find that using postgis topology would give you more insights
as to what's going on with those frontiers.

--strk;



More information about the postgis-devel mailing list