+ print bbox in Lat/Lon wgs84 to stdout
This commit is contained in:
parent
6cc6eac442
commit
68a620576f
1 changed files with 25 additions and 15 deletions
|
@ -98,7 +98,7 @@ void MapWidget::paintEvent(QPaintEvent*)
|
|||
unsigned height = end_y_-start_y_;
|
||||
painter.drawPixmap(QPoint(0, 0),pix_);
|
||||
painter.setPen(pen_);
|
||||
painter.setBrush(QColor(200,200,255,128));
|
||||
painter.setBrush(QColor(200,200,255,128));
|
||||
painter.drawRect(start_x_,start_y_,width,height);
|
||||
}
|
||||
else if (cur_tool_ == Pan)
|
||||
|
@ -456,23 +456,33 @@ void MapWidget::updateMap()
|
|||
|
||||
try
|
||||
{
|
||||
mapnik::agg_renderer<image_32> ren(*map_,buf);
|
||||
ren.apply();
|
||||
mapnik::agg_renderer<image_32> ren(*map_,buf);
|
||||
ren.apply();
|
||||
|
||||
QImage image((uchar*)buf.raw_data(),width,height,QImage::Format_ARGB32);
|
||||
pix_=QPixmap::fromImage(image.rgbSwapped());
|
||||
update();
|
||||
// emit signal to interested widgets
|
||||
emit mapViewChanged();
|
||||
std::cout << map_->getCurrentExtent() << "\n";
|
||||
QImage image((uchar*)buf.raw_data(),width,height,QImage::Format_ARGB32);
|
||||
pix_=QPixmap::fromImage(image.rgbSwapped());
|
||||
update();
|
||||
// emit signal to interested widgets
|
||||
emit mapViewChanged();
|
||||
|
||||
projection prj(map_->srs()); // map projection
|
||||
|
||||
box2d<double> ext = map_->getCurrentExtent();
|
||||
double x0 = ext.minx();
|
||||
double y0 = ext.miny();
|
||||
double x1 = ext.maxx();
|
||||
double y1 = ext.maxy();
|
||||
prj.inverse(x0,y0);
|
||||
prj.inverse(x1,y1);
|
||||
std::cout << "BBOX (WGS84): " << x0 << "," << y0 << "," << x1 << "," << y1 << "\n";
|
||||
}
|
||||
catch (mapnik::config_error & ex)
|
||||
{
|
||||
std::cerr << ex.what() << std::endl;
|
||||
std::cerr << ex.what() << std::endl;
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cerr << "Unknown exception caught!\n";
|
||||
std::cerr << "Unknown exception caught!\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue