From 0fc4242ee5ae808fb998482e82da07c2b3b0b33e Mon Sep 17 00:00:00 2001 From: Matt Littlemore Date: Fri, 19 Jul 2019 17:15:25 +0800 Subject: Add set discard superseded method to api (#1534) Closes #1519 --- src/iso19111/c_api.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/iso19111/c_api.cpp') diff --git a/src/iso19111/c_api.cpp b/src/iso19111/c_api.cpp index 7a77ccfb..a125261a 100644 --- a/src/iso19111/c_api.cpp +++ b/src/iso19111/c_api.cpp @@ -6576,6 +6576,28 @@ void proj_operation_factory_context_set_allowed_intermediate_crs( } } +// --------------------------------------------------------------------------- + +/** \brief Set whether transformations that are superseded (but not deprecated) + * should be discarded. + * + * @param ctx PROJ context, or NULL for default context + * @param factory_ctx Operation factory context. must not be NULL + * @param discard superseded crs or not + */ +void PROJ_DLL proj_operation_factory_context_set_discard_superseded( + PJ_CONTEXT *ctx, PJ_OPERATION_FACTORY_CONTEXT *factory_ctx, + int discard) { + SANITIZE_CTX(ctx); + assert(factory_ctx); + try { + factory_ctx->operationContext->setDiscardSuperseded(discard != 0); + } catch (const std::exception &e) { + proj_log_error(ctx, __FUNCTION__, e.what()); + } +} + + // --------------------------------------------------------------------------- /** \brief Find a list of CoordinateOperation from source_crs to target_crs. -- cgit v1.2.3