diff pkg/imports/fd.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/fd.go	Wed Mar 27 15:37:36 2019 +0100
+++ b/pkg/imports/fd.go	Wed Mar 27 15:39:52 2019 +0100
@@ -139,8 +139,8 @@
 
 	deleteFairwayDimensionSQL = `
 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()
 )
@@ -155,8 +155,8 @@
 	// avoid errors due to reprojection.
 	insertFairwayDimensionSQL = `
 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()
 )