Skip to content

Commit

Permalink
libproj (#1013)
Browse files Browse the repository at this point in the history
fix test for PJ_TYPE_BOUND_CRS
  • Loading branch information
metzm committed Oct 7, 2020
1 parent 84b6fee commit 40849d5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/proj/do_proj.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ int GPJ_init_transform(const struct pj_info *info_in,
projstr = proj_as_proj_string(NULL, source_crs, PJ_PROJ_5, NULL);
if (projstr) {
indefcrs = G_store(projstr);
G_debug(1, "Input CRS definition converted from '%s' to '%s'",
G_message("Input CRS definition converted from '%s' to '%s'",
info_in->def, indefcrs);
}
proj_destroy(source_crs);
Expand All @@ -464,15 +464,15 @@ int GPJ_init_transform(const struct pj_info *info_in,
G_debug(1, "target type: %s", get_pj_type_string(info_out->pj));
outdefcrs = info_out->def;

if (proj_get_type(info_in->pj) == PJ_TYPE_BOUND_CRS) {
if (proj_get_type(info_out->pj) == PJ_TYPE_BOUND_CRS) {
target_crs = proj_get_source_crs(NULL, info_out->pj);
if (target_crs) {
const char *projstr;

projstr = proj_as_proj_string(NULL, target_crs, PJ_PROJ_5, NULL);
if (projstr) {
outdefcrs = G_store(projstr);
G_debug(1, "Output CRS definition converted from '%s' to '%s'",
G_message("Output CRS definition converted from '%s' to '%s'",
info_out->def, outdefcrs);
}
proj_destroy(target_crs);
Expand Down Expand Up @@ -730,6 +730,8 @@ int GPJ_init_transform(const struct pj_info *info_in,
/* try proj_create() with +proj=pipeline +step +inv %s +step %s" */
G_asprintf(&(info_trans->def), "+proj=pipeline +step +inv %s +step %s",
indef, outdef);
G_important_message(_("Using simplified pipeline '%s'"),
info_trans->def);

info_trans->pj = proj_create(PJ_DEFAULT_CTX, info_trans->def);
G_debug(1, "proj_create() pipeline: %s", info_trans->def);
Expand Down

0 comments on commit 40849d5

Please sign in to comment.