geopandas.GeoSeries.geom_equals_exact#
- GeoSeries.geom_equals_exact(other, tolerance, align=None)[来源]#
对于所有几何图形,如果与给定的其他在容差内相等,则返回真,否则返回假。
该操作以一对一的行方式进行:
- Parameters:
- otherGeoSeries or geometric object
要比较的GeoSeries(逐元素)或几何对象。
- tolerancefloat
用于测试近似相等时的小数位精度。
- 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.0), ... Point(0, 1.2), ... ] ... ) >>> s 0 POINT (0 1.1) 1 POINT (0 1) 2 POINT (0 1.2) dtype: geometry
>>> s.geom_equals_exact(Point(0, 1), tolerance=0.1) 0 False 1 True 2 False dtype: bool
>>> s.geom_equals_exact(Point(0, 1), tolerance=0.15) 0 True 1 True 2 False dtype: bool