Use correct "transform" function signature
authorThierry Florac <tflorac@ulthar.net>
Sat, 27 Jan 2018 03:26:56 +0100
changeset 23 58b7f395fb72
parent 22 40c4be8aad07
child 24 20bbf3a5a0b4
Use correct "transform" function signature
src/pyams_gis/rpc/json/__init__.py
--- a/src/pyams_gis/rpc/json/__init__.py	Fri Jan 26 17:17:00 2018 +0100
+++ b/src/pyams_gis/rpc/json/__init__.py	Sat Jan 27 03:26:56 2018 +0100
@@ -57,14 +57,14 @@
             'area': area,
             'srid': from_srid
         }
-    point1 = transform(area['x1'], area['y1'])
-    point2 = transform(area['x2'], area['y2'])
+    point1 = transform((area['x1'], area['y1']), from_srid, to_srid)
+    point2 = transform((area['x2'], area['y2']), from_srid, to_srid)
     return {
         'area': {
-            'x1': point1['longitude'],
-            'y1': point1['latitude'],
-            'x2': point2['longitude'],
-            'y2': point2['latitude']
+            'x1': point1['point']['longitude'],
+            'y1': point1['point']['latitude'],
+            'x2': point2['point']['longitude'],
+            'y2': point2['point']['latitude']
         },
-        'srid': to_srid
+        'srid': point1['srid']
     }