aboutsummaryrefslogtreecommitdiff
path: root/src/4D_api.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-12-25 18:44:45 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-12-27 11:14:16 +0100
commitc4589fbe42e5fea07a03919d3484164f5fb70dd3 (patch)
tree37d526da7460deead544ebcfd0ed37db1945a0fc /src/4D_api.cpp
parent0a1f1fe469029ae31591dc8b51d20f5617496128 (diff)
downloadPROJ-c4589fbe42e5fea07a03919d3484164f5fb70dd3.tar.gz
PROJ-c4589fbe42e5fea07a03919d3484164f5fb70dd3.zip
Network: automatically use CDN resources when local resources not available, and networking enabled
Diffstat (limited to 'src/4D_api.cpp')
-rw-r--r--src/4D_api.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/4D_api.cpp b/src/4D_api.cpp
index efb4a86a..cee8262e 100644
--- a/src/4D_api.cpp
+++ b/src/4D_api.cpp
@@ -262,7 +262,7 @@ similarly, but prefers the 2D resp. 3D interfaces if available.
auto coordOperation = dynamic_cast<
NS_PROJ::operation::CoordinateOperation*>(alt.pj->iso_obj.get());
if( coordOperation ) {
- if( coordOperation->gridsNeeded(dbContext).empty() ) {
+ if( coordOperation->gridsNeeded(dbContext, true).empty() ) {
if( P->iCurCoordOp != i ) {
std::string msg("Using coordinate operation ");
msg += alt.name;
@@ -1117,7 +1117,10 @@ PJ *proj_create_crs_to_crs_from_pj (PJ_CONTEXT *ctx, const PJ *source_crs, cons
proj_operation_factory_context_set_spatial_criterion(
ctx, operation_ctx, PROJ_SPATIAL_CRITERION_PARTIAL_INTERSECTION);
proj_operation_factory_context_set_grid_availability_use(
- ctx, operation_ctx, PROJ_GRID_AVAILABILITY_DISCARD_OPERATION_IF_MISSING_GRID);
+ ctx, operation_ctx,
+ pj_context_is_network_enabled(ctx) ?
+ PROJ_GRID_AVAILABILITY_KNOWN_AVAILABLE:
+ PROJ_GRID_AVAILABILITY_DISCARD_OPERATION_IF_MISSING_GRID);
auto op_list = proj_create_operations(ctx, source_crs, target_crs, operation_ctx);