diff 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
line wrap: on
line diff
--- a/pkg/controllers/cross.go	Fri Sep 14 11:44:27 2018 +0200
+++ b/pkg/controllers/cross.go	Fri Sep 14 12:01:45 2018 +0200
@@ -35,7 +35,7 @@
 	var rows *sql.Rows
 
 	rows, err = db.QueryContext(
-		req.Context(), crossSQL, csi.Coordinates.AsWKB())
+		req.Context(), crossSQL, csi.Geometry.Coordinates.AsWKB())
 	if err != nil {
 		return
 	}
@@ -59,9 +59,12 @@
 
 	jr = JSONResult{
 		Result: &models.CrossSectionOutput{
-			Type:        "Feature",
-			Geometry:    "MultLineString",
-			Coordinates: joined,
+			Type: "Feature",
+			Geometry: models.CrossSectionOutputGeometry{
+				Type:        "MultiLineString",
+				Coordinates: joined,
+			},
+			Properties: map[string]interface{}{},
 		},
 	}