2

I'm trying to pull coordinate and pixel value data from a .TIF using rasterio. In recently updated documentation (April 2018) there appears to be a .xy() function to get the spatial coordinates of a pixel, with an example:

>>> dataset.xy(dataset.width // 2, dataset.height // 2)
(476550.0, 4149150.0)

However, when I run the same example:

import rasterio
dataset = rasterio.open('image.tif')
dataset.xy(dataset.width // 2, dataset.height // 2)

I receive error: "AttributeError: 'rasterio._io.RasterReader' object has no attribute 'xy'".

Am I misinterpreting the documentation or is this something like pre-documentation for a future version? Is there another method for this in current release / official documentation that I haven't seen?

Thank you!

4

0 に答える 0