Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#4962 closed enhancement (fixed)

Adding a linestring to the topology can load topology multiple times

Reported by: strk Owned by: strk
Priority: medium Milestone: PostGIS 3.2.0
Component: topology Version: master
Keywords: Cc:

Description

I think this is happening starting on the change which implemented cb_getFaceContainingPoint as a wrapper to a plPGSQL rather than C: the loadTopology is loaded multiple times because the plpgsql function will possibly call other C implemented functions GetRingEdges which re-loads the topology again in the same session.

It would be useful to do everything internally to avoid the duplicated topology loading, which should improve speed and possibly also avoid other unwanted effects of such mislayered behaviour

Attachments (1)

wrongResult.png (20.4 KB ) - added by strk 3 years ago.

Download all attachments as: .zip

Change History (7)

comment:2 by Sandro Santilli <strk@…>, 3 years ago

Resolution: fixed
Status: newclosed

In b565cc6/git:

Rewrite GetFaceContainingPoint in C

Closes #4962

comment:3 by strk, 3 years ago

I'm reopening this because the choice of using lw_segment_side to determine the side the query point falls on the closest edge was WRONG and produces invalid results. I'll have to add a regress test for this case and find another solution.

by strk, 3 years ago

Attachment: wrongResult.png added

comment:4 by strk, 3 years ago

Here's an image of the wrong result. The closest segment is in tick red, the line direction goes down, so the point is on the left side, but lw_segment_side returns 1 (right)

comment:6 by Sandro Santilli <strk@…>, 3 years ago

In 6571dc8/git:

Use angles to determine side of point on edge when closest is a vertex

Closes #4962 again

Includes regress test for getFaceContainingPoint
(failing without the change)

Note: See TracTickets for help on using tickets.