I'm using rasterio sample module and I want to convert my output (generator) to list. I know that I can just use list() but it raises error "too many values to unpack (expected 2)". When I just use the sample module I get generator:
sample = rasterio.sample.sample_gen(raster, ['754707','4248548'])
but trying to make a list with:
sample = list(rasterio.sample.sample_gen(raster, ['754707','4248548']))
raises an error. I found .items() method but it works for dictionaries, it's not useful for generators, I'm working for the first time with a generator object and I don't get what is wrong.