Commit 74d297e
authored
corners, squareness and centroid_corner_distance use GeoSeries.exterior when
include_interiors=False, but exterior is undefined (None) for MultiPolygons.
The dropped rows make the grouped result shorter than the input index, so
corners/squareness raise a cryptic 'Length mismatch' and
centroid_corner_distance silently returns all-NaN. Add a shared
_check_no_multipolygons guard that raises an actionable ValueError pointing to
explode() or include_interiors=True.
Adds a parametrized test over the three metrics.
Per the discussion on #739 this takes the informative-error path; happy to
extend to full MultiPolygon support instead if preferred.
1 parent e2e75d9 commit 74d297e
2 files changed
Lines changed: 49 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
458 | 476 | | |
459 | 477 | | |
460 | 478 | | |
| |||
508 | 526 | | |
509 | 527 | | |
510 | 528 | | |
| 529 | + | |
511 | 530 | | |
512 | 531 | | |
513 | 532 | | |
| |||
571 | 590 | | |
572 | 591 | | |
573 | 592 | | |
| 593 | + | |
574 | 594 | | |
575 | 595 | | |
576 | 596 | | |
| |||
729 | 749 | | |
730 | 750 | | |
731 | 751 | | |
| 752 | + | |
732 | 753 | | |
733 | 754 | | |
734 | 755 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
| |||
272 | 274 | | |
273 | 275 | | |
274 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
275 | 303 | | |
276 | 304 | | |
277 | 305 | | |
| |||
0 commit comments