diff options
Diffstat (limited to 'src/4D_api.cpp')
| -rw-r--r-- | src/4D_api.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/4D_api.cpp b/src/4D_api.cpp index d366aba8..94458398 100644 --- a/src/4D_api.cpp +++ b/src/4D_api.cpp @@ -1843,6 +1843,7 @@ PJ *proj_create_crs_to_crs_from_pj (PJ_CONTEXT *ctx, const PJ *source_crs, cons const char* authority = nullptr; double accuracy = -1; bool allowBallparkTransformations = true; + bool forceOver = false; for (auto iter = options; iter && iter[0]; ++iter) { const char *value; if ((value = getOptionValue(*iter, "AUTHORITY="))) { @@ -1859,7 +1860,13 @@ PJ *proj_create_crs_to_crs_from_pj (PJ_CONTEXT *ctx, const PJ *source_crs, cons "Invalid value for ALLOW_BALLPARK option."); return nullptr; } - } else { + } + else if ((value = getOptionValue(*iter, "FORCE_OVER="))) { + if (ci_equal(value, "yes")) { + forceOver = true; + } + } + else { std::string msg("Unknown option :"); msg += *iter; ctx->logger(ctx->logger_app_data, PJ_LOG_ERROR, msg.c_str()); @@ -1913,6 +1920,8 @@ PJ *proj_create_crs_to_crs_from_pj (PJ_CONTEXT *ctx, const PJ *source_crs, cons return nullptr; } + ctx->forceOver = forceOver; + PJ* P = proj_list_get(ctx, op_list, 0); assert(P); @@ -1920,11 +1929,14 @@ PJ *proj_create_crs_to_crs_from_pj (PJ_CONTEXT *ctx, const PJ *source_crs, cons proj_get_type(source_crs) == PJ_TYPE_GEOCENTRIC_CRS || proj_get_type(target_crs) == PJ_TYPE_GEOCENTRIC_CRS ) { proj_list_destroy(op_list); + ctx->forceOver = false; return P; } auto preparedOpList = pj_create_prepared_operations(ctx, source_crs, target_crs, op_list); + + ctx->forceOver = false; proj_list_destroy(op_list); if( preparedOpList.empty() ) |
