Invalid projection EPSG 54009
See original GitHub issueCode Sample, a copy-pastable example if possible
coords = [(-97.59238135821987, 43.47456565304017),
(-97.59244690469288, 43.47962399877412),
(-97.59191951546768, 43.47962728271748),
(-97.59185396090983, 43.47456565304017),
(-97.59238135821987, 43.47456565304017)]
projection = partial(pyproj.transform, pyproj.Proj(init='epsg:4326'), pyproj.Proj(init='esri:54009'))
Problem description
When trying to re-project the polygon from EPSG:4326 to ESRI:54009, I get the following error:
---------------------------------------------------------------------------
CRSError Traceback (most recent call last)
<ipython-input-33-26af3987d285> in <module>
5 (-97.59238135821987, 43.47456565304017)]
6
----> 7 projection = partial(pyproj.transform, pyproj.Proj(init='epsg:4326'), pyproj.Proj(init='esri:54009'))
8 shapely.ops.transform(projection, shapely.geometry.Polygon(coords)).area
~/miniconda3/envs/fs-ml/lib/python3.6/site-packages/pyproj/proj.py in __init__(self, projparams, preserve_units, **kwargs)
145 '116.366 39.867'
146 """
--> 147 self.crs = CRS.from_user_input(projparams if projparams is not None else kwargs)
148 # make sure units are meters if preserve_units is False.
149 if not preserve_units and "foot" in self.crs.axis_info[0].unit_name:
~/miniconda3/envs/fs-ml/lib/python3.6/site-packages/pyproj/crs.py in from_user_input(cls, value)
389 if isinstance(value, _CRS):
390 return value
--> 391 return cls(value)
392
393 def get_geod(self):
~/miniconda3/envs/fs-ml/lib/python3.6/site-packages/pyproj/crs.py in __init__(self, projparams, **kwargs)
258 raise CRSError("Invalid CRS input: {!r}".format(projparams))
259
--> 260 super(CRS, self).__init__(projstring)
261
262 @classmethod
pyproj/_crs.pyx in pyproj._crs._CRS.__init__()
CRSError: Invalid projection: +init=esri:54009 +type=crs: (Internal Proj Error: proj_create: cannot expand +init=esri:54009 +type=crs)
I can’t seem to figure out if I’m missing a definition or dependency of some kind. Some insight would be appreciated.
Thanks!
Environment Information
- pyproj version:
2.2.0
- PROJ version:
6.1.0
- PROJ data directory:
/Users/zoidberg/miniconda3/envs/fs-ml/share/proj
- Python version:
3.6.7 | packaged by conda-forge | (default, Feb 28 2019, 02:16:08) [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)]
- Operation System Information:
Darwin-18.6.0-x86_64-i386-64bit
- installation method:
conda
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Gotchas/FAQ - pyproj 3.5.0.dev0 documentation - GitHub Pages
Why does the EPSG code return when using EPSG:xxxx and not with ... CRSError: Invalid projection: +init=ESRI:54009 +type=crs: (Internal Proj Error: ...
Read more >Use pyproj new projection initialization method when setting a ...
Question. Is it already possible to write some GeoPandas code that corresponds to the new* pyproj projection initialization method using < ...
Read more >CRSError: Invalid projection: epsg:4326: for geopandas
On Windows 10, I finally had crs=CRS("epsg:3857) recognized by installing geopandas ... This code give you basic projection, known as WGS84:
Read more >Gotchas/常见问题解答— pyproj 2.1.1 文档
CRSError : Invalid projection: +init=ESRI:54009 +type=crs: (Internal Proj Error: proj_create: cannot ... 你可能想从 EPSG:4326 (wgs84)用于纬度和经度坐标。
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@daniel-j-h, the +init= syntax is deprecated. So, updating to avoid it is a good idea. I would recommend using
always_xy=True
in the transformer when updating.Docs: https://pyproj4.github.io/pyproj/stable/gotchas.html#init-auth-auth-code-should-be-replaced-with-auth-auth-code
@snowman2, that works great. Thank you for your help!