tidwall / tg

Geometry library for C - Fast point-in-polygon
MIT License
562 stars 14 forks source link

Intersects Linestring #3

Closed akhenakh closed 12 months ago

akhenakh commented 12 months ago

Nice work with this new project!

It seems those 3 intersections tests should intersect but aren't

                input1: LINESTRING(1 0,2 0)
                input2: LINESTRING(0 0,3 0)

                input1: LINESTRING(1 1,2 2)
                input2: LINESTRING(0 0,3 3)

                input1: LINESTRING(-0.5 0.5,-0.1 0.1)
                input2: LINESTRING(-1 1,1 -1)

For the context I'm wrapping tg in a CGO api and reusing some tests from https://github.com/peterstace/simplefeatures

func Intersects(g1, g2 *Geom) bool {
    return bool(C.tg_geom_intersects(g1.cg, g2.cg))
}
tidwall commented 12 months ago

Thanks!