mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-06 10:25:41 +02:00
Merge pull request #358 from mapbox/wagyu-030
Upgrade to Wagyu 0.3.0; downgrade C++ requirement to C++ 11
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
## 1.16.6
|
||||||
|
|
||||||
|
* Upgrade Wagyu to 0.3.0; downgrade C++ requirement to C++ 11
|
||||||
|
|
||||||
## 1.16.5
|
## 1.16.5
|
||||||
|
|
||||||
* Add -z and -Z options to tippecanoe-decode
|
* Add -z and -Z options to tippecanoe-decode
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ SHELL = /bin/bash
|
|||||||
CC := $(CC)
|
CC := $(CC)
|
||||||
CXX := $(CXX)
|
CXX := $(CXX)
|
||||||
CFLAGS := $(CFLAGS)
|
CFLAGS := $(CFLAGS)
|
||||||
CXXFLAGS := $(CXXFLAGS) -std=c++14
|
CXXFLAGS := $(CXXFLAGS) -std=c++11
|
||||||
LDFLAGS := $(LDFLAGS)
|
LDFLAGS := $(LDFLAGS)
|
||||||
WARNING_FLAGS := -Wall -Wshadow -Wsign-compare
|
WARNING_FLAGS := -Wall -Wshadow -Wsign-compare
|
||||||
RELEASE_FLAGS := -O3 -DNDEBUG
|
RELEASE_FLAGS := -O3 -DNDEBUG
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ and perhaps
|
|||||||
|
|
||||||
make install
|
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
|
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
|
get you a new enough version of `clang++`. On Linux, you should be able to upgrade `g++` with
|
||||||
|
|
||||||
|
|||||||
+9
-8
@@ -9,7 +9,8 @@
|
|||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <sqlite3.h>
|
#include <sqlite3.h>
|
||||||
#include <mapbox/geometry.hpp>
|
#include <mapbox/geometry/point.hpp>
|
||||||
|
#include <mapbox/geometry/multi_polygon.hpp>
|
||||||
#include <mapbox/geometry/wagyu/wagyu.hpp>
|
#include <mapbox/geometry/wagyu/wagyu.hpp>
|
||||||
#include <mapbox/geometry/wagyu/quick_clip.hpp>
|
#include <mapbox/geometry/wagyu/quick_clip.hpp>
|
||||||
#include "geometry.hpp"
|
#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<long long>(geom[k].x, geom[k].y));
|
ring.push_back(mapbox::geometry::point<long long>(geom[k].x, geom[k].y));
|
||||||
}
|
}
|
||||||
|
|
||||||
optional_linear_ring<long long> lr = mapbox::geometry::wagyu::quick_clip::quick_lr_clip(ring, bbox);
|
mapbox::geometry::linear_ring<long long> lr = mapbox::geometry::wagyu::quick_clip::quick_lr_clip(ring, bbox);
|
||||||
|
|
||||||
if (lr) {
|
if (lr.size() > 0) {
|
||||||
for (size_t k = 0; k < lr->size(); k++) {
|
for (size_t k = 0; k < lr.size(); k++) {
|
||||||
if (k == 0) {
|
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 {
|
} 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]) {
|
if (lr.size() > 0 && lr[0] != lr[lr.size() - 1]) {
|
||||||
out.push_back(draw(VT_LINETO, (*lr)[0].x, (*lr)[0].y));
|
out.push_back(draw(VT_LINETO, lr[0].x, lr[0].y));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -335,7 +335,7 @@ make install
|
|||||||
.fi
|
.fi
|
||||||
.RE
|
.RE
|
||||||
.PP
|
.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
|
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
|
get you a new enough version of \fB\fCclang++\fR\&. On Linux, you should be able to upgrade \fB\fCg++\fR with
|
||||||
.PP
|
.PP
|
||||||
|
|||||||
@@ -5,11 +5,6 @@
|
|||||||
#include <mapbox/geometry/polygon.hpp>
|
#include <mapbox/geometry/polygon.hpp>
|
||||||
#include <mapbox/geometry/wagyu/wagyu.hpp>
|
#include <mapbox/geometry/wagyu/wagyu.hpp>
|
||||||
|
|
||||||
#include <experimental/optional>
|
|
||||||
|
|
||||||
template <typename T>
|
|
||||||
using optional_linear_ring = std::experimental::optional<mapbox::geometry::linear_ring<T>>;
|
|
||||||
|
|
||||||
namespace mapbox {
|
namespace mapbox {
|
||||||
namespace geometry {
|
namespace geometry {
|
||||||
namespace wagyu {
|
namespace wagyu {
|
||||||
@@ -61,7 +56,7 @@ bool inside(mapbox::geometry::point<T> p, size_t edge, mapbox::geometry::box<T>
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
optional_linear_ring<T> quick_lr_clip(mapbox::geometry::linear_ring<T> const& ring,
|
mapbox::geometry::linear_ring<T> quick_lr_clip(mapbox::geometry::linear_ring<T> const& ring,
|
||||||
mapbox::geometry::box<T> const& b) {
|
mapbox::geometry::box<T> const& b) {
|
||||||
mapbox::geometry::linear_ring<T> out = ring;
|
mapbox::geometry::linear_ring<T> out = ring;
|
||||||
|
|
||||||
@@ -89,13 +84,14 @@ optional_linear_ring<T> quick_lr_clip(mapbox::geometry::linear_ring<T> const& ri
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (out.size() < 3) {
|
if (out.size() < 3) {
|
||||||
return optional_linear_ring<T>();
|
out.clear();
|
||||||
|
return out;
|
||||||
}
|
}
|
||||||
// Close the ring if the first/last point was outside
|
// Close the ring if the first/last point was outside
|
||||||
if (out[0] != out[out.size() - 1]) {
|
if (out[0] != out[out.size() - 1]) {
|
||||||
out.push_back(out[0]);
|
out.push_back(out[0]);
|
||||||
}
|
}
|
||||||
return optional_linear_ring<T>(std::move(out));
|
return out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,8 +103,8 @@ mapbox::geometry::multi_polygon<T> clip(mapbox::geometry::polygon<T> const& poly
|
|||||||
wagyu<T> clipper;
|
wagyu<T> clipper;
|
||||||
for (auto const& lr : poly) {
|
for (auto const& lr : poly) {
|
||||||
auto new_lr = quick_clip::quick_lr_clip(lr, b);
|
auto new_lr = quick_clip::quick_lr_clip(lr, b);
|
||||||
if (new_lr) {
|
if (!new_lr.empty()) {
|
||||||
clipper.add_ring(*new_lr, polygon_type_subject);
|
clipper.add_ring(new_lr, polygon_type_subject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
clipper.execute(clip_type_union, result, subject_fill_type, fill_type_even_odd);
|
clipper.execute(clip_type_union, result, subject_fill_type, fill_type_even_odd);
|
||||||
@@ -124,8 +120,8 @@ mapbox::geometry::multi_polygon<T> clip(mapbox::geometry::multi_polygon<T> const
|
|||||||
for (auto const& poly : mp) {
|
for (auto const& poly : mp) {
|
||||||
for (auto const& lr : poly) {
|
for (auto const& lr : poly) {
|
||||||
auto new_lr = quick_clip::quick_lr_clip(lr, b);
|
auto new_lr = quick_clip::quick_lr_clip(lr, b);
|
||||||
if (new_lr) {
|
if (!new_lr.empty()) {
|
||||||
clipper.add_ring(*new_lr, polygon_type_subject);
|
clipper.add_ring(new_lr, polygon_type_subject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,12 @@
|
|||||||
#include <mapbox/geometry/wagyu/topology_correction.hpp>
|
#include <mapbox/geometry/wagyu/topology_correction.hpp>
|
||||||
#include <mapbox/geometry/wagyu/vatti.hpp>
|
#include <mapbox/geometry/wagyu/vatti.hpp>
|
||||||
|
|
||||||
|
#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 mapbox {
|
||||||
namespace geometry {
|
namespace geometry {
|
||||||
namespace wagyu {
|
namespace wagyu {
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
#define VERSION "tippecanoe v1.16.5\n"
|
#define VERSION "tippecanoe v1.16.6\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user