geopandas.GeoSeries.geom_equals_exact#

GeoSeries.geom_equals_exact(other, tolerance, align=True)[source]#

Return True for all geometries that equal aligned other to a given tolerance, else False.

The operation works on a 1-to-1 row-wise manner:

../../../_images/binary_op-01.svg
Parameters
otherGeoSeries or geometric object

The GeoSeries (elementwise) or geometric object to compare to.

tolerancefloat

Decimal place precision used when testing for approximate equality.

alignbool (default True)

If True, automatically aligns GeoSeries based on their indices. If False, the order of elements is preserved.

Returns
Series (bool)

Notes

This method works in a row-wise manner. It does not check if an element of one GeoSeries is equal to any element of the other one.

Examples

>>> from shapely.geometry import Point
>>> s = geopandas.GeoSeries(
...     [
...         Point(0, 1.1),
...         Point(0, 1.0),
...         Point(0, 1.2),
...     ]
... )
>>> s
0    POINT (0.00000 1.10000)
1    POINT (0.00000 1.00000)
2    POINT (0.00000 1.20000)
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