mirror of
https://github.com/rasterio/rasterio.git
synced 2025-12-08 17:36:12 +00:00
Revert changes accidentally made to path parsing
This commit is contained in:
parent
5313d4ce67
commit
371daa2d06
@ -133,12 +133,9 @@ def parse_path(path):
|
||||
else:
|
||||
parts = urlparse(path)
|
||||
|
||||
if not parts.scheme:
|
||||
return UnparsedPath(path)
|
||||
|
||||
# if the scheme is not one of Rasterio's supported schemes, we
|
||||
# return an UnparsedPath.
|
||||
elif parts.scheme and not all(p in SCHEMES for p in parts.scheme.split('+')):
|
||||
if parts.scheme and not all(p in SCHEMES for p in parts.scheme.split('+')):
|
||||
return UnparsedPath(path)
|
||||
|
||||
else:
|
||||
|
||||
@ -74,7 +74,7 @@ def test_create_mask_windowed_internal(data):
|
||||
with rasterio.open(str(data.join('RGB.byte.tif')), 'r+') as dst:
|
||||
for ij, window in dst.block_windows():
|
||||
blue = dst.read(1, window=window, masked=False)
|
||||
mask = 255 * (blue == 0).astype('uint8')
|
||||
mask = (blue != 0)
|
||||
dst.write_mask(mask, window=window)
|
||||
|
||||
|
||||
|
||||
@ -67,7 +67,6 @@ def test_parse_path_file_scheme():
|
||||
def test_parse_path_file():
|
||||
"""Correctly parse an ordinary filesystem path"""
|
||||
parsed = parse_path('/foo.tif')
|
||||
assert isinstance(parsed, UnparsedPath)
|
||||
assert parsed.path == '/foo.tif'
|
||||
|
||||
|
||||
@ -165,9 +164,3 @@ def test_vsi_path_zip_plus_https():
|
||||
"""A zip+https:// URLs vsi path is correct (see #1151)"""
|
||||
url = 'zip+https://example.com/foo.zip!bar.tif'
|
||||
assert vsi_path(parse_path(url)) == '/vsizip/vsicurl/https://example.com/foo.zip/bar.tif'
|
||||
|
||||
|
||||
def test_sentinel2_l1c():
|
||||
"""A Sentinel 2 L1C identifier is not parsed"""
|
||||
path = "SENTINEL2_L1C:S2A_OPER_MTD_SAFL1C_PDMC_20150818T101440_R022_V20150813T102406_20150813T102406.xml:10m:EPSG_32632"
|
||||
assert isinstance(parse_path(path), UnparsedPath)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user