comparison pkg/controllers/cross.go @ 653:7aeacd7f150b

Cross sections: Take and produce valid GeoJSON.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 14 Sep 2018 12:01:45 +0200
parents cf62cb84fa23
children baa31814717c
comparison
equal deleted inserted replaced
652:f5ecd1d72a6e 653:7aeacd7f150b
33 _ = csi.Properties.Date 33 _ = csi.Properties.Date
34 34
35 var rows *sql.Rows 35 var rows *sql.Rows
36 36
37 rows, err = db.QueryContext( 37 rows, err = db.QueryContext(
38 req.Context(), crossSQL, csi.Coordinates.AsWKB()) 38 req.Context(), crossSQL, csi.Geometry.Coordinates.AsWKB())
39 if err != nil { 39 if err != nil {
40 return 40 return
41 } 41 }
42 defer rows.Close() 42 defer rows.Close()
43 43
57 57
58 joined := segments.Join() 58 joined := segments.Join()
59 59
60 jr = JSONResult{ 60 jr = JSONResult{
61 Result: &models.CrossSectionOutput{ 61 Result: &models.CrossSectionOutput{
62 Type: "Feature", 62 Type: "Feature",
63 Geometry: "MultLineString", 63 Geometry: models.CrossSectionOutputGeometry{
64 Coordinates: joined, 64 Type: "MultiLineString",
65 Coordinates: joined,
66 },
67 Properties: map[string]interface{}{},
65 }, 68 },
66 } 69 }
67 70
68 return 71 return
69 } 72 }