aboutsummaryrefslogtreecommitdiff
path: root/src/4D_api.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-12-16 21:02:37 +0100
committerGitHub <noreply@github.com>2020-12-16 21:02:37 +0100
commit7766b1aad7328b94b7ecc9afe0ad7e874c989ad3 (patch)
treeed39359433f8004f03d0e4bef02b0cc41e62f0d5 /src/4D_api.cpp
parent1a84a71349c31740b4a525971cf56c899dda858e (diff)
parentda066800e59dcd5c3bf5e88ccca1bf1762de74dc (diff)
downloadPROJ-7766b1aad7328b94b7ecc9afe0ad7e874c989ad3.tar.gz
PROJ-7766b1aad7328b94b7ecc9afe0ad7e874c989ad3.zip
Merge pull request #2488 from rouault/crs_to_crs_improved_filtering
Improved coordinate operation filtering
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,