diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-02-16 23:06:34 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-02-16 23:06:34 +0100 |
| commit | 4c61b3c882c8c47d40c3950f95c640710804835f (patch) | |
| tree | 0076d52af795973709766f5182d6f01da614554f /src | |
| parent | 9689243b940e6b908db377dee357f422a00129e8 (diff) | |
| download | PROJ-4c61b3c882c8c47d40c3950f95c640710804835f.tar.gz PROJ-4c61b3c882c8c47d40c3950f95c640710804835f.zip | |
Make sure proj_get_source_crs() and proj_get_target_crs() work on 'pseudo' PJ object returned by proj_create_crs_to_crs() when there are several alternatives
Diffstat (limited to 'src')
| -rw-r--r-- | src/iso19111/c_api.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/iso19111/c_api.cpp b/src/iso19111/c_api.cpp index 240d11b3..79732bab 100644 --- a/src/iso19111/c_api.cpp +++ b/src/iso19111/c_api.cpp @@ -1736,6 +1736,10 @@ PJ *proj_get_source_crs(PJ_CONTEXT *ctx, const PJ *obj) { } return nullptr; } + if (!obj->alternativeCoordinateOperations.empty()) { + return proj_get_source_crs(ctx, + obj->alternativeCoordinateOperations[0].pj); + } proj_log_error(ctx, __FUNCTION__, "Object is not a BoundCRS or a CoordinateOperation"); return nullptr; @@ -1771,6 +1775,10 @@ PJ *proj_get_target_crs(PJ_CONTEXT *ctx, const PJ *obj) { } return nullptr; } + if (!obj->alternativeCoordinateOperations.empty()) { + return proj_get_target_crs(ctx, + obj->alternativeCoordinateOperations[0].pj); + } proj_log_error(ctx, __FUNCTION__, "Object is not a BoundCRS or a CoordinateOperation"); return nullptr; |
