diff --git a/src/extractor/location_dependent_data.cpp b/src/extractor/location_dependent_data.cpp index 810c394f4..b9f9311ea 100644 --- a/src/extractor/location_dependent_data.cpp +++ b/src/extractor/location_dependent_data.cpp @@ -99,7 +99,11 @@ void LocationDependentData::loadLocationDependentData(const boost::filesystem::p std::vector segments; auto append_ring_segments = [&segments, &to_point](const auto &coordinates_array) -> box_t { - box_t envelop; + using coord_t = boost::geometry::traits::coordinate_type::type; + auto x_min = std::numeric_limits::max(); + auto y_min = std::numeric_limits::max(); + auto x_max = std::numeric_limits::min(); + auto y_max = std::numeric_limits::min(); if (!coordinates_array.Empty()) { point_t curr = to_point(coordinates_array[0]), next; @@ -107,10 +111,14 @@ void LocationDependentData::loadLocationDependentData(const boost::filesystem::p { next = to_point(coordinates_array[i]); segments.emplace_back(curr, next); - boost::geometry::expand(envelop, next); + x_min = std::min(x_min, next.x()); + x_max = std::max(x_max, next.x()); + y_min = std::min(y_min, next.y()); + y_max = std::max(y_max, next.y()); } } - return envelop; + + return box_t{{x_min, y_min}, {x_max, y_max}}; }; auto envelop = append_ring_segments(rings[0].GetArray()); @@ -121,7 +129,7 @@ void LocationDependentData::loadLocationDependentData(const boost::filesystem::p } constexpr const std::size_t segments_per_band = 10; - constexpr const std::size_t max_bands = 10000; + constexpr const std::size_t max_bands = 100000; auto num_bands = segments.size() / segments_per_band; if (num_bands < 1) {