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

QST: proj_crs_promote_to_3D & derived CRS #2803

Closed
snowman2 opened this issue Aug 16, 2021 · 1 comment
Closed

QST: proj_crs_promote_to_3D & derived CRS #2803

snowman2 opened this issue Aug 16, 2021 · 1 comment
Assignees
Labels
Milestone

Comments

@snowman2
Copy link
Contributor

Is it expected that proj_crs_promote_to_3D on a derived CRS returns a non-derived CRS?

Ran into this with pyproj:

>>> from pyproj import CRS
>>> crs = CRS("+proj=ob_tran +o_proj=longlat +o_lat_p=0 +o_lon_p=0 +lon_0=0")
>>> crs.is_derived
1
>>> crs.to_3d().is_derived
0

PROJ API pseudo code:

PJ_CONTEXT* context = proj_context_create();
PJ* pj = proj_create(
    context,
     "+proj=ob_tran +o_proj=longlat +o_lat_p=0 +o_lon_p=0 +lon_0=0 +ellps=WGS84 +no_defs +type=crs"
);
int is_derived = proj_is_derived_crs(context, pj); // returns 1
PJ * pj3d = proj_crs_promote_to_3D(
    context, NULL, pj
)
int is_3d_derived = proj_is_derived_crs(context, pj3d); // returns 0
proj_destroy(pj);
proj_destroy(pj3d);
proj_context_destroy(context);

PROJ Version 8,1
Operating System: Ubuntu 20
Installation method: Conda w/ conda-forge

@rouault rouault self-assigned this Aug 16, 2021
@rouault rouault added the bug label Aug 16, 2021
rouault added a commit that referenced this issue Aug 16, 2021
Implement promoteTo3D() / demoteTo2D() for DerivedGeographicCRS (fixes #2803)
github-actions bot pushed a commit that referenced this issue Aug 16, 2021
Implement promoteTo3D() / demoteTo2D() for DerivedGeographicCRS (fixes #2803)
@rouault rouault added this to the 8.1.1 milestone Aug 16, 2021
rouault added a commit that referenced this issue Aug 16, 2021
[Backport 8.1] Implement promoteTo3D() / demoteTo2D() for DerivedGeographicCRS (fixes #2803)
@snowman2
Copy link
Contributor Author

Thanks 👍

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

No branches or pull requests

2 participants