comparison pkg/octree/polygon.go @ 4765:db6c2955ee31

Fixed logical error in detecting if a ring is closed or not.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Sat, 19 Oct 2019 22:07:09 +0200
parents 5c80a33edd44
children ea570f43d7a9
comparison
equal deleted inserted replaced
4764:5c80a33edd44 4765:db6c2955ee31
365 sX, sY := s.point(0) 365 sX, sY := s.point(0)
366 eX, eY := s.point(n - 1) 366 eX, eY := s.point(n - 1)
367 367
368 const eps = 0.0000001 368 const eps = 0.0000001
369 369
370 if math.Abs(sX-eX) > eps && math.Abs(sY-eY) > eps { 370 if math.Abs(sX-eX) > eps || math.Abs(sY-eY) > eps {
371 // It's not closed! 371 // It's not closed!
372 return false 372 return false
373 } 373 }
374 374
375 var inside bool 375 var inside bool