Skip to content

Commit

Permalink
Specify empty_dir=yes when constructing vsicurl parameters
Browse files Browse the repository at this point in the history
When automatically constructing a vsicurl url to allow gdal to read from
https or s3 sources, set empty_dir=yes to avoid probing for sidecar
files.  Prior to GDAL PR 11469, this seem to be the case with just
list_dir=no, but it isn't clear from the GDAL documentation why that
works.  Be explicit (open a viscurl path directly to change the
behavior).
  • Loading branch information
manthey committed Jan 7, 2025
1 parent 4bd27a2 commit 45f6d2c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
- Suppress a warning about nd2 files that we can't do anything about ([#1749](../../pull/1749))
- Zero empty areas in tile frames ([#1752](../../pull/1752))
- Don't include cache libraries in [common] deployments ([#1758](../../pull/1758))
- Specify empty_dir=yes when constructing vsicurl parameters ([#1760](../../pull/1760))

### Bug Fixes

Expand Down
3 changes: 2 additions & 1 deletion large_image/tilesource/geo.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def make_vsi(url: Union[str, pathlib.Path, Dict[Any, Any]], **options) -> str:
gdal_options = {
'url': str(url),
'use_head': 'no',
'list_dir': 'no',
'list_dir': 'no', # don't search for adjacent files
'empty_dir': 'yes', # don't probe for sidecar files
}
gdal_options.update(options)
vsi = f'/vsicurl?{urlencode(gdal_options)}'
Expand Down

0 comments on commit 45f6d2c

Please sign in to comment.