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

Support for deprecated and non-deprecated objects #1367

Closed
mwtoews opened this issue Jan 8, 2024 · 3 comments · Fixed by #1383
Closed

Support for deprecated and non-deprecated objects #1367

mwtoews opened this issue Jan 8, 2024 · 3 comments · Fixed by #1383
Labels
proposal Idea for a new feature.

Comments

@mwtoews
Copy link
Contributor

mwtoews commented Jan 8, 2024

Initially from OSGeo/spatialreference.org#3 (comment) by @rouault it would be helpful to have support to see deprecated objects, and provide lists to non-deprecated objects.

For instance, here is a prototype of possible behavior to add a .is_deprecated property and a get_non_deprecated function:

import pyproj
from pyproj import CRS

crs1 = CRS.from_epsg(28473)
assert crs1.is_deprecated
crs1_nondep = pyproj.get_non_deprecated(crs1)
assert len(crs1_nondep) == 1
assert crs1_nondep[0] == CRS.from_epsg(2503)

crs2 = CRS.from_epsg(4326)
assert not crs2.is_deprecated
assert len(pyproj.get_non_deprecated(crs2)) == 0

Relevant PROJ C API:

@mwtoews mwtoews added the proposal Idea for a new feature. label Jan 8, 2024
@snowman2
Copy link
Member

snowman2 commented Jan 9, 2024

Sounds reasonable. I think that adding a get_non_deprecated method to each object that supports would be a good strategy.

@jjimenezshaw
Copy link
Contributor

I was thinking on developing it. But I have some questions.

  • get_non_deprecated is a method of the class CRS, or it is a free function that takes a CRS? For the former, it would be similar to sub_crs_list. For the later, where should be this function?
  • proj_get_non_deprecated so far is only done for CRS (looking at the documentation).

@snowman2
Copy link
Member

I recommend adding a class method. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Idea for a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants