Skip to content
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

REF: Use pyproj global context instead of the one from PROJ #723

Merged
merged 2 commits into from
Oct 20, 2020

Conversation

snowman2
Copy link
Member

@snowman2 snowman2 commented Oct 16, 2020

Also connected to #661 and #675

@snowman2
Copy link
Member Author

Hopefully this will be added to 7.2 OSGeo/PROJ#2383 🤞

@snowman2
Copy link
Member Author

Need to test: OSGeo/PROJ#1574

@snowman2
Copy link
Member Author

No core dumping, so it seems okay.

>>> from pyproj import CRS
pyproj/pyproj/__init__.py:78: UserWarning: Valid PROJ data directory not found. Either set the path using the environmental variable PROJ_LIB or with `pyproj.datadir.set_data_dir`.
  warnings.warn(str(err))
>>> from pyproj._datadir import get_global_search_path
>>> get_global_search_path()
b'~/.local/share/proj:~/miniconda/envs/proj4/share/proj'
>>> from pyproj import CRS
>>> CRS(init="epsg:4326")
/home/snowal/scripts/pyproj/pyproj/crs/crs.py:53: FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6
  return _prepare_from_string(" ".join(pjargs))
/home/snowal/scripts/pyproj/pyproj/crs/crs.py:294: FutureWarning: '+init=<authority>:<code>' syntax is deprecated. '<authority>:<code>' is the preferred initialization method. When making the change, be mindful of axis order changes: https://pyproj4.github.io/pyproj/stable/gotchas.html#axis-order-changes-in-proj-6
  projstring = _prepare_from_string(" ".join((projstring, projkwargs)))
<Geographic 2D CRS: +init=epsg:4326 +type=crs>
Name: unknown
Axis Info [ellipsoidal]:
- lon[east]: Longitude (degree)
- lat[north]: Latitude (degree)
Area of Use:
- undefined
Datum: World Geodetic System 1984
- Ellipsoid: WGS 84
- Prime Meridian: Greenwich

@snowman2
Copy link
Member Author

For reference:

def get_global_search_path():
    cdef PJ_INFO info = proj_info()
    searchpath = info.searchpath
    return searchpath

@snowman2 snowman2 marked this pull request as ready for review October 20, 2020 00:30
@snowman2 snowman2 merged commit 340971c into pyproj4:master Oct 20, 2020
@snowman2 snowman2 deleted the global_context branch October 20, 2020 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't mess with PROJ global context
1 participant