You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Range query |`.range_query(min_x, min_y, max_x, max_y)`| Rows inside the bounding box |
66
-
| Range filter |`.range_filter(min_x, min_y, max_x, max_y)`| New SpatialFrame with only rows inside the bounding box |
67
-
| k-nearest neighbours |`.knn(x, y, k)`| The `k` rows nearest a point |
68
-
| kNN join |`.knn_join(df, x_col, y_col, k)`| The `k` nearest rows for each query point |
69
-
| Within-distance join |`.within_distance_join(df, x_col, y_col, distance)`| Rows within `distance` of each query point |
70
-
| Convex-hull area |`SpatialFrame.convex_hull_area(xs, ys)`| Area of the convex hull of a point set |
71
-
| Batch convex-hull area |`Engine.group_convex_hull_areas(xs_series, ys_series)`| Convex hull area for each group, given Polars `List[Float64]` columns |
72
-
| WKB point distance |`wkb_point_distance(series_a, series_b)`| Euclidean distance between two WKB point columns |
| Point in polygon |`.contains(x, y)`| Polygons that contain the point |
79
-
| MBR range |`.range_query(min_x, min_y, max_x, max_y)`| Polygons whose bounding box meets the query box |
80
-
| Range filter |`.range_filter(min_x, min_y, max_x, max_y)`| New SpatialFrame with only polygons intersecting the bounding box |
81
-
| Within join |`.within_join(df, x_col, y_col)`| Polygons that contain each query point |
82
-
| Point-to-polygon distance join |`.polygon_within_distance_join(df, x_col, y_col, distance)`| Polygons within `distance` of each query point |
83
-
| Point-to-polygon kNN join |`.polygon_knn_join(df, x_col, y_col, k)`| The `k` nearest polygons for each query point |
84
-
| Intersects self-join |`.intersects_pairs(key_col=None)`| Intersecting polygon pairs with overlap area and IoU; `key_col` replaces positional indices with values from that column |
85
-
| Area |`.polygon_areas()`| Area of each polygon |
86
-
| Points near a polygon |`.points_within_distance_of_polygon(polygon, distance)`| Points within `distance` of a single polygon |
87
-
88
-
**Reductions and streaming** (compose with any join)
The optimizer flipped the declaration order. The scalar filter runs first on all rows, then the spatial query runs on the smaller survivor set. Plans follow Polars' FROM-chain convention, so the bottom runs first and the top is the final result.
144
-
145
-
### Aggregate over a join
146
-
147
-
```python
148
-
import pycanopy as pc
149
-
150
-
# Count trips per zone and average their fare, reduced over a streamed
151
-
# point-in-polygon join. The full pair frame is never materialised: each
152
-
# morsel reduces to per-group partials that combine into the final result.
# Queries probe the main index and scan the delta in parallel.
324
-
result = sf.lazy().range_query(-10.0, 35.0, 40.0, 70.0).collect()
325
-
326
-
# The buffer flushes automatically when accumulated query cost exceeds
327
-
# the estimated index rebuild cost, or when it exceeds 10% of N.
328
-
# Force a flush manually if needed.
329
-
sf.engine.flush()
330
-
```
331
-
332
-
</details>
61
+
The full API reference, operation catalogue, and technical deep dive into the planner and cost model live at **[pranav-walimbe.github.io/PyCanopy](https://pranav-walimbe.github.io/PyCanopy)**.
333
62
334
63
---
335
64
@@ -509,21 +238,6 @@ The hot paths need packed immutable index structures, zero-copy array slices at
0 commit comments