Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions src/tile_worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,18 @@ bool writeRing(

bool firstPoint = true;
fbuilder.add_ring(points);
for (const Point& point : ring) {
pair<int, int> xy = std::make_pair(point.get<0>(), point.get<1>());
for (auto it = ring.rbegin(); it != ring.rend(); ++it) {
const Point& point = *it;

if (firstPoint || xy != lastXy) {
firstPoint = false;
lastXy = xy;
fbuilder.set_point(xy.first, xy.second);
}
}
pair<int, int> xy =
std::make_pair(point.get<0>(), point.get<1>());

if (firstPoint || xy != lastXy) {
firstPoint = false;
lastXy = xy;
fbuilder.set_point(xy.first, xy.second);
}
}

return true;
}
Expand Down Expand Up @@ -229,6 +232,8 @@ void writeMultiPolygon(
if (geom::is_empty(current))
return;

geom::correct(current);

geom::validity_failure_type failure;
if (verbose && !geom::is_valid(current, failure)) {
cout << "output multipolygon has " << boost_validity_error(failure) << endl;
Expand Down
Loading