shapely.normalize#
- normalize(geometry, **kwargs)#
Converts Geometry to normal form (or canonical form).
This method orders the coordinates, rings of a polygon and parts of multi geometries consistently. Typically useful for testing purposes (for example in combination with
equals_exact
).- Parameters:
- geometryGeometry or array_like
- **kwargs
For other keyword-only arguments, see the NumPy ufunc docs.
Examples
>>> from shapely import MultiLineString >>> line = MultiLineString([[(0, 0), (1, 1)], [(2, 2), (3, 3)]]) >>> normalize(line) <MULTILINESTRING ((2 2, 3 3), (0 0, 1 1))>