aboutsummaryrefslogtreecommitdiff
path: root/src/open_lib.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-01-07 21:52:32 +0100
committerEven Rouault <even.rouault@spatialys.com>2020-01-07 21:52:32 +0100
commit316ca96fc9e6317247ef30e2926b47ec5544eb98 (patch)
tree9952f04fa8697282287c5ddfdbcf763058c9abeb /src/open_lib.cpp
parent408cb1e4279786e3729e942c2f8b2ee2ad435c94 (diff)
downloadPROJ-316ca96fc9e6317247ef30e2926b47ec5544eb98.tar.gz
PROJ-316ca96fc9e6317247ef30e2926b47ec5544eb98.zip
network: handle opening remote grids whose local name has no extension
Diffstat (limited to 'src/open_lib.cpp')
-rw-r--r--src/open_lib.cpp17
1 files changed, 17 insertions, 0 deletions
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::File> 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 );
+ }
+ }
}
}
}