A Livebook Smart Cell that joins two GeoFrame.GeoDataFrame variables spatially.
Add it from the Livebook cell menu (Smart > Spatial join). The left and right
selectors list the GeoFrame.GeoDataFrame variables of the notebook, refreshed whenever
a cell is evaluated. It is registered when the :geoframe application starts and Kino is
available.
Fields:
- Left and Right - the frames to join.
- Mode -
predicatecallsGeoFrame.sjoin/3;nearestcallsGeoFrame.sjoin_nearest/3. - Predicate - any of
GeoFrame.GeoSeries.sindex_valid_query_predicates/0, read asleft.predicate(right).dwithinalso needs a Distance. - How -
inner,leftorright. - Max distance and Distance column - the
sjoin_nearest/3options of the same name, both optional. - Assign to - the variable that receives the result (default
joined). - Show map - ends the cell with
GeoFrame.Kino.deck/2.
The cell generates code such as:
joined = GeoFrame.sjoin(points, zones, how: :inner, predicate: :within)
GeoFrame.Kino.deck(joined)