Imported Upstream version 3.0.13~rc2+ds
Bas Couwenberg
7 years ago
85 | 85 | - source bootstrap.sh |
86 | 86 | - | |
87 | 87 | if [[ $(uname -s) == 'Linux' ]]; then |
88 | mason install clang++ 3.9.0 | |
89 | export PATH=$(mason prefix clang++ 3.9.0)/bin:${PATH} | |
90 | mason install llvm-cov 3.9.0 | |
91 | export PATH=$(mason prefix llvm-cov 3.9.0)/bin:${PATH} | |
88 | mason install clang++ 3.9.1 | |
89 | export PATH=$(mason prefix clang++ 3.9.1)/bin:${PATH} | |
90 | mason install llvm-cov 3.9.1 | |
91 | export PATH=$(mason prefix llvm-cov 3.9.1)/bin:${PATH} | |
92 | 92 | which llvm-cov |
93 | export LLVM_COV="$(mason prefix llvm-cov 3.9.0)/bin/llvm-cov" | |
93 | export LLVM_COV="$(mason prefix llvm-cov 3.9.1)/bin/llvm-cov" | |
94 | 94 | fi |
95 | 95 | - ccache --version |
96 | 96 | - ccache -p || true |
7 | 7 | |
8 | 8 | ## 3.0.13 |
9 | 9 | |
10 | Released: January xx, 2017 | |
10 | Released: February xx, 2017 | |
11 | 11 | |
12 | 12 | (Packaged from xxxxxxx) |
13 | 13 | |
25 | 25 | - Changed `render_thunk_list` to `std::list<render_thunk>` (PR #3585) |
26 | 26 | - Upgraded to variant `v1.1.5` |
27 | 27 | - CSV.input - fixed `blank` line test (8a3a380b3b5c64681f2478b4f0d06f6a907f5eed) |
28 | ||
28 | - GeoJSON - handle empty elements in position grammar (ref #3609) | |
29 | - mapnik-index - return failure on invalid bounding box (ref #3611) | |
29 | 30 | |
30 | 31 | ## 3.0.12 |
31 | 32 |
10 | 10 | - shrink icu data |
11 | 11 | ' |
12 | 12 | |
13 | MASON_VERSION="3e2944322" | |
13 | MASON_VERSION="v0.5.0" | |
14 | 14 | |
15 | 15 | function setup_mason() { |
16 | 16 | if [[ ! -d ./.mason ]]; then |
18 | 18 | (cd ./.mason && git checkout ${MASON_VERSION}) |
19 | 19 | else |
20 | 20 | echo "Updating to latest mason" |
21 | (cd ./.mason && git fetch && git checkout ${MASON_VERSION} && git pull) | |
21 | (cd ./.mason && git fetch && git checkout ${MASON_VERSION} && git pull origin ${MASON_VERSION}) | |
22 | 22 | fi |
23 | 23 | export PATH=$(pwd)/.mason:$PATH |
24 | 24 | export CXX=${CXX:-clang++} |
6 | 6 | JOBS: 8 |
7 | 7 | CCACHE_TEMPDIR: /tmp/.ccache-temp |
8 | 8 | CCACHE_COMPRESS: 1 |
9 | LLVM_VERSION: 3.8 | |
10 | pre: | |
11 | - echo "here" | |
12 | post: | |
13 | - echo "there" | |
9 | LLVM_VERSION: 3.9.1 | |
14 | 10 | |
15 | 11 | checkout: |
16 | 12 | post: |
31 | 27 | database: |
32 | 28 | pre: |
33 | 29 | - ./bootstrap.sh |
34 | - ./.mason/mason install clang ${LLVM_VERSION}.0 | |
35 | - ./.mason/mason link clang ${LLVM_VERSION}.0 | |
36 | - ./configure CC="$(pwd)/mason_packages/.link/bin/clang-${LLVM_VERSION}" CXX="$(pwd)/mason_packages/.link/bin/ccache $(pwd)/mason_packages/.link/bin/clang++-${LLVM_VERSION} -Qunused-arguments" | |
30 | - ./.mason/mason install clang++ ${LLVM_VERSION} | |
31 | - ./.mason/mason link clang++ ${LLVM_VERSION} | |
32 | - ./configure CC="$(pwd)/mason_packages/.link/bin/clang" CXX="$(pwd)/mason_packages/.link/bin/ccache $(pwd)/mason_packages/.link/bin/clang++ -Qunused-arguments" | |
37 | 33 | - make |
38 | 34 | override: |
39 | 35 | - psql -c 'create database template_postgis;' |
115 | 115 | bool valid() const; |
116 | 116 | void move(T x, T y); |
117 | 117 | std::string to_string() const; |
118 | T area() const; | |
118 | 119 | |
119 | 120 | // define some operators |
120 | 121 | box2d_type& operator+=(box2d_type const& other); |
392 | 392 | return s.str(); |
393 | 393 | } |
394 | 394 | |
395 | template <typename T> | |
396 | T box2d<T>::area() const | |
397 | { | |
398 | return width() * height(); | |
399 | } | |
395 | 400 | |
396 | 401 | template <typename T> |
397 | 402 | box2d<T>& box2d<T>::operator+=(box2d<T> const& other) |
465 | 470 | case -1: |
466 | 471 | return maxy_; |
467 | 472 | default: |
468 | throw std::out_of_range("index out of range, max value is 3, min value is -4 "); | |
473 | throw std::out_of_range(std::string("index out of range, max value is 3, min value is -4 ")); | |
469 | 474 | } |
470 | 475 | } |
471 | 476 |
50 | 50 | qi::rule<Iterator, qi::locals<Iterator>, void(boxes_type&), space_type> features; |
51 | 51 | qi::rule<Iterator, qi::locals<int, box_type>, void(boxes_type&, Iterator const&), space_type> feature; |
52 | 52 | qi::rule<Iterator, qi::locals<box_type>, box_type(), space_type> coords; |
53 | qi::rule<Iterator, boost::optional<position_type>(), space_type> pos; | |
53 | qi::rule<Iterator, position_type(), space_type> pos; | |
54 | 54 | qi::rule<Iterator, void(box_type&), space_type> ring; |
55 | 55 | qi::rule<Iterator, void(box_type&), space_type> rings; |
56 | 56 | qi::rule<Iterator, void(box_type&), space_type> rings_array; |
41 | 41 | template <typename T0, typename T1> |
42 | 42 | result_type operator() (T0 & bbox, T1 const& pos) const |
43 | 43 | { |
44 | if (pos) | |
44 | typename T0::value_type x = pos.x; | |
45 | typename T0::value_type y = pos.y; | |
46 | if (!bbox.valid()) | |
45 | 47 | { |
46 | typename T0::value_type x = pos->x; | |
47 | typename T0::value_type y = pos->y; | |
48 | if (!bbox.valid()) | |
49 | { | |
50 | bbox.init(x, y); | |
51 | } | |
52 | else | |
53 | { | |
54 | bbox.expand_to_include(x, y); | |
55 | } | |
48 | bbox.init(x, y); | |
49 | } | |
50 | else | |
51 | { | |
52 | bbox.expand_to_include(x, y); | |
56 | 53 | } |
57 | 54 | } |
58 | 55 | }; |
63 | 60 | template <typename T0, typename T1, typename T2, typename T3> |
64 | 61 | void operator() (T0 & boxes, T1 const& begin, T2 const& box, T3 const& range) const |
65 | 62 | { |
66 | if (box.valid()) boxes.emplace_back(box, | |
67 | std::make_pair(std::distance(begin, | |
68 | range.begin()), | |
69 | std::distance(range.begin(), range.end()))); | |
63 | boxes.emplace_back(box, | |
64 | std::make_pair(std::distance(begin, | |
65 | range.begin()), | |
66 | std::distance(range.begin(), range.end()))); | |
70 | 67 | } |
71 | 68 | }; |
72 | 69 | |
131 | 128 | >> lit(':') >> (rings_array(_a) | rings (_a) | ring(_a) | pos[calculate_bounding_box(_a,_1)])[_val = _a] |
132 | 129 | ; |
133 | 130 | |
134 | pos = lit('[') > -(double_ > lit(',') > double_) > omit[*(lit(',') > double_)] > lit(']') | |
131 | pos = lit('[') > double_ > lit(',') > double_ > omit[*(lit(',') > double_)] > lit(']') | |
135 | 132 | ; |
136 | 133 | |
137 | ring = lit('[') >> pos[calculate_bounding_box(_r1,_1)] % lit(',') > lit(']') | |
134 | ring = lit('[') >> -(pos[calculate_bounding_box(_r1,_1)] % lit(',')) >> lit(']') | |
138 | 135 | ; |
139 | 136 | |
140 | rings = lit('[') >> ring(_r1) % lit(',') > lit(']') | |
137 | rings = lit('[') >> (ring(_r1) % lit(',') > lit(']')) | |
141 | 138 | ; |
142 | 139 | |
143 | rings_array = lit('[') >> rings(_r1) % lit(',') > lit(']') | |
140 | rings_array = lit('[') >> (rings(_r1) % lit(',') > lit(']')) | |
144 | 141 | ; |
145 | 142 | |
146 | 143 | coords.name("Coordinates"); |
43 | 43 | { |
44 | 44 | positions_grammar(ErrorHandler & error_handler); |
45 | 45 | qi::rule<Iterator, coordinates(),space_type> coords; |
46 | qi::rule<Iterator, boost::optional<position>(), space_type> pos; | |
46 | qi::rule<Iterator, position(), space_type> pos; | |
47 | 47 | qi::rule<Iterator, positions(), space_type> ring; |
48 | 48 | qi::rule<Iterator, std::vector<positions>(), space_type> rings; |
49 | 49 | qi::rule<Iterator, std::vector<std::vector<positions> >(), space_type> rings_array; |
40 | 40 | template <typename T0,typename T1> |
41 | 41 | result_type operator() (T0 & coords, T1 const& pos) const |
42 | 42 | { |
43 | if (pos) coords = *pos; | |
43 | coords = pos; | |
44 | 44 | } |
45 | 45 | }; |
46 | 46 | |
50 | 50 | template <typename T0, typename T1> |
51 | 51 | result_type operator() (T0 & coords, T1 const& pos) const |
52 | 52 | { |
53 | if (pos) coords.emplace_back(*pos); | |
53 | coords.emplace_back(pos); | |
54 | 54 | } |
55 | 55 | }; |
56 | 56 | |
74 | 74 | |
75 | 75 | coords = rings_array[_val = _1] | rings [_val = _1] | ring[_val = _1] | pos[set_position(_val,_1)] |
76 | 76 | ; |
77 | pos = lit('[') > -(double_ > lit(',') > double_) > omit[*(lit(',') > double_)] > lit(']') | |
77 | pos = lit('[') > double_ > lit(',') > double_ > omit[*(lit(',') > double_)] > lit(']') | |
78 | 78 | ; |
79 | ring = lit('[') >> pos[push_position(_val,_1)] % lit(',') > lit(']') | |
79 | ring = lit('[') >> -(pos[push_position(_val,_1)] % lit(',')) >> lit(']') | |
80 | 80 | ; |
81 | rings = lit('[') >> ring % lit(',') > lit(']') | |
81 | rings = lit('[') >> (ring % lit(',') > lit(']')) | |
82 | 82 | ; |
83 | rings_array = lit('[') >> rings % lit(',') > lit(']') | |
83 | rings_array = lit('[') >> (rings % lit(',') > lit(']')) | |
84 | 84 | ; |
85 | 85 | coords.name("Coordinates"); |
86 | 86 | pos.name("Position"); |
26 | 26 | |
27 | 27 | #define MAPNIK_MAJOR_VERSION 3 |
28 | 28 | #define MAPNIK_MINOR_VERSION 0 |
29 | #define MAPNIK_PATCH_VERSION 12 | |
29 | #define MAPNIK_PATCH_VERSION 13 | |
30 | 30 | |
31 | 31 | #define MAPNIK_VERSION (MAPNIK_MAJOR_VERSION*100000) + (MAPNIK_MINOR_VERSION*100) + (MAPNIK_PATCH_VERSION) |
32 | 32 |
186 | 186 | initialize_points(); |
187 | 187 | } |
188 | 188 | |
189 | struct largest_bbox_first | |
190 | { | |
191 | bool operator() (geometry::geometry<double> const* g0, geometry::geometry<double> const* g1) const | |
192 | { | |
193 | box2d<double> b0 = geometry::envelope(*g0); | |
194 | box2d<double> b1 = geometry::envelope(*g1); | |
195 | return b0.width() * b0.height() > b1.width() * b1.height(); | |
196 | } | |
197 | bool operator() (base_symbolizer_helper::geometry_cref const& g0, | |
198 | base_symbolizer_helper::geometry_cref const& g1) const | |
199 | { | |
200 | // TODO - this has got to be expensive! Can we cache bbox's if there are repeated calls to same geom? | |
201 | box2d<double> b0 = geometry::envelope(g0); | |
202 | box2d<double> b1 = geometry::envelope(g1); | |
203 | return b0.width() * b0.height() > b1.width() * b1.height(); | |
204 | } | |
205 | }; | |
189 | template <typename It> | |
190 | static It largest_bbox(It begin, It end) | |
191 | { | |
192 | if (begin == end) | |
193 | { | |
194 | return end; | |
195 | } | |
196 | It largest_geom = begin; | |
197 | double largest_bbox = geometry::envelope(*largest_geom).area(); | |
198 | for (++begin; begin != end; ++begin) | |
199 | { | |
200 | double bbox = geometry::envelope(*begin).area(); | |
201 | if (bbox > largest_bbox) | |
202 | { | |
203 | largest_bbox = bbox; | |
204 | largest_geom = begin; | |
205 | } | |
206 | } | |
207 | return largest_geom; | |
208 | } | |
206 | 209 | |
207 | 210 | void base_symbolizer_helper::initialize_geometries() const |
208 | 211 | { |
215 | 218 | type == geometry::geometry_types::MultiPolygon) |
216 | 219 | { |
217 | 220 | bool largest_box_only = text_props_->largest_bbox_only; |
218 | if (largest_box_only) | |
219 | { | |
220 | geometries_to_process_.sort(largest_bbox_first()); | |
221 | if (largest_box_only && geometries_to_process_.size() > 1) | |
222 | { | |
223 | auto largest_geom = largest_bbox( | |
224 | geometries_to_process_.begin(), | |
225 | geometries_to_process_.end()); | |
221 | 226 | geo_itr_ = geometries_to_process_.begin(); |
227 | if (geo_itr_ != largest_geom) | |
228 | { | |
229 | std::swap(*geo_itr_, *largest_geom); | |
230 | } | |
222 | 231 | geometries_to_process_.erase(++geo_itr_, geometries_to_process_.end()); |
223 | 232 | } |
224 | 233 | } |
513 | 513 | |
514 | 514 | for (auto const& c_str : {"./test/data/json/feature-malformed-1.geojson", |
515 | 515 | "./test/data/json/feature-malformed-2.geojson", |
516 | "./test/data/json/feature-malformed-3.geojson"}) | |
516 | "./test/data/json/feature-malformed-3.geojson", | |
517 | "./test/data/json/feature-malformed-4.geojson"}) | |
517 | 518 | { |
518 | 519 | std::string filename(c_str); |
519 | 520 | params["file"] = filename; |
553 | 554 | |
554 | 555 | SECTION("GeoJSON ensure mapnik::featureset::next() throws on malformed input") |
555 | 556 | { |
556 | std::string filename{"./test/data/json/featurecollection-malformed.json"}; | |
557 | 557 | mapnik::parameters params; |
558 | 558 | params["type"] = "geojson"; |
559 | params["file"] = filename; | |
560 | ||
561 | // cleanup in the case of a failed previous run | |
562 | if (mapnik::util::exists(filename + ".index")) | |
563 | { | |
564 | mapnik::util::remove(filename + ".index"); | |
565 | } | |
566 | ||
567 | CHECK(!mapnik::util::exists(filename + ".index")); | |
568 | int ret = create_disk_index(filename); | |
569 | int ret_posix = (ret >> 8) & 0x000000ff; | |
570 | INFO(ret); | |
571 | INFO(ret_posix); | |
572 | CHECK(mapnik::util::exists(filename + ".index")); | |
573 | ||
574 | for (auto cache_features : {true,false}) | |
575 | { | |
576 | params["cache_features"] = cache_features; | |
577 | auto ds = mapnik::datasource_cache::instance().create(params); | |
578 | auto fields = ds->get_descriptor().get_descriptors(); | |
579 | mapnik::query query(ds->envelope()); | |
580 | auto features = ds->features(query); | |
581 | REQUIRE_THROWS( | |
582 | auto feature = features->next(); | |
583 | while (feature != nullptr) | |
584 | { | |
585 | feature = features->next(); | |
586 | }); | |
587 | } | |
588 | ||
589 | // cleanup | |
590 | if (mapnik::util::exists(filename + ".index")) | |
591 | { | |
592 | mapnik::util::remove(filename + ".index"); | |
559 | for (auto const& c_str : {"./test/data/json/featurecollection-malformed.json", | |
560 | "./test/data/json/featurecollection-malformed-2.json"}) | |
561 | { | |
562 | std::string filename(c_str); | |
563 | params["file"] = filename; | |
564 | // cleanup in the case of a failed previous run | |
565 | if (mapnik::util::exists(filename + ".index")) | |
566 | { | |
567 | mapnik::util::remove(filename + ".index"); | |
568 | } | |
569 | ||
570 | CHECK(!mapnik::util::exists(filename + ".index")); | |
571 | int ret = create_disk_index(filename); | |
572 | int ret_posix = (ret >> 8) & 0x000000ff; | |
573 | INFO(ret); | |
574 | INFO(ret_posix); | |
575 | CHECK(mapnik::util::exists(filename + ".index")); | |
576 | ||
577 | for (auto cache_features : {true,false}) | |
578 | { | |
579 | params["cache_features"] = cache_features; | |
580 | auto ds = mapnik::datasource_cache::instance().create(params); | |
581 | auto fields = ds->get_descriptor().get_descriptors(); | |
582 | mapnik::query query(ds->envelope()); | |
583 | auto features = ds->features(query); | |
584 | REQUIRE_THROWS( | |
585 | auto feature = features->next(); | |
586 | while (feature != nullptr) | |
587 | { | |
588 | feature = features->next(); | |
589 | }); | |
590 | } | |
591 | ||
592 | // cleanup | |
593 | if (mapnik::util::exists(filename + ".index")) | |
594 | { | |
595 | mapnik::util::remove(filename + ".index"); | |
596 | } | |
593 | 597 | } |
594 | 598 | } |
595 | 599 |