Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Runtime Error: Not a String #47

@COYE-Coder

Description

@COYE-Coder

(As discussed with Nick)

I am running into an issue in the creation of the VRT files.

File ~/miniconda3/envs/scratch/lib/python3.10/site-packages/EEDL-0.2023.11.13-py3.10.egg/eedl/image.py:153, in TaskRegistry.download_ready_images(self, download_location)
    151 try:
    152 	print(f"{image.filename} is ready for download")
--> 153 	image.download_results(download_location=download_location, callback=self.callback)
    154 except:  # noqa: E722
    155 	# on any error raise or log it
    156 	if self.raise_errors:

File ~/miniconda3/envs/scratch/lib/python3.10/site-packages/EEDL-0.2023.11.13-py3.10.egg/eedl/image.py:521, in EEDLImage.download_results(self, download_location, callback, drive_wait)
    519 if callback:
    520 	callback_func = getattr(self, callback)
...
   4937 def BuildVRTInternalNames(*args) -> "GDALDatasetShadow *":
   4938     r"""BuildVRTInternalNames(char const * dest, char ** source_filenames, GDALBuildVRTOptions options, GDALProgressFunc callback=0, void * callback_data=None) -> Dataset"""
-> 4939     return _gdal.BuildVRTInternalNames(*args)

RuntimeError: not a string

I traced it back to line 46 in mosaic_rasters.py, where the original code declares vrt_path from the output of tempfile.mkstemp . However, I believe that this function returns a tuple where the second entry is what we need (i.e, string representation of the path to the temporary file.), so fixing it might be something simple like this

_, vrt_path = tempfile.mkstemp(suffix=".vrt", prefix="mosaic_rasters_")

I have not had the opportunity to test the above fix.

Running on Python 3.10.8 GDAL 3.6.2 Mac OSX 14.3.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions