[gdal-dev] Questions about SQL cursors in GDAL driver
Frank Warmerdam
warmerdam at pobox.com
Fri Jul 10 21:14:55 EDT 2009
Jorge Arévalo wrote:
> So, clearly, I have a mistake. Think in a table with tiles of 100x100
> px. We have 30 tiles. When I create RasterBands, their block size will
> be 100x100. So, IReadBlock(0, 0, bufffer) indicates the block going
> from (0, 0) to (100, 100). Does it mean that the block from (0, 0) to
> (100, 100) must be the first one in the table if I get the rows
> ordered by rid?
No, I do not see how you could depend on this.
> It depends on how the tiles have been loaded. So,
> instead of making hypothesis, Should I query the block that matchs the
> extent from (0, 0) to (100, 100)?
Yes, but furthermore, you will need to transform the pixel bounds into
georeferenced coordinates to do the spatial query. I would also note that
you might be best to reduce the query rectangle to just be a small central
area of the tile to avoid fetching adjacent tiles or even forcing
postgres to fetch them to check their bounds against your point. Spatial
index tend to have a certain granularity.
Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush | Geospatial Programmer for Rent
More information about the gdal-dev
mailing list