Skip to main content
Returns a Series of dtype('bool') with value True for each aligned geometry that is within a set distance from other. The operation works on a 1-to-1 row-wise manner:

Signature

Parameters

GeoSeries or geometric object
required
The GeoSeries (elementwise) or geometric object to test for equality.
numeric scalar, array-like, pandas Series, or pandas-on-Spark Series
required
Distance(s) to test if each geometry is within. A scalar distance is applied to every geometry. Array-like and Series distances are paired positionally with the geometry rows after self and other have been aligned. A one-element non-Series array-like is broadcast; otherwise the distance input must have the same length as the aligned geometries.
bool | None (default None)
default:"None"
If True, automatically aligns GeoSeries based on their indices. If False, the order of elements is preserved. None defaults to True.

Returns

Series(bool)
This method works in a row-wise manner. It does not check if an element of one GeoSeries is within the set distance of any element of the other one.The index of a pandas or pandas-on-Spark distance Series is ignored. Distance values remain distributed when a pandas-on-Spark Series is provided. Length validation for non-scalar distances is lazy: an error is raised only when an action evaluates a mismatched row. Partial actions may not detect rows they do not evaluate.
See also
  • GeoSeries.within

Examples

We can check if each geometry of GeoSeries contains a single geometry:
We can also check two GeoSeries against each other, row by row. The GeoSeries above have different indices. We can either align both GeoSeries based on index values and compare elements with the same index using align=True or ignore index and compare elements based on their matching order using align=False: