Yes, the API is incompatible. The raster (data source) has instead the GetProjection() method (which returns WKT).
Here is the function that does what you want (picture here ):
def extract_point_from_raster(point, data_source, band_number=1): """Return floating-point value that corresponds to given point."""
Its documentation is as follows (figure here ):
spatial.extract_point_from_raster(point, data_source, band_number=1)
data_source is a GDAL raster, and a dot is an OGR object. the function returns the pixel value of the specified range data_source, closest to the point.
the point and the data source must not be in the same reference frame, but they must have the appropriate spatial reference.
If the point does not fall into the raster, a RuntimeError raises.
Antonis Christofides Jan 30 '15 at 14:30 2015-01-30 14:30
source share