Skip to content

Commit

Permalink
libproj: Use PJ_TYPE_BOUND_CRS only if Proj version >= 6 (#2744)
Browse files Browse the repository at this point in the history
  • Loading branch information
HuidaeCho committed Jan 12, 2023
1 parent 76d27ff commit c6badaa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/proj/get_proj.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,15 @@ int pj_get_kv(struct pj_info *info, const struct Key_Value *in_proj_keys,
if (perr)
G_fatal_error("PROJ 5 error %d", perr);

#if PROJ_VERSION_MAJOR >= 6
if (proj_get_type(pj) == PJ_TYPE_BOUND_CRS) {
PJ *source_crs = proj_get_source_crs(pjc, pj);
if (source_crs) {
proj_destroy(pj);
pj = source_crs;
}
}
#endif
#endif

info->pj = pj;
Expand Down Expand Up @@ -426,13 +428,15 @@ int pj_get_string(struct pj_info *info, char *str)
return -1;
}

#if PROJ_VERSION_MAJOR >= 6
if (proj_get_type(pj) == PJ_TYPE_BOUND_CRS) {
PJ *source_crs = proj_get_source_crs(pjc, pj);
if (source_crs) {
proj_destroy(pj);
pj = source_crs;
}
}
#endif
#else
/* Set finder function for locating datum conversion tables PK */
pj_set_finder(FINDERFUNC);
Expand Down

0 comments on commit c6badaa

Please sign in to comment.