-
Notifications
You must be signed in to change notification settings - Fork 211
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
RuntimeError: b"no options found in 'init' file #101
Comments
It is the epsg file, and you are correct that EPSG:404000 (or <404000> in this case) isn't in there.
My initial thought is to like the idea of distinguishing between a bad proj string, and an improper installation. My quick look at PROJ.4 suggests that this might be hard to change in pyproj. If you try to do what you described from PROJ.4's cs2cs command, you'd have a command line like this which gives an errors like this:
Thus where the "init" part of the error comes from. There are also esri numeric codes, which are in the esri file. "+init=esri:26916" That error "no options found in 'init' file" code come from PROJ.4. I'm not sure that PROJ.4 knows if epsg and related files are installed. If that is true, it would be very cumbersome to make pyproj know if PROJ.4 has access to those file. |
In my case, the conversion to or from import pyproj
in_out_crs = ['epsg:4326', 'epsg:54032']
for src, des in in_out_crs:
proj_in = pyproj.Proj('+init='+src, preserve_units=True)
proj_out = pyproj.Proj('+init='+des, preserve_units=True)
pyproj.transform(proj_in, proj_out, lon, lat) However my system
produces I am not sure but it looks like this error in Why do pyproj ship its own version of PROJ.4? System PROJ.4 is usually more updated with crs code and other enhancements. Glad to hear that removing PROJ.4 is being considered. |
@mayanksuman Your example of using the longer verson of the proj string with proj isn't a good example. EPSG:54032 is not in the data/epsg file for pyproj, so therefore it doesn't recognize the projections sting. (Nor is it in the Proj 5.2.0 data/epsg file.) When I use Proj 5.2.0 with the equivalent command line argument. It gives an error.
Still, you can use
I'm glad, too. The datum grid files should also be a github link to the newish repository for those, too. |
Current version (pyproj==2.1.0) error message seems to be a little more clear: >>> p1 = pyproj.Proj("EPSG:404000")
proj_create: crs not found
Traceback (most recent call last):
...
pyproj.exceptions.CRSError: Invalid projection: epsg:404000 |
Closing as the error messages are more clear now. Thanks for the report! |
pyproj-1.9.5.1
If I try and convert from EPSG:404000 to epsg:4326, I get:
I'm reasonably confident that this is because the given EPSG (404000) isn't in the proj file (that's what pywps suggests anyway - http://wiki.rsg.pml.ac.uk/pywps/Mapserver ).
However, I'd like to suggest that if that's the case, the exception raised should make this clear, ideally with a unique exception so it can be handled separately from exceptions where the install is bad or bad data is sent to it which also seem to raise a RuntimeError.
The text was updated successfully, but these errors were encountered: