+ reduce threshold for 'tiled' policy to 512*512 pixels

+ reduce tile size to 256 px
+ TODO: expose the above as datasource parameters
This commit is contained in:
Artem Pavlenko 2010-02-03 12:20:06 +00:00
parent 22d8fbe7f0
commit c11e35fbc0
2 changed files with 10 additions and 10 deletions

View file

@ -118,12 +118,12 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q)
y_off_f = 0; y_off_f = 0;
} }
int x_off = static_cast<int>(x_off_f); int x_off = static_cast<int>(x_off_f + 0.5);
int y_off = static_cast<int>(y_off_f); int y_off = static_cast<int>(y_off_f + 0.5);
int width = int(box.width() + 0.5); int width = int(box.maxx() + 0.5) - int(box.minx() + 0.5);
int height = int(box.height() + 0.5); int height = int(box.maxy() + 0.5) - int(box.miny() + 0.5);
#ifdef MAPNIK_DEBUG #ifdef MAPNIK_DEBUG
std::clog << "GDAL Plugin: Raster extent=" << raster_extent << "\n"; std::clog << "GDAL Plugin: Raster extent=" << raster_extent << "\n";
std::clog << "GDAL Plugin: View extent=" << intersect << "\n"; std::clog << "GDAL Plugin: View extent=" << intersect << "\n";

View file

@ -127,17 +127,17 @@ featureset_ptr raster_datasource::features(query const& q) const
mapnik::box2d<double> intersect=extent_.intersect(q.get_bbox()); mapnik::box2d<double> intersect=extent_.intersect(q.get_bbox());
mapnik::box2d<double> ext=t.forward(intersect); mapnik::box2d<double> ext=t.forward(intersect);
unsigned width = int(ext.width() + 0.5); int width = int(ext.maxx() + 0.5) - int(ext.minx() + 0.5);
unsigned height = int(ext.height() + 0.5); int height = int(ext.maxy() + 0.5) - int(ext.miny() + 0.5);
#ifdef MAPNIK_DEBUG #ifdef MAPNIK_DEBUG
std::cout << "Raster Plugin: BOX SIZE(" << width << " " << height << ")\n"; std::cout << "Raster Plugin: BOX SIZE(" << width << " " << height << ")\n";
#endif #endif
if (width * height > 1024*1024) if (width * height > 512*512)
{ {
#ifdef MAPNIK_DEBUG #ifdef MAPNIK_DEBUG
std::cout << "Raster Plugin: TILED policy\n"; std::cout << "Raster Plugin: TILED policy\n";
#endif #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<tiled_file_policy>(policy,extent_,q)); return featureset_ptr(new raster_featureset<tiled_file_policy>(policy,extent_,q));
} }
else else