Skip to content

Commit

Permalink
Use reversePoints() instead of reverseWindingOrder()
Browse files Browse the repository at this point in the history
  • Loading branch information
joto committed Dec 16, 2024
1 parent 2493d50 commit d3492cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/coastline_polygons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ unsigned int CoastlinePolygons::fix_direction() {
OGRLinearRing* er = polygon->getExteriorRing();
assert(er);
if (!er->isClockwise()) {
er->reverseWindingOrder();
er->reversePoints();
// Workaround for bug in OGR: reverseWindingOrder sets dimensions to 3
er->setCoordinateDimension(2);
for (int i = 0; i < polygon->getNumInteriorRings(); ++i) {
OGRLinearRing* ir = polygon->getInteriorRing(i);
assert(ir);
ir->reverseWindingOrder();
ir->reversePoints();
// Workaround for bug in OGR: reverseWindingOrder sets dimensions to 3
ir->setCoordinateDimension(2);
}
Expand Down

0 comments on commit d3492cb

Please sign in to comment.