From bcb84f9aae57f6591a94ed1f46ea7deb7e51392c Mon Sep 17 00:00:00 2001 From: Bborie Park Date: Wed, 23 May 2012 17:54:48 +0000 Subject: [PATCH] Correct when to compute number of tiles. Ticket is #1840 git-svn-id: http://svn.osgeo.org/postgis/trunk@9810 b70326c6-7e19-0410-871a-916f4a2858ee --- NEWS | 1 + raster/loader/raster2pgsql.c | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index ecc8cbc00..8d05901aa 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,7 @@ PostGIS 2.1.0 * Fixes * - #1839, handling of subdatasets in GeoTIFF in raster2pgsql. + - #1840, fix logic of when to compute # of tiles in raster2pgsql. PostGIS 2.0.0 2012/04/03 diff --git a/raster/loader/raster2pgsql.c b/raster/loader/raster2pgsql.c index ac7482691..a7e23b45c 100644 --- a/raster/loader/raster2pgsql.c +++ b/raster/loader/raster2pgsql.c @@ -1595,13 +1595,10 @@ convert_raster(int idx, RTLOADERCFG *config, RASTERINFO *info, STRINGBUFFER *til info->tile_size[1] = config->tile_size[1]; /* number of tiles */ - if ( - info->tile_size[0] != info->dim[0] && - info->tile_size[1] != info->dim[1] - ) { + if (info->tile_size[0] != info->dim[0]) ntiles[0] = (info->dim[0] + info->tile_size[0] - 1) / info->tile_size[0]; + if (info->tile_size[1] != info->dim[1]) ntiles[1] = (info->dim[1] + info->tile_size[1] - 1) / info->tile_size[1]; - } /* go through bands for attributes */ for (i = 0; i < info->nband_count; i++) {