Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion lib/raster/vrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,28 @@ int Rast_get_vrt_row(int fd, void *buf, int row, RASTER_MAP_TYPE data_type)
#pragma omp critical(raster_vrt_read)
for (i = 0; i < vrt->tlist->n_values; i++) {
struct tileinfo *p = &ti[vrt->tlist->value[i]];
double tile_west, tile_east;

if (p->cellhd.north > rows && p->cellhd.south <= rown) {
tile_west = p->cellhd.west;
tile_east = p->cellhd.east;

if (R__.rd_window.proj == PROJECTION_LL) {
/* longitude wrapping of the tile into the current
* reading window */
while (tile_west > rd_window->east) {
tile_west -= 360.0;
tile_east -= 360.0;
}
while (tile_east < rd_window->west) {
tile_west += 360.0;
tile_east += 360.0;
}
}

/* open the tile only if it overlaps with the current reading
* row and the current reading EW extents */
if (p->cellhd.north > rows && p->cellhd.south <= rown &&
tile_west < p->cellhd.east && tile_east > p->cellhd.west) {
int tfd;
void *p1, *p2;

Expand Down
Loading