diff --git a/plugins/input/gdal/gdal_featureset.cpp b/plugins/input/gdal/gdal_featureset.cpp index a3a4f612b..2eed3979b 100644 --- a/plugins/input/gdal/gdal_featureset.cpp +++ b/plugins/input/gdal/gdal_featureset.cpp @@ -118,12 +118,12 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q) y_off_f = 0; } - int x_off = static_cast(x_off_f); - int y_off = static_cast(y_off_f); - - int width = int(box.width() + 0.5); - int height = int(box.height() + 0.5); - + int x_off = static_cast(x_off_f + 0.5); + int y_off = static_cast(y_off_f + 0.5); + + int width = int(box.maxx() + 0.5) - int(box.minx() + 0.5); + int height = int(box.maxy() + 0.5) - int(box.miny() + 0.5); + #ifdef MAPNIK_DEBUG std::clog << "GDAL Plugin: Raster extent=" << raster_extent << "\n"; std::clog << "GDAL Plugin: View extent=" << intersect << "\n"; diff --git a/plugins/input/raster/raster_datasource.cpp b/plugins/input/raster/raster_datasource.cpp index e48c1dcf9..b689fd1b6 100644 --- a/plugins/input/raster/raster_datasource.cpp +++ b/plugins/input/raster/raster_datasource.cpp @@ -127,17 +127,17 @@ featureset_ptr raster_datasource::features(query const& q) const mapnik::box2d intersect=extent_.intersect(q.get_bbox()); mapnik::box2d ext=t.forward(intersect); - unsigned width = int(ext.width() + 0.5); - unsigned height = int(ext.height() + 0.5); + int width = int(ext.maxx() + 0.5) - int(ext.minx() + 0.5); + int height = int(ext.maxy() + 0.5) - int(ext.miny() + 0.5); #ifdef MAPNIK_DEBUG std::cout << "Raster Plugin: BOX SIZE(" << width << " " << height << ")\n"; #endif - if (width * height > 1024*1024) + if (width * height > 512*512) { #ifdef MAPNIK_DEBUG std::cout << "Raster Plugin: TILED policy\n"; #endif - tiled_file_policy policy(filename_,format_, 1024, extent_,q.get_bbox(), width_,height_); + tiled_file_policy policy(filename_,format_, 256 , extent_,q.get_bbox(), width_,height_); return featureset_ptr(new raster_featureset(policy,extent_,q)); } else