Skip to content

Commit 5424b97

Browse files
authored
MNT: Soft-deprecate Transformer.from_proj (#1196)
1 parent 1834213 commit 5424b97

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pyproj/transformer.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ def __init__(
319319
ProjError.clear()
320320
raise ProjError(
321321
"Transformer must be initialized using: "
322-
"'from_crs', 'from_pipeline', or 'from_proj'."
322+
"'from_crs' or 'from_pipeline'."
323323
)
324324

325325
self._local = TransformerLocal()
@@ -500,6 +500,8 @@ def from_proj(
500500
) -> "Transformer":
501501
"""Make a Transformer from a :obj:`pyproj.Proj` or input used to create one.
502502
503+
.. deprecated:: 3.4.1 :meth:`~Transformer.from_crs` is preferred.
504+
503505
.. versionadded:: 2.2.0 always_xy
504506
.. versionadded:: 2.3.0 area_of_interest
505507
@@ -781,7 +783,7 @@ def transform( # pylint: disable=invalid-name
781783
>>> xpjr, ypjr, zpjr = transprojr.transform(xpj, ypj, zpj, radians=True)
782784
>>> f"{xpjr:.3f} {ypjr:.3f} {zpjr:.3f}"
783785
'-2704026.010 -4253051.810 3895878.820'
784-
>>> transformer = Transformer.from_proj("EPSG:4326", 4326)
786+
>>> transformer = Transformer.from_crs("EPSG:4326", 4326)
785787
>>> xeq, yeq = transformer.transform(33, 98)
786788
>>> f"{xeq:.0f} {yeq:.0f}"
787789
'33 98'
@@ -897,7 +899,7 @@ def itransform(
897899
... ):
898900
... '{:.3f} {:.3f} {:.3f}'.format(*pt)
899901
'-2704214.394 -4254414.478 3894270.731'
900-
>>> transproj_eq = Transformer.from_proj(
902+
>>> transproj_eq = Transformer.from_crs(
901903
... 'EPSG:4326',
902904
... '+proj=longlat +datum=WGS84 +no_defs +type=crs',
903905
... always_xy=True,

0 commit comments

Comments
 (0)