geopandas.GeoSeries.geom_almost_equals#
- GeoSeries.geom_almost_equals(other, decimal=6, align=True)#
返回一个
Series
的dtype('bool')
有价值的True
如果每个对齐的几何图形近似等于 other 。在指定的所有点上测试近似相等 decimal 放置精确度。
该操作以1对1的行方式工作:
- 参数
- otherGeoSeries或几何对象
要比较的GeoSeries(元素级)或几何对象。
- decimal集成
测试近似相等时使用的小数位精度。
- align布尔值(默认为True)
如果为True,则根据其索引自动对齐GeoSeries。如果为False,则保留元素的顺序。
- 退货
- 系列(布尔图)
注意事项
此方法以行方式工作。它不会检查某个GeoSeries的元素是否等于 any 另一个元素的元素。
示例
>>> from shapely.geometry import Point >>> s = geopandas.GeoSeries( ... [ ... Point(0, 1.1), ... Point(0, 1.01), ... Point(0, 1.001), ... ], ... )
>>> s 0 POINT (0.00000 1.10000) 1 POINT (0.00000 1.01000) 2 POINT (0.00000 1.00100) 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