Opened 3 years ago

Closed 2 years ago

#3647 closed defect (fixed)

non-noded intersection error when running st_node

Reported by: mathiasversichele Owned by: robe
Priority: blocker Milestone: PostGIS 2.4.0
Component: postgis Version: 2.2.x
Keywords: Cc:

Description

Hi all,

I've been struggling with "non intersecting node" issues when trying to run st_node, which seems weird to me as st_node is supposed to fix these issues in the first place, right ?

The table dump in attachment illustrates the problem.

When running the following query:

select st_node(st_collect(geom)) from input_geoms;

I get the following error:

ERROR: GEOSUnaryUnion: TopologyException?: found non-noded intersection between LINESTRING (1.0708e+06 786844, 1.07094e+06 786875) and LINESTRING (1.07097e+06 786883, 1.0708e+06 786844) at 1070922.7377618756 786871.60839152802

The input geoms are already snapped to 10meters precision.

I'm running

POSTGIS="2.1.8 r13780" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.11.2, released 2015/02/10" LIBXML="2.9.1" LIBJSON="UNKNOWN" RASTER

Attachments (1)

input_geoms.sql (3.0 MB) - added by mathiasversichele 3 years ago.

Change History (12)

Changed 3 years ago by mathiasversichele

Attachment: input_geoms.sql added

comment:1 Changed 3 years ago by strk

Confirmed with:

POSTGIS="2.1.4 r12966" GEOS="3.6.0dev-CAPI-1.10.0 r4208" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.1, released 2013/08/26" LIBXML="2.9.1" LIBJSON="UNKNOWN" RASTER

The problem is in GEOSUnaryUnion, so worth filing a ticket in GEOS too: https://trac.osgeo.org/geos

It's worth to point out that GEOS has a GEOSNode function since version 3.4.0, but PostGIS is not using it. Would be worth a test against this case.

comment:2 Changed 3 years ago by strk

I made a quick test and can confirm that using GEOSNode internally does succeed at giving an answer. Time to tweak PostGIS (NOTE: it would still take GEOS-3.4.0+ to have GEOSNode available, and current testsuite expects a slightly different result which would need further work than my own patch).

comment:3 Changed 3 years ago by robe

Owner: changed from pramsey to strk

comment:4 Changed 3 years ago by mathiasversichele

Thanks for the answers! Just managed to node and polygonize my entire table in RGeos. Do I still create a ticket with this test-case on the geos trac ?

comment:5 Changed 3 years ago by strk

No need for a GEOS ticket, thanks

comment:6 Changed 3 years ago by robe

Milestone: PostGIS 2.3.1PostGIS 2.3.2

comment:7 Changed 3 years ago by robe

Milestone: PostGIS 2.3.2PostGIS 2.4.0

comment:9 Changed 2 years ago by dbaston

Owner: changed from strk to pramsey
Priority: mediumblocker

comment:10 Changed 2 years ago by robe

Owner: changed from pramsey to robe

comment:11 Changed 2 years ago by robe

Resolution: fixed
Status: newclosed

In 15571:

Reduce likeliness of non-noded intersections when using ST_Node
Patch contributed by Wouter Geraedts (with minor adjustments to the doc)
Closes #3647
Closes ​https://github.com/postgis/postgis/pull/136

Note: See TracTickets for help on using tickets.