[mapnik] 01/04: Imported Upstream version 3.0.12~rc6+ds

Bas Couwenberg sebastic at debian.org
Fri Aug 26 17:50:22 UTC 2016


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository mapnik.

commit 055e895bec2a8fa290183ca8a6dec9ed17573bd1
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Fri Aug 26 18:55:02 2016 +0200

    Imported Upstream version 3.0.12~rc6+ds
---
 CHANGELOG.md                                       |  6 ++-
 .../process_building_symbolizer.hpp                | 51 ++++++++++++----------
 include/mapnik/util/variant.hpp                    |  5 ---
 test/unit/datasource/ogr.cpp                       |  6 ++-
 4 files changed, 38 insertions(+), 30 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9840af1..9b47dab 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -36,7 +36,11 @@ Released: xx-xx-xx
 - Added support for quantising small (less than 3 pixel) images (ref #3466)
 - Added support for natural logarithm function in expressions (ref #3475)
 - Improved logic determining if certain compiler features are available e.g `inheriting constructors` (MSVC)
-- GeoJSON - corrected quoting in `stringgifird` objects (ref #3491)
+- GeoJSON - corrected quoting in `stringify` objects (ref #3491)
+- GeoJSON - ensured consistent ordering of attribute descriptors (ref #3494)
+- GeoJSON - exposed `num_features_to_query` as datasource paramer (ref #3495)
+- Replaced `boost::mpl::vector<Types...>` with `std::tuple<Types...>` (ref #3503)
+- BuildingSymbolizer - fixed closing segment of polygon in building symbolizer (ref #3505)
 
 ## 3.0.11
 
diff --git a/include/mapnik/renderer_common/process_building_symbolizer.hpp b/include/mapnik/renderer_common/process_building_symbolizer.hpp
index 6b0a94f..d65df25 100644
--- a/include/mapnik/renderer_common/process_building_symbolizer.hpp
+++ b/include/mapnik/renderer_common/process_building_symbolizer.hpp
@@ -38,9 +38,10 @@ namespace detail {
 template <typename F1, typename F2, typename F3>
 void make_building(geometry::polygon<double> const& poly, double height, F1 const& face_func, F2 const& frame_func, F3 const& roof_func)
 {
-    const std::unique_ptr<path_type> frame(new path_type(path_type::types::LineString));
-    const std::unique_ptr<path_type> roof(new path_type(path_type::types::Polygon));
+    path_type frame(path_type::types::LineString);
+    path_type roof(path_type::types::Polygon);
     std::deque<segment_t> face_segments;
+    double ring_begin_x, ring_begin_y;
     double x0 = 0;
     double y0 = 0;
     double x,y;
@@ -51,16 +52,22 @@ void make_building(geometry::polygon<double> const& poly, double height, F1 cons
     {
         if (cm == SEG_MOVETO)
         {
-            frame->move_to(x,y);
+            frame.move_to(x,y);
+            ring_begin_x = x;
+            ring_begin_y = y;
         }
         else if (cm == SEG_LINETO)
         {
-            frame->line_to(x,y);
-            face_segments.push_back(segment_t(x0,y0,x,y));
+            frame.line_to(x,y);
+            face_segments.emplace_back(x0,y0,x,y);
         }
         else if (cm == SEG_CLOSE)
         {
-            frame->close_path();
+            frame.close_path();
+            if (!face_segments.empty())
+            {
+                face_segments.emplace_back(x0, y0, ring_begin_x, ring_begin_y);
+            }
         }
         x0 = x;
         y0 = y;
@@ -69,16 +76,16 @@ void make_building(geometry::polygon<double> const& poly, double height, F1 cons
     std::sort(face_segments.begin(),face_segments.end(), y_order);
     for (auto const& seg : face_segments)
     {
-        const std::unique_ptr<path_type> faces(new path_type(path_type::types::Polygon));
-        faces->move_to(std::get<0>(seg),std::get<1>(seg));
-        faces->line_to(std::get<2>(seg),std::get<3>(seg));
-        faces->line_to(std::get<2>(seg),std::get<3>(seg) + height);
-        faces->line_to(std::get<0>(seg),std::get<1>(seg) + height);
+        path_type faces(path_type::types::Polygon);
+        faces.move_to(std::get<0>(seg),std::get<1>(seg));
+        faces.line_to(std::get<2>(seg),std::get<3>(seg));
+        faces.line_to(std::get<2>(seg),std::get<3>(seg) + height);
+        faces.line_to(std::get<0>(seg),std::get<1>(seg) + height);
 
-        face_func(*faces);
+        face_func(faces);
         //
-        frame->move_to(std::get<0>(seg),std::get<1>(seg));
-        frame->line_to(std::get<0>(seg),std::get<1>(seg)+height);
+        frame.move_to(std::get<0>(seg),std::get<1>(seg));
+        frame.line_to(std::get<0>(seg),std::get<1>(seg)+height);
     }
 
     va.rewind(0);
@@ -87,23 +94,23 @@ void make_building(geometry::polygon<double> const& poly, double height, F1 cons
     {
         if (cm == SEG_MOVETO)
         {
-            frame->move_to(x,y+height);
-            roof->move_to(x,y+height);
+            frame.move_to(x,y+height);
+            roof.move_to(x,y+height);
         }
         else if (cm == SEG_LINETO)
         {
-            frame->line_to(x,y+height);
-            roof->line_to(x,y+height);
+            frame.line_to(x,y+height);
+            roof.line_to(x,y+height);
         }
         else if (cm == SEG_CLOSE)
         {
-            frame->close_path();
-            roof->close_path();
+            frame.close_path();
+            roof.close_path();
         }
     }
 
-    frame_func(*frame);
-    roof_func(*roof);
+    frame_func(frame);
+    roof_func(roof);
 }
 
 } // ns detail
diff --git a/include/mapnik/util/variant.hpp b/include/mapnik/util/variant.hpp
index 6c2d21b..27993ce 100644
--- a/include/mapnik/util/variant.hpp
+++ b/include/mapnik/util/variant.hpp
@@ -26,11 +26,6 @@
 #include <mapnik/config.hpp>
 #include <mapbox/variant.hpp>
 
-#pragma GCC diagnostic push
-#include <mapnik/warning_ignore.hpp>
-#include <boost/fusion/adapted/std_tuple.hpp> // spirit support
-#pragma GCC diagnostic pop
-
 namespace mapnik { namespace util {
 
 template <typename T>
diff --git a/test/unit/datasource/ogr.cpp b/test/unit/datasource/ogr.cpp
index 5401c1f..5b785f9 100644
--- a/test/unit/datasource/ogr.cpp
+++ b/test/unit/datasource/ogr.cpp
@@ -21,7 +21,7 @@
  *****************************************************************************/
 
 #include "catch.hpp"
-
+#include <cstdlib>
 #include <mapnik/map.hpp>
 #include <mapnik/load_map.hpp>
 #include <mapnik/agg_renderer.hpp>
@@ -45,8 +45,10 @@ TEST_CASE("ogr") {
             mapnik::image_rgba8 im(256,256);
             mapnik::agg_renderer<mapnik::image_rgba8> ren(m, im);
             ren.apply();
-            //mapnik::save_to_file(im, "./test/data/images/point_json.png");
             std::string filename("./test/data/images/point_json.png");
+            if (std::getenv("UPDATE") != nullptr) {
+                mapnik::save_to_file(im, filename);
+            }
             std::unique_ptr<mapnik::image_reader> reader(mapnik::get_image_reader(filename,"png"));
             mapnik::image_any data = reader->read(0, 0, reader->width(), reader->height());
             mapnik::image_rgba8 expected = mapnik::util::get<mapnik::image_rgba8>(data);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/mapnik.git



More information about the Pkg-grass-devel mailing list