Opened 3 years ago

Closed 19 months ago

#4935 closed defect (wontfix)

Bug in ST_LineCrossingDirection ?

Reported by: strk Owned by: pramsey
Priority: medium Milestone: PostGIS 3.4.0
Component: postgis Version:
Keywords: Cc:

Description

The manual page about ST_LineCrossingDirection is not very clear on the matter, but I would expect this to return -1 (crosses left) instead of 1 (crosses right):

SELECT ST_LineCrossingDirection(
 'LINESTRING(20 37,23 37,20 34,20 37)', -- g1
 'LINESTRING(20 34,20.5 33)' --g2
);

Attachments (1)

LineCrossingDirectionBug.png (3.4 KB ) - added by strk 3 years ago.
LineCrossingDirection inputs

Download all attachments as: .zip

Change History (9)

comment:1 by strk, 3 years ago

See image, the first geometry passed to the function is the blue triangle. The green line clearly stands on the *left* side of it, no ?

LineCrossingDirection inputs

comment:2 by pramsey, 3 years ago

Uh, not sure. Segment by segment, it's on the left of segment two and the right of segment three. A closed string has a "left" and a "right" deterministicly in a way an open string does not necessarily.

comment:3 by strk, 3 years ago

I think the problem is actually well defined, even if the blue line was open. The green line keeps being on the left side.

Maybe ST_LineCrossingDirection is not the right function to use for solving the problem. Should the documentation is not clear about the behaviour: "hat kind of crossing behavior exists between them" - https://postgis.net/docs/ST_LineCrossingDirection.html

comment:4 by robe, 3 years ago

Milestone: PostGIS 3.1.3PostGIS 3.1.4

In prep for 3.1.3 release

comment:5 by robe, 3 years ago

Milestone: PostGIS 3.1.4PostGIS 3.1.5

comment:6 by robe, 3 years ago

Milestone: PostGIS 3.1.5PostGIS 3.3.0

comment:7 by robe, 2 years ago

Milestone: PostGIS 3.3.0PostGIS 3.4.0

comment:8 by pramsey, 19 months ago

Resolution: wontfix
Status: newclosed

I'm not up to change this as I don't think it's a problem.

Note: See TracTickets for help on using tickets.