From 9800f66e594f6d3bd18abb4aa97ba40927717578 Mon Sep 17 00:00:00 2001 From: Ben Mather Date: Tue, 17 Nov 2020 09:36:51 +1100 Subject: [PATCH] pyproj syntax has changed in v6 --- pycurious/mapping.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pycurious/mapping.py b/pycurious/mapping.py index 84bc7e6..ffefd56 100644 --- a/pycurious/mapping.py +++ b/pycurious/mapping.py @@ -78,9 +78,10 @@ def transform_coordinates(x, y, epsg_in, epsg_out): """ import pyproj - proj_in = pyproj.Proj("+init=EPSG:" + str(epsg_in)) - proj_out = pyproj.Proj("+init=EPSG:" + str(epsg_out)) - return pyproj.transform(proj_in, proj_out, x, y) + proj_in = pyproj.CRS("EPSG:" + str(epsg_in)) + proj_out = pyproj.CRS("EPSG:" + str(epsg_out)) + transformer = pyproj.Transformer.from_crs(proj_in, proj_out, always_xy=True) + return transformer.transform(x,y) def convert_extent(extent_in, epsg_in, epsg_out):