Commit 30db686
fix(portrayal): centre area symbols on the centroid, not the pole of inaccessibility
S-52 PresLib §8.5.3 specifies the area representative point is the CENTRE OF
GRAVITY (centroid) by default, using another point only when the centroid falls
outside the area. We always used the pole of inaccessibility (polylabel). For a
wide rectangle the pole is not unique — it slides along the horizontal mid-line —
so a centred symbol (e.g. the area TS_PAD tidal-stream diamond) landed visibly
off-centre even though its box looked symmetric.
areaLabelPoint now returns the ring centroid when it lies inside the even-odd
area, falling back to the polylabel search for concave/holed shapes where the
centroid is outside. Rectangular and convex areas now centre exactly (the area
TS_PAD diamond, and the quality-of-data boxes, sit dead-centre); concave shapes
keep the robust pole point.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 92cf22b commit 30db686
1 file changed
Lines changed: 49 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
225 | 234 | | |
226 | 235 | | |
227 | 236 | | |
| |||
298 | 307 | | |
299 | 308 | | |
300 | 309 | | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
301 | 350 | | |
302 | 351 | | |
303 | 352 | | |
| |||
0 commit comments