spatial-go / geoos

A library provides spatial data and geometric algorithms
http://www.spatial-go.com
GNU Lesser General Public License v2.1
612 stars 130 forks source link

Intersects bug #106

Open mercurius0610 opened 6 months ago

mercurius0610 commented 6 months ago
polygon, _ := geoencoding.Decode([]byte(`MULTIPOLYGON(((121.308225482526 31.3977223795235,121.320481 31.399024,121.322129 31.386769,121.304536 31.385516,121.300412 31.393475,121.308225482526 31.3977223795235)),((121.308225482526 31.3977223795235,121.308156 31.397715,121.308337 31.397783,121.308225482526 31.3977223795235)))`), geoencoding.WKT)  
line, _ := geoencoding.Decode([]byte(`linestring(121.318481 31.40068, 121.317523 31.393429, 121.324714 31.392735, 121.325045 31.390363)`), geoencoding.WKT)  

a := planar.NewMegrezAlgorithm()  
i, e := a.Intersects(polygon, line)  
fmt.Println(i, e)  
mercurius0610 commented 6 months ago

output false nil