<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hey,</p>
<p>Our application requires us to fetch for many pairs of (latitude,
longitude) all existing values within some radius from an existing
raster dataset. Is it possible to read values from a
GDALRasterBand given some general bounding box, even if it is at
the edge of a dataset?</p>
<p>One can easily convert between bounding boxes in geographical
coordinates and pixels using Dataset::GetGeoTransform() and
InvGeoTransform(), but GDALRasterBand/GDALMDArray/the Python
bindings seems to not have a method for being queried by it. Of
course, simple boxes can be read e.g. using the Python methods
Band::ReadAsArray/Band::ReadRaster. But this does not work once
queries get to the boundaries, as all of these methods do not
support "wrapping around" to the other side of the dataset. As an
example:</p>
<blockquote>
<p>Dataset: 1000 x 1000 pixels<br>
Bounding box in pixels, given as two corner points in (x, y)
pixels: (950, 950) and (50, 50)<br>
This should query all 50 by 50 pixel corners of the dataset and
result in a 100 by 100 pixel result<br>
It arises when a point at the edge of a dataset is queried with
a radius of 50 pixels<br>
However, numpy and the above methods do not allow to express
such wrap-around indexing</p>
</blockquote>
<p>Is there some method that I'm overlooking or is this
intentionally something that users should implement for themselfs?
It feels like such indexing would be required in a lot of other
places too.<br>
</p>
<p>I've posted here last week about some suggestions on how to query
raster bands at non-structured points. Thanks for the useful
replies, Christoph & Joaquim! However, it seems like we have
to code that ourselfs, thus the above digging.</p>
<p>Cheers<br>
Felix D.<br>
</p>
</body>
</html>