From ceefb89b82d546837804a792f4a857ff6dc73fd4 Mon Sep 17 00:00:00 2001 From: Denis Rykov Date: Tue, 18 Apr 2023 13:00:22 +0200 Subject: [PATCH] rasterio.path has been renamed to rasterio._path --- telluric/base_vrt.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/telluric/base_vrt.py b/telluric/base_vrt.py index b7d72d8..497a91b 100644 --- a/telluric/base_vrt.py +++ b/telluric/base_vrt.py @@ -4,7 +4,11 @@ from xml.dom import minidom from rasterio.dtypes import _gdal_typename, check_dtype -from rasterio.path import parse_path, vsi_path +try: + from rasterio._path import _parse_path, _vsi_path +except ImportError: + from rasterio.path import parse_path as _parse_path, vsi_path as _vsi_path + from pkg_resources import resource_filename @@ -113,7 +117,7 @@ def _setup_band_complexsource( ): sourcefilename = ET.SubElement(complexsource, 'SourceFilename') sourcefilename.attrib['relativeToVRT'] = "1" if relative_to_vrt else "0" - sourcefilename.text = vsi_path(parse_path(file_name)) + sourcefilename.text = _vsi_path(_parse_path(file_name)) sourceband = ET.SubElement(complexsource, 'SourceBand') sourceband.text = str(band_idx) sourceproperties = ET.SubElement(complexsource, 'SourceProperties')