aboutsummaryrefslogtreecommitdiff
path: root/src/4D_api.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/4D_api.cpp')
-rw-r--r--src/4D_api.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/4D_api.cpp b/src/4D_api.cpp
index 7423240f..909c3c32 100644
--- a/src/4D_api.cpp
+++ b/src/4D_api.cpp
@@ -1302,10 +1302,24 @@ 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;
for (auto iter = options; iter && iter[0]; ++iter) {
const char *value;
if ((value = getOptionValue(*iter, "AUTHORITY="))) {
authority = value;
+ } else if ((value = getOptionValue(*iter, "ACCURACY="))) {
+ accuracy = pj_atof(value);
+ } else if ((value = getOptionValue(*iter, "ALLOW_BALLPARK="))) {
+ if( ci_equal(value, "yes") )
+ allowBallparkTransformations = true;
+ else if( ci_equal(value, "no") )
+ allowBallparkTransformations = false;
+ else {
+ ctx->logger(ctx->logger_app_data, PJ_LOG_ERROR,
+ "Invalid value for ALLOW_BALLPARK option.");
+ return nullptr;
+ }
} else {
std::string msg("Unknown option :");
msg += *iter;
@@ -1319,6 +1333,14 @@ PJ *proj_create_crs_to_crs_from_pj (PJ_CONTEXT *ctx, const PJ *source_crs, cons
return nullptr;
}
+ proj_operation_factory_context_set_allow_ballpark_transformations(
+ ctx, operation_ctx, allowBallparkTransformations);
+
+ if( accuracy >= 0 ) {
+ proj_operation_factory_context_set_desired_accuracy(ctx, operation_ctx,
+ accuracy);
+ }
+
if( area && area->bbox_set ) {
proj_operation_factory_context_set_area_of_interest(
ctx,