Mercurial > gemma
comparison pkg/controllers/octreecross.go @ 755:1a1a8b5f2d02
Vertical traversal of octree for cross sections. WIP.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 24 Sep 2018 18:41:29 +0200 |
parents | e6f8d58434f4 |
children | 5e14000829d1 |
comparison
equal
deleted
inserted
replaced
754:105c421f99b1 | 755:1a1a8b5f2d02 |
---|---|
30 } | 30 } |
31 defer stmt.Close() | 31 defer stmt.Close() |
32 | 32 |
33 dst := make(models.GeoJSONLineCoordinates, len(src)) | 33 dst := make(models.GeoJSONLineCoordinates, len(src)) |
34 for i, s := range src { | 34 for i, s := range src { |
35 d := &dst[i] | |
36 if err := stmt.QueryRowContext( | 35 if err := stmt.QueryRowContext( |
37 ctx, | 36 ctx, |
38 s.Lat, s.Lon, | 37 s.Lat, s.Lon, |
39 fromEPSG, toEPSG, | 38 fromEPSG, toEPSG, |
40 ).Scan(&d.Lat, &d.Lon); err != nil { | 39 ).Scan(&dst[i].Lat, &dst[i].Lon); err != nil { |
41 return nil, err | 40 return nil, err |
42 } | 41 } |
43 } | 42 } |
44 return dst, nil | 43 return dst, nil |
45 } | 44 } |