geopandas.GeoSeries.normalize#

GeoSeries.normalize()[来源]#

返回一个 GeoSeries 的标准化几何图形,转换为标准形式(或规范形式)。

这个方法一致地排序多边形的坐标、环和多几何体的部分。通常在测试时很有用(例如结合使用equals_exact)。

示例

>>> 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),
...     ],
... )
>>> s
0    POLYGON ((0 0, 1 1, 0 1, 0 0))
1        LINESTRING (0 0, 1 1, 1 0)
2                       POINT (0 0)
dtype: geometry
>>> s.normalize()
0    POLYGON ((0 0, 0 1, 1 1, 0 0))
1        LINESTRING (0 0, 1 1, 1 0)
2                       POINT (0 0)
dtype: geometry