Usually, I read ascii
from files with something like:
asc = rasterio.open(filepath)
array = asc.read(1)
But in some cases, all the lines of the ascii
file have already been read into a variable like below:
with open(filepath) as file:
lines = [line.upper() for line in file.readlines()]
asc_src = "".join(lines)
Is there a way to make asc
from asc_source
directly? I could write it to a temporary ascii
file and read it back but I'd like to avoid it if possible.