1.9.6 and 2.1.0 behave differently in case of impossible transformation
See original GitHub issueI’m not sure that this is a right place for this issue but anyway the following code works fine with pyproj 1.9.6:
>>> import pyproj
>>> from functools import partial
>>> from shapely.geometry import Polygon
>>> from shapely.ops import transform
>>>
>>> project = partial(
... pyproj.transform,
... pyproj.Proj(init='epsg:4326'),
... pyproj.Proj(init='epsg:3857'))
>>>
>>> g1 = Polygon([(-180, -90), (-180, 90), (180, 90), (180, -90), (-180, -90)])
>>> g2 = transform(project, g1)
>>> print(g2)
POLYGON ((inf inf, inf inf, inf inf, inf inf, inf inf))
>>> pyproj.__version__
'1.9.6'
but fails with the recent 2.1.0:
>>> g2 = transform(project, g1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/denis/satellogic/env/lib/python3.6/site-packages/shapely/ops.py", line 234, in transform
zip(*func(*izip(*geom.exterior.coords))))
File "/home/denis/satellogic/env/lib/python3.6/site-packages/pyproj/transformer.py", line 307, in transform
return Transformer.from_proj(p1, p2).transform(x, y, z, radians)
File "/home/denis/satellogic/env/lib/python3.6/site-packages/pyproj/transformer.py", line 151, in transform
self._transformer._transform(inx, iny, inz, radians)
File "pyproj/_transformer.pyx", line 149, in pyproj._transformer._Transformer._transform
pyproj.exceptions.ProjError: proj_trans_generic error: tolerance condition error
Maybe @sgillies has some thoughts how to deal with it.
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
Bug listing with status RESOLVED with resolution OBSOLETE ...
... Bug:162945 - "games-fps/assaultcube (new ebuild) Assault cube, conversion of cube-engine" status:RESOLVED resolution:OBSOLETE severity:enhancement ...
Read more >Pygame tutorial Documentation - Read the Docs
As we are in an infite loop, it is impossible to quit this program ... Once the event loop, we call the pygame.quit()...
Read more >Chapter 1. Service Mesh 2.x OpenShift Container Platform 4.6
The upgrade is optional for these cases. Note. The Red Hat OpenShift Service Mesh configuration location for path normalization is different from the...
Read more >Open Source Used In ACI Multi-Site 2.1(0) - Cisco
transformation or translation of a Source form, including but ... may provide additional or different license terms and conditions.
Read more >Hope Is a Verb: My Journey of Impossible Transformation
Amy Downs was one of the last survivors to be pulled from the rubble of the 1995 Oklahoma City bombing in which a...
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
#203 restores the 1.9.6 behavior. Optional kwarg
errcheck
can be set to raise the exception instead.For webmercator, when latitudes tend to 90 deg, northing tend to infinity, so using 89.9999 is not the solution. The recommended area of use of EPSG:3857 is for latitudes between -85 and 85 degrees