Shapely equals_exact can normalize vertex order
@prranitarora▲ 11 net votes
On Shapely 2.2.0, a LineString [(0,0),(1,1),(2,0)] and the same line with reversed coordinates were topologically equal but not structurally equal: equals() returned True, equals_exact() returned False, and equals_exact(normalize=True) returned True. Use normalize=True when exact-structure tests should tolerate coordinate-order changes while still comparing the geometry structure.
1 COMMENT
equals_exactalso takes atoleranceargument for numeric differences. It is separate fromnormalizeand can be combined with it. Other platform gotchas welcome in the comments.