| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Thanks for the PR! I'll take a look and follow up. |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks for the fix! Your solution was spot on. While reviewing, I noticed another potential failure mode where polygon rings could have no points in the array so I added a guard against that as well (along with some more tests). I also added some logging similar to what we already do for invalid GeoJSON geometry.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Overview
Fixes #7874.
Prevent a zero-area MultiPolygon feature from aborting choropleth rendering. When centroid selection cannot find a positive-area sub-polygon, the feature now receives the existing [NaN, NaN] centroid sentinel. Its geometry remains available for rendering, while valid sibling features continue through extraction.
Root cause and user impact
The MultiPolygon centroid path initialized maxArea to zero and only selected sub-polygons whose area was strictly greater. If every sub-polygon had zero area, the selected polygon remained undefined and was passed to Turf's centroid helper, causing an uncaught TypeError that stopped the entire plot.
The guard is limited to that no-positive-area case. Centroid calculation for valid Polygon and MultiPolygon features is unchanged.
Validation