zones_for_points¶
zones_for_points
¶
zones_for_points(points: DataFrame | GeoDataFrame, zones: GeoDataFrame, *, predicate: str = 'within', columns: list[str] | None = None) -> GeoDataFrame
Tag each point (station / vehicle) with the geofencing zone(s) that contain it.
A spatial join, e.g. "which stations sit inside a no-parking zone?". Points outside
every zone keep null zone columns (left join). Requires the [geo] extra.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
points
|
DataFrame or GeoDataFrame
|
Points with |
required |
zones
|
GeoDataFrame
|
Output of |
required |
predicate
|
str
|
Spatial predicate ( |
"within"
|
columns
|
list of str
|
Zone attribute columns to attach (default: |
None
|
See Also
zone_area_km2 : Area of each zone.
to_canonical_geofencing : Parse the zones first.