Support for deprecated and non-deprecated objects
mwtoews opened this issue · comments
Mike Taves commented
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:
Alan D. Snow commented
Sounds reasonable. I think that adding a get_non_deprecated
method to each object that supports would be a good strategy.
Javier Jimenez Shaw commented
I was thinking on developing it. But I have some questions.
get_non_deprecated
is a method of the classCRS
, or it is a free function that takes a CRS? For the former, it would be similar tosub_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).
Alan D. Snow commented
I recommend adding a class method. Thank you!