I used code as below to calculate circle coordinates for give center point:
from shapely import ops
from shapely.geometry import Point
from pyproj import Proj, transform
from functools import partial
def circleByPoint(lat, lon, km=5):
proj_wgs84 = Proj('+proj=longlat +datum=WGS84')
aeqd_proj = '+proj=aeqd +lat_0={lat} +lon_0={lon} +x_0=0 +y_0=0'
project = partial(transform,
Proj(aeqd_proj.format(lat=lat, lon=lon)), proj_wgs84)
buf = Point(0, 0).buffer(km * 1000) # distance in metres
return ops.transform(project, buf).exterior.coords[:]
after I upgraded to pyproj 3.6.0, I got wanrning message
C:\Program Files\python\Lib\site-packages\shapely\ops.py:276: FutureWarning: This function is deprecated. See: https://pyproj4.github.io/pyproj/stable/gotchas.html#upgrading-to-pyproj-2-from-pyproj-1
shell = type(geom.exterior)(zip(*func(*zip(*geom.exterior.coords))))
Then I checked https://pyproj4.github.io/pyproj/stable/gotchas.html#upgrading-to-pyproj-2-from-pyproj-1, there is a example as below:
Old code:
from functools import partial
from pyproj import Proj, transform
proj_4326 = Proj(init="epsg:4326")
proj_3857 = Proj(init="epsg:3857")
transformer = partial(transform, proj_4326, proj_3857)
transformer(12, 12)
New code:
from pyproj import Transformer
transformer = Transformer.from_crs("EPSG:4326", "EPSG:3857")
transformer.transform(12, 12)
But I still don't know how to modify my code, does anyone help me?
I got the answer as below: