Skip to content

Commit

Permalink
lib/proj
Browse files Browse the repository at this point in the history
use proj_normalize_for_visualization() for operations
  • Loading branch information
metzm committed Sep 14, 2019
1 parent 4c96cd1 commit 5e853cb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/proj/do_proj.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,6 @@ int GPJ_init_transform(const struct pj_info *info_in,
if (source_crs && target_crs) {
PJ_OPERATION_FACTORY_CONTEXT *operation_ctx;
PJ_OBJ_LIST *op_list;
PJ *op;

operation_ctx = proj_create_operation_factory_context(NULL, NULL);
/* constrain by area ? */
Expand All @@ -420,8 +419,20 @@ int GPJ_init_transform(const struct pj_info *info_in,
const char *str;
const char *projstr;
PJ_PROJ_INFO pj_info;
PJ *op, *op_norm;

op = proj_list_get(NULL, op_list, i);
op_norm = proj_normalize_for_visualization(PJ_DEFAULT_CTX, op);

if (!op_norm) {
G_warning(_("proj_normalize_for_visualization() failed for operation %d"),
i + 1);
}
else {
proj_destroy(op);
op = op_norm;
}

projstr = proj_as_proj_string(NULL, op,
PJ_PROJ_5, NULL);
pj_info = proj_pj_info(op);
Expand Down

0 comments on commit 5e853cb

Please sign in to comment.