geopandas.GeoSeries.normalize#

GeoSeries.normalize()[source]#

Returns a GeoSeries of normalized geometries 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).

Examples

>>> from shapely.geometry import Polygon, LineString, Point
>>> s = geopandas.GeoSeries(
...     [
...         Polygon([(0, 0), (1, 1), (0, 1)]),
...         LineString([(0, 0), (1, 1), (1, 0)]),
...         Point(0, 0),
...     ],
...     crs='EPSG:3857'
... )
>>> s
0    POLYGON ((0.000 0.000, 1.000 1.000, 0.000 1.00...
1    LINESTRING (0.000 0.000, 1.000 1.000, 1.000 0....
2                                  POINT (0.000 0.000)
dtype: geometry
>>> s.normalize()
0    POLYGON ((0.000 0.000, 0.000 1.000, 1.000 1.00...
1    LINESTRING (0.000 0.000, 1.000 1.000, 1.000 0....
2                                  POINT (0.000 0.000)
dtype: geometry