comparison pkg/octree/areas.go @ 4727:1d48be66ce69 stack-polygons

Fixed swapped coordinates ... doh!
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 17 Oct 2019 21:31:03 +0200
parents c91e759007da
children 76dbeab4a0d6
comparison
equal deleted inserted replaced
4726:c91e759007da 4727:1d48be66ce69
386 polygon := make(wkb.PolygonGeom, 1+len(hls)) 386 polygon := make(wkb.PolygonGeom, 1+len(hls))
387 387
388 // Handle shell 388 // Handle shell
389 shell := make(wkb.LinearRingGeom, len(sh)) 389 shell := make(wkb.LinearRingGeom, len(sh))
390 for j, pt := range sh { 390 for j, pt := range sh {
391 y, x := reproj(pt.X, pt.Y) 391 x, y := reproj(pt.X, pt.Y)
392 shell[j] = wkb.PointGeom{X: x, Y: y} 392 shell[j] = wkb.PointGeom{X: x, Y: y}
393 } 393 }
394 if !shell.CCW() { 394 if !shell.CCW() {
395 shell.Reverse() 395 shell.Reverse()
396 } 396 }
398 398
399 // handle holes 399 // handle holes
400 for i, hl := range hls { 400 for i, hl := range hls {
401 hole := make(wkb.LinearRingGeom, len(hl)) 401 hole := make(wkb.LinearRingGeom, len(hl))
402 for j, pt := range hl { 402 for j, pt := range hl {
403 y, x := reproj(pt.X, pt.Y) 403 x, y := reproj(pt.X, pt.Y)
404 hole[j] = wkb.PointGeom{X: x, Y: y} 404 hole[j] = wkb.PointGeom{X: x, Y: y}
405 } 405 }
406 if hole.CCW() { 406 if hole.CCW() {
407 hole.Reverse() 407 hole.Reverse()
408 } 408 }