diff pkg/imports/dma.go @ 2833:1b6840093eac

Prevent calculation of wrong UTM zones Using geography as input data type will ensure only lon/lat coordinates are fed into the calculation.
author Tom Gottfried <tom@intevation.de>
date Wed, 27 Mar 2019 15:39:52 +0100
parents 7cb027be277d
children 93fa55bce126
line wrap: on
line diff
--- a/pkg/imports/dma.go	Wed Mar 27 15:37:36 2019 +0100
+++ b/pkg/imports/dma.go	Wed Mar 27 15:39:52 2019 +0100
@@ -77,8 +77,8 @@
 const (
 	deleteDistanceMarksSQL = `
 WITH resp AS (
-  SELECT best_utm(area::geometry) AS t,
-         ST_Transform(area::geometry, best_utm(area::geometry)) AS a
+  SELECT best_utm(area) AS t,
+         ST_Transform(area::geometry, best_utm(area)) AS a
   FROM users.responsibility_areas
   WHERE country = users.current_user_country()
 )
@@ -89,8 +89,8 @@
 `
 	insertDistanceMarksSQL = `
 WITH resp AS (
-  SELECT best_utm(area::geometry) AS t,
-         ST_Transform(area::geometry, best_utm(area::geometry)) AS a
+  SELECT best_utm(area) AS t,
+         ST_Transform(area::geometry, best_utm(area)) AS a
   FROM users.responsibility_areas
   WHERE country = users.current_user_country()
 )