From 316ca96fc9e6317247ef30e2926b47ec5544eb98 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 7 Jan 2020 21:52:32 +0100 Subject: network: handle opening remote grids whose local name has no extension --- src/open_lib.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/open_lib.cpp') diff --git a/src/open_lib.cpp b/src/open_lib.cpp index 23ee79a0..222dd757 100644 --- a/src/open_lib.cpp +++ b/src/open_lib.cpp @@ -381,6 +381,23 @@ std::unique_ptr NS_PROJ::FileManager::open_resource_file( "Using %s", remote_file.c_str() ); pj_ctx_set_errno( ctx, 0 ); } + } else { + // For example for resource files like 'alaska' + auto remote_file_tif = remote_file + ".tif"; + file = open(ctx, remote_file_tif.c_str()); + if( file ) { + pj_log( ctx, PJ_LOG_DEBUG_MAJOR, + "Using %s", remote_file_tif.c_str() ); + pj_ctx_set_errno( ctx, 0 ); + } else { + // Init files + file = open(ctx, remote_file.c_str()); + if( file ) { + pj_log( ctx, PJ_LOG_DEBUG_MAJOR, + "Using %s", remote_file.c_str() ); + pj_ctx_set_errno( ctx, 0 ); + } + } } } } -- cgit v1.2.3