diff --git a/CHANGELOG.md b/CHANGELOG.md index 969fdfc..2e503df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.16.6 + +* Upgrade Wagyu to 0.3.0; downgrade C++ requirement to C++ 11 + ## 1.16.5 * Add -z and -Z options to tippecanoe-decode diff --git a/Makefile b/Makefile index 6485f88..12b3a2d 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ SHELL = /bin/bash CC := $(CC) CXX := $(CXX) CFLAGS := $(CFLAGS) -CXXFLAGS := $(CXXFLAGS) -std=c++14 +CXXFLAGS := $(CXXFLAGS) -std=c++11 LDFLAGS := $(LDFLAGS) WARNING_FLAGS := -Wall -Wshadow -Wsign-compare RELEASE_FLAGS := -O3 -DNDEBUG diff --git a/README.md b/README.md index 6faf15e..5162d2f 100644 --- a/README.md +++ b/README.md @@ -279,7 +279,7 @@ and perhaps make install -Tippecanoe now requires features from the 2014 C++ standard. If your compiler is older than +Tippecanoe now requires features from the 2011 C++ standard. If your compiler is older than that, you will need to install a newer one. On MacOS, updating to the lastest XCode should get you a new enough version of `clang++`. On Linux, you should be able to upgrade `g++` with diff --git a/geometry.cpp b/geometry.cpp index b8858cc..51e1a9a 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -9,7 +9,8 @@ #include #include #include -#include +#include +#include #include #include #include "geometry.hpp" @@ -445,19 +446,19 @@ drawvec simple_clip_poly(drawvec &geom, long long minx, long long miny, long lon ring.push_back(mapbox::geometry::point(geom[k].x, geom[k].y)); } - optional_linear_ring lr = mapbox::geometry::wagyu::quick_clip::quick_lr_clip(ring, bbox); + mapbox::geometry::linear_ring lr = mapbox::geometry::wagyu::quick_clip::quick_lr_clip(ring, bbox); - if (lr) { - for (size_t k = 0; k < lr->size(); k++) { + if (lr.size() > 0) { + for (size_t k = 0; k < lr.size(); k++) { if (k == 0) { - out.push_back(draw(VT_MOVETO, (*lr)[k].x, (*lr)[k].y)); + out.push_back(draw(VT_MOVETO, lr[k].x, lr[k].y)); } else { - out.push_back(draw(VT_LINETO, (*lr)[k].x, (*lr)[k].y)); + out.push_back(draw(VT_LINETO, lr[k].x, lr[k].y)); } } - if (lr->size() > 0 && (*lr)[0] != (*lr)[lr->size() - 1]) { - out.push_back(draw(VT_LINETO, (*lr)[0].x, (*lr)[0].y)); + if (lr.size() > 0 && lr[0] != lr[lr.size() - 1]) { + out.push_back(draw(VT_LINETO, lr[0].x, lr[0].y)); } } diff --git a/man/tippecanoe.1 b/man/tippecanoe.1 index 90d5ede..2c8efba 100644 --- a/man/tippecanoe.1 +++ b/man/tippecanoe.1 @@ -335,7 +335,7 @@ make install .fi .RE .PP -Tippecanoe now requires features from the 2014 C++ standard. If your compiler is older than +Tippecanoe now requires features from the 2011 C++ standard. If your compiler is older than that, you will need to install a newer one. On MacOS, updating to the lastest XCode should get you a new enough version of \fB\fCclang++\fR\&. On Linux, you should be able to upgrade \fB\fCg++\fR with .PP diff --git a/mapbox/geometry/wagyu/quick_clip.hpp b/mapbox/geometry/wagyu/quick_clip.hpp index 9153bef..56506fa 100644 --- a/mapbox/geometry/wagyu/quick_clip.hpp +++ b/mapbox/geometry/wagyu/quick_clip.hpp @@ -5,11 +5,6 @@ #include #include -#include - -template -using optional_linear_ring = std::experimental::optional>; - namespace mapbox { namespace geometry { namespace wagyu { @@ -61,7 +56,7 @@ bool inside(mapbox::geometry::point p, size_t edge, mapbox::geometry::box } template -optional_linear_ring quick_lr_clip(mapbox::geometry::linear_ring const& ring, +mapbox::geometry::linear_ring quick_lr_clip(mapbox::geometry::linear_ring const& ring, mapbox::geometry::box const& b) { mapbox::geometry::linear_ring out = ring; @@ -89,13 +84,14 @@ optional_linear_ring quick_lr_clip(mapbox::geometry::linear_ring const& ri } if (out.size() < 3) { - return optional_linear_ring(); + out.clear(); + return out; } // Close the ring if the first/last point was outside if (out[0] != out[out.size() - 1]) { out.push_back(out[0]); } - return optional_linear_ring(std::move(out)); + return out; } } @@ -107,8 +103,8 @@ mapbox::geometry::multi_polygon clip(mapbox::geometry::polygon const& poly wagyu clipper; for (auto const& lr : poly) { auto new_lr = quick_clip::quick_lr_clip(lr, b); - if (new_lr) { - clipper.add_ring(*new_lr, polygon_type_subject); + if (!new_lr.empty()) { + clipper.add_ring(new_lr, polygon_type_subject); } } clipper.execute(clip_type_union, result, subject_fill_type, fill_type_even_odd); @@ -124,8 +120,8 @@ mapbox::geometry::multi_polygon clip(mapbox::geometry::multi_polygon const for (auto const& poly : mp) { for (auto const& lr : poly) { auto new_lr = quick_clip::quick_lr_clip(lr, b); - if (new_lr) { - clipper.add_ring(*new_lr, polygon_type_subject); + if (!new_lr.empty()) { + clipper.add_ring(new_lr, polygon_type_subject); } } } diff --git a/mapbox/geometry/wagyu/wagyu.hpp b/mapbox/geometry/wagyu/wagyu.hpp index 7c4020f..21fde80 100644 --- a/mapbox/geometry/wagyu/wagyu.hpp +++ b/mapbox/geometry/wagyu/wagyu.hpp @@ -15,6 +15,12 @@ #include #include +#define WAGYU_MAJOR_VERSION 0 +#define WAGYU_MINOR_VERSION 3 +#define WAGYU_PATCH_VERSION 0 + +#define WAGYU_VERSION (WAGYU_MAJOR_VERSION * 100000) + (WAGYU_MINOR_VERSION * 100) + (WAGYU_PATCH_VERSION) + namespace mapbox { namespace geometry { namespace wagyu { diff --git a/version.hpp b/version.hpp index 34febff..d4ddcec 100644 --- a/version.hpp +++ b/version.hpp @@ -1 +1 @@ -#define VERSION "tippecanoe v1.16.5\n" +#define VERSION "tippecanoe v1.16.6\n"