changeset 1918:62b5f6e48e82

Distance marks virtual/Waterway gauge imports: Better fix for swapped Lat/Lon fields.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 18 Jan 2019 19:44:15 +0100
parents 2fda3f17e47c
children 500d07d043bc
files pkg/imports/dmv.go pkg/imports/wg.go
diffstat 2 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/imports/dmv.go	Fri Jan 18 18:34:03 2019 +0100
+++ b/pkg/imports/dmv.go	Fri Jan 18 19:44:15 2019 +0100
@@ -85,10 +85,10 @@
 )
 VALUES (
   ($1::char(2), $2::char(3), $3::char(5), $4::char(5), $5::int),
-  ST_SetSRID(ST_MakePoint($7, $6), 4326)::geography,
+  ST_SetSRID(ST_MakePoint($6, $7), 4326)::geography,
   $8
 ) ON CONFLICT (location_code) DO UPDATE SET
-  geom = ST_SetSRID(ST_MakePoint($7, $6), 4326)::geography,
+  geom = ST_SetSRID(ST_MakePoint($6, $7), 4326)::geography,
   related_enc = $8
 `
 )
@@ -188,7 +188,7 @@
 			code.FairwaySection,
 			code.Orc,
 			code.Hectometre,
-			float64(*dr.Lat), float64(*dr.Lon),
+			float64(*dr.Lon), float64(*dr.Lat),
 			string(*dr.Relenc),
 		); err != nil {
 			return nil, err
--- a/pkg/imports/wg.go	Fri Jan 18 18:34:03 2019 +0100
+++ b/pkg/imports/wg.go	Fri Jan 18 19:44:15 2019 +0100
@@ -382,7 +382,7 @@
 			ic.code.Orc,
 			ic.code.Hectometre,
 			string(*dr.Objname.Loc),
-			int64(*dr.Lat), int64(*dr.Lon),
+			int64(*dr.Lon), int64(*dr.Lat),
 			from,
 			to,
 			&validity,