Re: Sampling from one single point location using sample()


Sean Gillies
 

Hi Alex,

On Sun, Nov 15, 2020 at 9:06 AM Alexander Jüstel <alexander.juestel@...> wrote:
Hello, 
 
I would like to sample the value of my raster at one single point location. I have passed the coordinates as an iterable to the sample() function. However, I am not able to extract the value from the generator. The sampling works fine for more than one point. However, I need it to work for one point only. I have tried using list(gen) or next(gen) to get the value but nothing works so far.
 
Thanks for your support
Cheers
Alex

Is your approach any different than the examples in https://github.com/mapbox/rasterio/blob/master/tests/test_sampling.py?

--
Sean Gillies

Join main@rasterio.groups.io to automatically receive all group messages.