compare polygon ring areas absolutely

- This ensures we actually keep the largest polygons
  - Adds testcase that fails without this patch
This commit is contained in:
Dane Springmeyer
2017-01-06 17:51:35 -08:00
committed by John Firebaugh
parent dfb3c34837
commit 13e5041553
2 changed files with 47 additions and 1 deletions

View File

@@ -127,7 +127,7 @@ void limitHoles(GeometryCollection& polygon, uint32_t maxHoles) {
polygon.begin() + 1 + maxHoles,
polygon.end(),
[] (const auto& a, const auto& b) {
return signedArea(a) > signedArea(b);
return std::fabs(signedArea(a)) > std::fabs(signedArea(b));
});
polygon.resize(1 + maxHoles);
}