Skip to content

Commit

Permalink
Merge pull request #12685 from Cattlesquat/12582
Browse files Browse the repository at this point in the history
12582 - Corrected divide-by-zero problem for Zones with completely blank polygons (no points in them)
  • Loading branch information
uckelman authored Sep 12, 2023
2 parents f81e59a + 8e9528b commit 2fa42c9
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,10 @@ else if (token.equals(GRID_LOCATION) && getGrid() != null) {
// no grid to match against
// try the geographic mean
p = new Point(0, 0);
if (myPolygon.npoints <= 0) {
return p;
}

for (int i = 0; i < myPolygon.npoints; ++i) {
p.translate(myPolygon.xpoints[i], myPolygon.ypoints[i]);
}
Expand Down

0 comments on commit 2fa42c9

Please sign in to comment.