Closed sehHeiden closed 2 years ago
The reading logic is handled by GDAL. See: https://gdal.org/drivers/raster/aaigrid.html. If you would like to see this format supported, I recommend opening up an issue here: https://github.com/OSGeo/gdal
Also, you could look into using StringIO/BytesIO to pass in a string/binary as a file: https://docs.python.org/3/library/io.html
Hi I, tried StringIO before with:
r_f = StringIO(file_text)
r = open_rasterio(r_f)
I get the Error: AttributeError: '_GeneratorContextManager' object has no attribute 'subdatasets'
. The file_text can be read after
saving to:
with open(tmp_folder / file_path.name, "w") as tmp_f:
tmp_f.write(file_text)
r = open_rasterio(tmp_folder / all_types.name)
See: #562
Also related: https://github.com/rasterio/rasterio/issues/2550
I would ask for a way to open ascii files that are already opened as string/list of strings.
Background I sometimes work with ascii files for an import national agency that offers asc- files non-standard format. I have to mess abit with the file beofore the raster can sucessfully be opened. It would be nice, that I could manipulate the files and use them dirrectly from memory without the need to save the files. An alternative would be automatically be abe to read that non standard format.
The format has an extended for example header: