geopandas.GeoSeries.geom_almost_equals#
- GeoSeries.geom_almost_equals(other, decimal=6, align=None)[来源]#
返回一个
Series的dtype('bool'),如果每个对齐的几何形状大致等于 other,则其值为True。在所有点上测试近似相等性,以达到指定的 小数 位数精度。
该操作以一对一的行方式进行:
- Parameters:
- otherGeoSeries or geometric object
要比较的GeoSeries(逐元素)或几何对象。
- decimalint
用于测试近似相等时的小数位精度。
- alignbool | None (default None)
如果为真,则根据其索引自动对齐GeoSeries。 如果为假,则保留元素的顺序。 None默认为真。
- Returns:
- Series (bool)
笔记
该方法以行的方式工作。它不检查一组GeoSeries的元素是否等于另一组中任何元素。
示例
>>> from shapely.geometry import Point >>> s = geopandas.GeoSeries( ... [ ... Point(0, 1.1), ... Point(0, 1.01), ... Point(0, 1.001), ... ], ... ) >>> s 0 POINT (0 1.1) 1 POINT (0 1.01) 2 POINT (0 1.001) dtype: geometry
>>> s.geom_almost_equals(Point(0, 1), decimal=2) 0 False 1 False 2 True dtype: bool
>>> s.geom_almost_equals(Point(0, 1), decimal=1) 0 False 1 True 2 True dtype: bool