[SCM] mapnik-viewer branch, master, updated. debian/0.0.svn1697-1-9-g34d4a4a
David Paleino
dapal at debian.org
Tue May 3 10:35:32 UTC 2011
The following commit has been merged in the master branch:
commit 13fd0410a50f252292f7362c999df764d02fa598
Author: David Paleino <dapal at debian.org>
Date: Tue Jun 29 08:20:51 2010 +0200
debian/patches/*.patch refreshed to cleanly apply
diff --git a/debian/changelog b/debian/changelog
index 7f3c761..f6b1106 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,10 @@
mapnik-viewer (0.0~svn1936-1) UNRELEASED; urgency=low
* New SVN snapshot
+ * debian/patches/:
+ - *.patch refreshed to cleanly apply
- -- David Paleino <dapal at debian.org> Tue, 29 Jun 2010 08:07:10 +0200
+ -- David Paleino <dapal at debian.org> Tue, 29 Jun 2010 08:20:27 +0200
mapnik-viewer (0.0~svn1697-1) unstable; urgency=low
diff --git a/debian/patches/00-fix_build.patch b/debian/patches/00-fix_build.patch
index 704f3a0..67283e6 100644
--- a/debian/patches/00-fix_build.patch
+++ b/debian/patches/00-fix_build.patch
@@ -12,22 +12,22 @@ Forwarded: no
CC = g++
TEMPLATE = app
--INCLUDEPATH += /opt/mapnik2/include
+-INCLUDEPATH += /opt/mapnik/include
-INCLUDEPATH += /opt/boost/include/
-INCLUDEPATH += /usr/X11/include/
-INCLUDEPATH += /usr/X11/include/freetype2
+INCLUDEPATH += /usr/include/mapnik
+INCLUDEPATH += /usr/include/boost
-+INCLUDEPATH += /usr/include/
++INCLUDEPATH += /usr/include
+INCLUDEPATH += /usr/include/freetype2
INCLUDEPATH += .
-QMAKE_CXXFLAGS +=' -DDARWIN -Wno-missing-field-initializers'
--unix:LIBS = -L/opt/mapnik2/lib -L/usr/X11/lib -lmapnik -lfreetype -L/usr/local/lib -licuuc
+-unix:LIBS = -L/opt/mapnik/lib -L/usr/X11/lib -lmapnik2 -lfreetype -L/usr/local/lib -licuuc
-unix:LIBS += -lboost_system -lboost_filesystem -lboost_regex -L/opt/boost/lib
+#QMAKE_CXXFLAGS +=' -DDARWIN -Wno-missing-field-initializers'
+QMAKE_CXXFLAGS += "-ansi -Wall -ftemplate-depth-100 -DLINUX -DMAPNIK_THREADSAFE -O2 -finline-functions -Wno-inline -DNDEBUG -Wno-missing-field-initializers"
-+unix:LIBS = -L/usr/lib/ -lmapnik -lfreetype -licuuc
++unix:LIBS = -L/usr/lib -lmapnik -lfreetype -licuuc
+unix:LIBS += -lboost_system -lboost_filesystem -lboost_regex -lboost_thread
# Input
diff --git a/debian/patches/01-fix_mapnik_paths.patch b/debian/patches/01-fix_mapnik_paths.patch
index f23eea9..9fa5a33 100644
--- a/debian/patches/01-fix_mapnik_paths.patch
+++ b/debian/patches/01-fix_mapnik_paths.patch
@@ -3,22 +3,25 @@ Subject: fix Mapnik paths for Debian installation
Forwarded: not-needed
---
- main.cpp | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
+ main.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
--- mapnik-viewer.orig/main.cpp
+++ mapnik-viewer/main.cpp
-@@ -39,10 +39,10 @@ int main( int argc, char **argv )
- using mapnik::freetype_engine;
-
- // modify this prefix based on your install location
-- std::string mapnik_dir = "/opt/mapnik2";
-+ std::string mapnik_dir = "/usr";
-
-- datasource_cache::instance()->register_datasources(mapnik_dir + "/lib/mapnik/input");
-- boost::filesystem::path path(mapnik_dir + "/lib/mapnik/fonts");
-+ datasource_cache::instance()->register_datasources(mapnik_dir + "/lib/mapnik/0.7/input");
-+ boost::filesystem::path path(mapnik_dir + "/share/fonts/truetype/ttf-dejavu");
- boost::filesystem::directory_iterator end_itr;
-
+@@ -68,14 +68,14 @@ int main( int argc, char **argv )
+ // register input plug-ins
+ QString plugins_dir = settings.value("mapnik/plugins_dir",
+- QVariant("/opt/mapnik/lib/mapnik2/input/")).toString();
++ QVariant("/usr/lib/mapnik/0.7/input/")).toString();
+ datasource_cache::instance()->register_datasources(plugins_dir.toStdString());
+ // register fonts
+ int count = settings.beginReadArray("mapnik/fonts");
+ for (int index=0; index < count; ++index)
+ {
+ settings.setArrayIndex(index);
+- QString font_dir = settings.value("dir").toString();
++ QString font_dir = "/usr/share/fonts/truetype/ttf-dejavu";
+ register_fonts(font_dir.toStdString());
+ }
+ settings.endArray();
diff --git a/debian/patches/02-fix_mapnik_API.patch b/debian/patches/02-fix_mapnik_API.patch
index 1068c30..72941f1 100644
--- a/debian/patches/02-fix_mapnik_API.patch
+++ b/debian/patches/02-fix_mapnik_API.patch
@@ -3,75 +3,75 @@ Subject: fix Mapnik API calls
Forwarded: no (needed?)
---
- layer_info_dialog.cpp | 2 +-
- layer_info_dialog.hpp | 4 ++--
- layerlistmodel.cpp | 10 +++++-----
- layerlistmodel.hpp | 2 +-
- layerwidget.cpp | 2 +-
- mainwindow.cpp | 6 +++---
- mainwindow.hpp | 2 +-
- mapwidget.cpp | 22 +++++++++++-----------
- mapwidget.hpp | 4 ++--
- styles_model.cpp | 4 ++--
- 10 files changed, 29 insertions(+), 29 deletions(-)
+ layer_info_dialog.cpp | 2 -
+ layer_info_dialog.hpp | 4 +--
+ layerlistmodel.cpp | 10 +++----
+ layerlistmodel.hpp | 2 -
+ layerwidget.cpp | 2 -
+ mainwindow.cpp | 6 ++--
+ mainwindow.hpp | 2 -
+ mapwidget.cpp | 66 +++++++++++++++++++++++++-------------------------
+ mapwidget.hpp | 4 +--
+ styles_model.cpp | 4 +--
+ 10 files changed, 51 insertions(+), 51 deletions(-)
--- mapnik-viewer.orig/mapwidget.hpp
+++ mapnik-viewer/mapwidget.hpp
-@@ -48,7 +48,7 @@ class MapWidget : public QWidget
- boost::shared_ptr<mapnik::Map> map_;
- int selected_;
- QPixmap pix_;
-- mapnik::box2d<double> extent_;
-+ mapnik::Envelope<double> extent_;
- eTool cur_tool_;
- int start_x_;
- int start_y_;
-@@ -65,7 +65,7 @@ class MapWidget : public QWidget
- inline QPixmap const& pixmap() const { return pix_;}
- void setMap(boost::shared_ptr<mapnik::Map> map);
- void defaultView();
-- void zoomToBox(mapnik::box2d<double> const& box);
-+ void zoomToBox(mapnik::Envelope<double> const& box);
- void zoomIn();
- void zoomOut();
- void panLeft();
+@@ -48,7 +48,7 @@ private:
+ boost::shared_ptr<mapnik::Map> map_;
+ int selected_;
+ QPixmap pix_;
+- mapnik::box2d<double> extent_;
++ mapnik::Envelope<double> extent_;
+ eTool cur_tool_;
+ int start_x_;
+ int start_y_;
+@@ -66,7 +66,7 @@ public:
+ inline QPixmap const& pixmap() const { return pix_;}
+ void setMap(boost::shared_ptr<mapnik::Map> map);
+ void defaultView();
+- void zoomToBox(mapnik::box2d<double> const& box);
++ void zoomToBox(mapnik::Envelope<double> const& box);
+ void zoomIn();
+ void zoomOut();
+ void panLeft();
--- mapnik-viewer.orig/mainwindow.cpp
+++ mapnik-viewer/mainwindow.cpp
@@ -143,7 +143,7 @@ void MainWindow::reload()
if (!filename_.isEmpty())
{
-
-- mapnik::box2d<double> bbox = mapWidget_->getMap()->getCurrentExtent();
-+ mapnik::Envelope<double> bbox = mapWidget_->getMap()->getCurrentExtent();
- load_map_file(filename_);
- mapWidget_->zoomToBox(bbox);
- setWindowTitle(tr("%1 - *Reloaded*").arg(filename_));
-@@ -180,7 +180,7 @@ void MainWindow::load_map_file(QString c
- std::cout << ex.what() << "\n";
- }
- map->zoom_all();
-- mapnik::box2d<double> const& ext = map->getCurrentExtent();
-+ mapnik::Envelope<double> const& ext = map->getCurrentExtent();
- mapWidget_->zoomToBox(ext);
- layerTab_->setModel(new LayerListModel(map,this));
- styleTab_->setModel(new StyleModel(map,this));
-@@ -388,7 +388,7 @@ void MainWindow::set_default_extent(doub
- mapnik::projection prj(map_ptr->srs());
- prj.forward(x0,y0);
- prj.forward(x1,y1);
-- default_extent_=mapnik::box2d<double>(x0,y0,x1,y1);
-+ default_extent_=mapnik::Envelope<double>(x0,y0,x1,y1);
- mapWidget_->zoomToBox(default_extent_);
- std::cout << "SET DEFAULT EXT\n";
- }
+
+- mapnik::box2d<double> bbox = mapWidget_->getMap()->get_current_extent();
++ mapnik::Envelope<double> bbox = mapWidget_->getMap()->getCurrentExtent();
+ load_map_file(filename_);
+ mapWidget_->zoomToBox(bbox);
+ setWindowTitle(tr("%1 - *Reloaded*").arg(filename_));
+@@ -384,7 +384,7 @@ void MainWindow::set_default_extent(doub
+ mapnik::projection prj(map_ptr->srs());
+ prj.forward(x0,y0);
+ prj.forward(x1,y1);
+- default_extent_=mapnik::box2d<double>(x0,y0,x1,y1);
++ default_extent_=mapnik::Envelope<double>(x0,y0,x1,y1);
+ mapWidget_->zoomToBox(default_extent_);
+ std::cout << "SET DEFAULT EXT\n";
+ }
+@@ -403,7 +403,7 @@ void MainWindow::zoom_all()
+ if (map_ptr)
+ {
+ map_ptr->zoom_all();
+- mapnik::box2d<double> const& ext = map_ptr->get_current_extent();
++ mapnik::Envelope<double> const& ext = map_ptr->getCurrentExtent();
+ mapWidget_->zoomToBox(ext);
+ }
+ }
--- mapnik-viewer.orig/mainwindow.hpp
+++ mapnik-viewer/mainwindow.hpp
-@@ -105,7 +105,7 @@ public slots:
- QStatusBar *status;
- QSlider * slider_;
-
-- mapnik::box2d<double> default_extent_;
-+ mapnik::Envelope<double> default_extent_;
+@@ -105,7 +105,7 @@ private:
+ //status bar
+ QStatusBar *status;
+ QSlider * slider_;
+- mapnik::box2d<double> default_extent_;
++ mapnik::Envelope<double> default_extent_;
};
@@ -91,7 +91,15 @@ Forwarded: no (needed?)
using mapnik::coord2d;
using mapnik::feature_ptr;
using mapnik::geometry_ptr;
-@@ -149,7 +149,7 @@ void MapWidget::mousePressEvent(QMouseEv
+@@ -145,13 +145,13 @@ void MapWidget::mousePressEvent(QMouseEv
+
+ projection map_proj(map_->srs()); // map projection
+ double scale_denom = scale_denominator(*map_,map_proj.is_geographic());
+- CoordTransform t(map_->width(),map_->height(),map_->get_current_extent());
++ CoordTransform t(map_->getWidth(),map_->getHeight(),map_->getCurrentExtent());
+
+- for (unsigned index = 0; index < map_->layer_count();++index)
++ for (unsigned index = 0; index < map_->layerCount();++index)
{
if (int(index) != selectedLayer_) continue;
@@ -100,7 +108,7 @@ Forwarded: no (needed?)
if (!layer.isVisible(scale_denom)) continue;
std::string name = layer.name();
double x = e->x();
-@@ -216,7 +216,7 @@ void MapWidget::mousePressEvent(QMouseEv
+@@ -218,7 +218,7 @@ void MapWidget::mousePressEvent(QMouseEv
// remove annotation layer
map_->layers().erase(remove_if(map_->layers().begin(),
map_->layers().end(),
@@ -109,16 +117,31 @@ Forwarded: no (needed?)
, map_->layers().end());
}
}
-@@ -249,7 +249,7 @@ void MapWidget::mouseReleaseEvent(QMouse
+@@ -250,9 +250,9 @@ void MapWidget::mouseReleaseEvent(QMouse
+ drag_=false;
if (map_)
{
- CoordTransform t(map_->getWidth(),map_->getHeight(),map_->getCurrentExtent());
+- CoordTransform t(map_->width(),map_->height(),map_->get_current_extent());
- box2d<double> box = t.backward(box2d<double>(start_x_,start_y_,end_x_,end_y_));
+- map_->zoom_to_box(box);
++ CoordTransform t(map_->getWidth(),map_->getHeight(),map_->getCurrentExtent());
+ Envelope<double> box = t.backward(Envelope<double>(start_x_,start_y_,end_x_,end_y_));
- map_->zoomToBox(box);
++ map_->zoomToBox(box);
updateMap();
}
-@@ -331,7 +331,7 @@ void MapWidget::keyPressEvent(QKeyEvent
+ }
+@@ -261,8 +261,8 @@ void MapWidget::mouseReleaseEvent(QMouse
+ drag_=false;
+ if (map_)
+ {
+- int cx = int(0.5 * map_->width());
+- int cy = int(0.5 * map_->height());
++ int cx = int(0.5 * map_->getWidth());
++ int cy = int(0.5 * map_->getHeight());
+ int dx = end_x_ - start_x_;
+ int dy = end_y_ - start_y_;
+ map_->pan(cx - dx ,cy - dy);
+@@ -333,11 +333,11 @@ void MapWidget::keyPressEvent(QKeyEvent
}
@@ -127,14 +150,65 @@ Forwarded: no (needed?)
{
if (map_)
{
-@@ -419,14 +419,14 @@ void MapWidget::zoomToLevel(int level)
+- map_->zoom_to_box(bbox);
++ map_->zoomToBox(bbox);
+ updateMap();
+ }
+ }
+@@ -374,8 +374,8 @@ void MapWidget::panUp()
+ {
+ if (map_)
+ {
+- double cx = 0.5*map_->width();
+- double cy = 0.5*map_->height();
++ double cx = 0.5*map_->getWidth();
++ double cy = 0.5*map_->getHeight();
+ map_->pan(int(cx),int(cy - cy*0.25));
+ updateMap();
+ }
+@@ -385,8 +385,8 @@ void MapWidget::panDown()
+ {
+ if (map_)
+ {
+- double cx = 0.5*map_->width();
+- double cy = 0.5*map_->height();
++ double cx = 0.5*map_->getWidth();
++ double cy = 0.5*map_->getHeight();
+ map_->pan(int(cx),int(cy + cy*0.25));
+ updateMap();
+ }
+@@ -396,8 +396,8 @@ void MapWidget::panLeft()
+ {
+ if (map_)
+ {
+- double cx = 0.5*map_->width();
+- double cy = 0.5*map_->height();
++ double cx = 0.5*map_->getWidth();
++ double cy = 0.5*map_->getHeight();
+ map_->pan(int(cx - cx * 0.25),int(cy));
+ updateMap();
+ }
+@@ -407,8 +407,8 @@ void MapWidget::panRight()
+ {
+ if (map_)
+ {
+- double cx = 0.5*map_->width();
+- double cy = 0.5*map_->height();
++ double cx = 0.5*map_->getWidth();
++ double cy = 0.5*map_->getHeight();
+ map_->pan(int(cx + cx * 0.25),int(cy));
+ updateMap();
+ }
+@@ -421,25 +421,25 @@ void MapWidget::zoomToLevel(int level)
{
double scale_denom = scales[level];
std::cerr << "scale denominator = " << scale_denom << "\n";
-- mapnik::box2d<double> ext = map_->getCurrentExtent();
+- mapnik::box2d<double> ext = map_->get_current_extent();
+- double width = static_cast<double>(map_->width());
+- double height= static_cast<double>(map_->height());
+ mapnik::Envelope<double> ext = map_->getCurrentExtent();
- double width = static_cast<double>(map_->getWidth());
- double height= static_cast<double>(map_->getHeight());
++ double width = static_cast<double>(map_->getWidth());
++ double height= static_cast<double>(map_->getHeight());
mapnik::coord2d pt = ext.center();
double res = scale_denom * 0.00028;
@@ -144,20 +218,47 @@ Forwarded: no (needed?)
pt.y - 0.5 * height*res,
pt.x + 0.5 * width * res,
pt.y + 0.5 * height*res);
-@@ -451,11 +451,11 @@ void MapWidget::updateMap()
- unsigned width=map_->getWidth();
- unsigned height=map_->getHeight();
+- map_->zoom_to_box(box);
++ map_->zoomToBox(box);
+ updateMap();
+ }
+ }
+
+ void MapWidget::export_to_file(unsigned ,unsigned ,std::string const&,std::string const&)
+ {
+- //image_32 image(width,height);
++ //Image32 image(width,height);
+ //agg_renderer renderer(map,image);
+ //renderer.apply();
+ //image.saveToFile(filename,type);
+@@ -454,14 +454,14 @@ void MapWidget::updateMap()
+ {
+ if (map_)
+ {
+- unsigned width=map_->width();
+- unsigned height=map_->height();
++ unsigned width=map_->getWidth();
++ unsigned height=map_->getHeight();
- image_32 buf(width,height);
+ Image32 buf(width,height);
try
{
-- mapnik::agg_renderer<image_32> ren(*map_,buf);
-+ mapnik::agg_renderer<Image32> ren(*map_,buf);
- ren.apply();
-
- QImage image((uchar*)buf.raw_data(),width,height,QImage::Format_ARGB32);
+- mapnik::agg_renderer<image_32> ren(*map_,buf,scaling_factor_);
++ mapnik::agg_renderer<Image32> ren(*map_,buf,scaling_factor_);
+ ren.apply();
+
+ QImage image((uchar*)buf.raw_data(),width,height,QImage::Format_ARGB32);
+@@ -472,7 +472,7 @@ void MapWidget::updateMap()
+
+ projection prj(map_->srs()); // map projection
+
+- box2d<double> ext = map_->get_current_extent();
++ Envelope<double> ext = map_->getCurrentExtent();
+ double x0 = ext.minx();
+ double y0 = ext.miny();
+ double x1 = ext.maxx();
--- mapnik-viewer.orig/layerlistmodel.hpp
+++ mapnik-viewer/layerlistmodel.hpp
@@ -40,7 +40,7 @@ class LayerListModel : public QAbstractL
@@ -232,24 +333,24 @@ Forwarded: no (needed?)
--- mapnik-viewer.orig/styles_model.cpp
+++ mapnik-viewer/styles_model.cpp
-@@ -247,7 +247,7 @@ class rule_node
- ~rule_node() {}
- QString name() const
- {
-- mapnik::expression_ptr filter = rule_.get_filter();
-+ mapnik::filter_ptr filter = rule_.get_filter();
+@@ -247,7 +247,7 @@ public:
+ ~rule_node() {}
+ QString name() const
+ {
+- mapnik::expression_ptr filter = rule_.get_filter();
++ mapnik::filter_ptr filter = rule_.get_filter();
- return QString("TODO!");//filter->to_string().c_str());
- }
+ return QString(mapnik::to_expression_string(*filter).c_str());
+ }
@@ -323,7 +323,7 @@ StyleModel::StyleModel(boost::shared_ptr
- for ( ; itr2 != rules.end();++itr2)
- {
- node* rule_n = style_n->add_child(new node(rule_node(QString("Rule"),*itr2),style_n));
-- mapnik::rule_type::symbolizers::const_iterator itr3 = (*itr2).begin();
-+ mapnik::symbolizers::const_iterator itr3 = (*itr2).begin();
- for ( ; itr3 !=itr2->end();++itr3)
- {
- rule_n->add_child(new node(symbolizer_node(*itr3),rule_n));
+ for ( ; itr2 != rules.end();++itr2)
+ {
+ node* rule_n = style_n->add_child(new node(rule_node(QString("Rule"),*itr2),style_n));
+- mapnik::rule_type::symbolizers::const_iterator itr3 = (*itr2).begin();
++ mapnik::symbolizers::const_iterator itr3 = (*itr2).begin();
+ for ( ; itr3 !=itr2->end();++itr3)
+ {
+ rule_n->add_child(new node(symbolizer_node(*itr3),rule_n));
--- mapnik-viewer.orig/layer_info_dialog.cpp
+++ mapnik-viewer/layer_info_dialog.cpp
@@ -24,7 +24,7 @@
--
mapnik-viewer
More information about the Pkg-grass-devel
mailing list