New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Definition parameter +no_defs crashes pyproj #22
Comments
I'm running pyproj 1.9.4. from pyproj import Proj, transform
p_grid = Proj('+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +units=m +nadgrids=@null +no_defs +x_0=5113560.997131 +y_0=2662158.879021')
p_wgs = Proj('+init=epsg:4326')
transform(p_wgs, p_grid, -87.6, 34.5, 0)
>>> (-4626894.447280438, 6758297.919468232, 0.0) I tried transforming a point to that projection. It gave the above output and didn't crash. I couldn't replicate a crash. Could you give a code sample that demonstrates the crash? Or try the above code. |
import pyproj Version 1.8.9, but the crashing code is the same On Mon, Oct 5, 2015 at 6:26 PM, Micah Cochran notifications@github.com
|
Using that Proj.4 definition in With the exception of +a= and +b= parameters, everything else in that string is nonsensical input for |
I guess that the library already ignores it. We should check if the On Tue, Oct 6, 2015 at 11:21 AM, Micah Cochran notifications@github.com
|
Underneath the Geod Cython Code there is a C port of GeographicLib (natively a C++ library), which is included in the Proj.4 library. Interestingly enough, there is a Python port of GeographicLib, but it does not include other ellipses. I assume the intent of the Geod class is mirror the geod command. The Checking if the parameter contains a '=' before splitting is a great workaround. Would you like to code it or would you like someone else to code the workaround? |
I can do it. I will just fork it and push the change to you. On Tue, Oct 6, 2015 at 5:25 PM, Micah Cochran notifications@github.com
|
Can this be closed? |
I think so. The issue is fixed and there is a unit test for it.
|
Any definition parameter without an '=' will actually crash the logic on init.py, line 698:
File "/usr/local/lib/python2.7/dist-packages/pyproj/init.py", line 698, in new
k,v = kvpair.split('=')
The definition I used was: +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +units=m +nadgrids=@null +no_defs +x_0=5113560.997131 +y_0=2662158.879021
The text was updated successfully, but these errors were encountered: