mirror of https://github.com/tidwall/tile38.git
Allow for INTERSECTS command for points
Thanks to @rbastian for finding this bug. fixes #26
This commit is contained in:
parent
0afdf67c90
commit
3c8b9b4110
geojson
|
@ -224,6 +224,10 @@ func withinObjectShared(g Object, o Object, pin func(v Polygon) bool, mpin func(
|
||||||
switch v := o.(type) {
|
switch v := o.(type) {
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
|
case Point:
|
||||||
|
return g.WithinBBox(v.CalculatedBBox())
|
||||||
|
case SimplePoint:
|
||||||
|
return g.WithinBBox(v.CalculatedBBox())
|
||||||
case Polygon:
|
case Polygon:
|
||||||
if len(v.Coordinates) == 0 {
|
if len(v.Coordinates) == 0 {
|
||||||
return false
|
return false
|
||||||
|
@ -267,6 +271,10 @@ func intersectsObjectShared(g Object, o Object, pin func(v Polygon) bool, mpin f
|
||||||
switch v := o.(type) {
|
switch v := o.(type) {
|
||||||
default:
|
default:
|
||||||
return false
|
return false
|
||||||
|
case Point:
|
||||||
|
return g.IntersectsBBox(v.CalculatedBBox())
|
||||||
|
case SimplePoint:
|
||||||
|
return g.IntersectsBBox(v.CalculatedBBox())
|
||||||
case Polygon:
|
case Polygon:
|
||||||
if len(v.Coordinates) == 0 {
|
if len(v.Coordinates) == 0 {
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in New Issue