Re: [postgis-users] Bug? Strange code in lwline_crossing_direction()

2020-04-19 Thread Komяpa
The code was born in 2009 by Paul Ramsey. https://github.com/postgis/postgis/commit/6adec1b2be11e7d0fe5c482e50ce0872c400cfd6#diff-5705dd09236e9a6e8fa456b7b9599ed7R205-R211 Either a comment is needed on this, or a patch. Easiest way to check a hypothesis that this may be a bug is to change L526 (g

Re: [postgis-users] Bug? Strange code in lwline_crossing_direction()

2020-04-19 Thread Kohei KaiGai
Hello Darafei, It looks to me the first_cross should be SEG_CROSS_RIGHT, not SEG_CROSS_LEFT here. If it is expected, L574 shall never become true. Right? | at L526: | if ( this_cross == SEG_CROSS_RIGHT ) | { | LWDEBUG(4,"this_cross == SEG_CROSS_RIGHT"); | cross_right++; | if ( ! first

Re: [postgis-users] Bug? Strange code in lwline_crossing_direction()

2020-04-19 Thread Komяpa
Hi, the link you have is setting variable this_cross, and L526 sets first_cross from it if it was not set and there is LEFT or RIGHT cross (not no-cross and not COLLINEAR). Looks expected to me. On Sat, Apr 18, 2020 at 6:32 PM Kohei KaiGai wrote: > > Hello, > > I noticed a strange code at liblwg