rendezvous-kit 1.8.0 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +12 -5
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -80,10 +80,13 @@ OSRM does not support isochrone computation — use it only when you need a fast
80
80
 
81
81
  | Function | Description |
82
82
  |----------|-------------|
83
- | `intersectPolygons(polygons)` | Sutherland–Hodgman N-polygon intersection; returns `GeoJSONPolygon \| null` |
83
+ | `intersectPolygons(polygons)` | Sutherland–Hodgman N-polygon intersection; returns largest component or `null` |
84
+ | `intersectPolygonsAll(polygons)` | N-polygon intersection preserving all disconnected components; returns `GeoJSONPolygon[]` |
84
85
  | `boundingBox(polygon)` | Compute `BBox` (minLon, minLat, maxLon, maxLat) |
85
86
  | `centroid(polygon)` | Geometric centre as `{ lat, lon }` |
86
87
  | `polygonArea(polygon)` | Area in square metres |
88
+ | `circleToPolygon(centre, radiusMetres, segments?)` | Approximate a circle as a GeoJSON Polygon (default 64 segments) |
89
+ | `getDestinationPoint(start, distanceMetres, bearingDeg)` | Haversine destination point from `[lon, lat]`, distance, and bearing |
87
90
 
88
91
  ### Engines
89
92
 
@@ -116,12 +119,15 @@ OSRM does not support isochrone computation — use it only when you need a fast
116
119
  | `Venue` | `{ name, lat, lon, venueType, osmId? }` |
117
120
  | `RendezvousOptions` | `{ participants, mode, maxTimeMinutes, venueTypes, fairness?, limit? }` |
118
121
  | `RendezvousSuggestion` | `{ venue, travelTimes, fairnessScore }` |
122
+ | `BBox` | `{ minLon, minLat, maxLon, maxLat }` |
123
+ | `Coordinate` | `{ lat, lon }` |
119
124
 
120
125
  ## Subpath Exports
121
126
 
122
127
  ```typescript
123
128
  import { findRendezvous } from 'rendezvous-kit' // barrel
124
- import { intersectPolygons, centroid } from 'rendezvous-kit/geo' // geometry
129
+ import { intersectPolygons, intersectPolygonsAll, centroid,
130
+ circleToPolygon, getDestinationPoint } from 'rendezvous-kit/geo' // geometry
125
131
  import { ValhallaEngine } from 'rendezvous-kit/engines/valhalla'
126
132
  import { OpenRouteServiceEngine } from 'rendezvous-kit/engines/openrouteservice'
127
133
  import { GraphHopperEngine } from 'rendezvous-kit/engines/graphhopper'
@@ -135,11 +141,12 @@ import { findRendezvous } from 'rendezvous-kit/rendezvous' // same
135
141
  `findRendezvous` runs six steps:
136
142
 
137
143
  1. **Isochrones** — compute a reachability polygon for each participant
138
- 2. **Intersection** — intersect all polygons using Sutherland–Hodgman; returns `null` if there is no overlap
144
+ 2. **Intersection** — intersect all polygons using Sutherland–Hodgman (supports concave shapes and disconnected components)
139
145
  3. **Venue search** — query Overpass API within the intersection's bounding box
140
146
  4. **Route matrix** — compute travel times from every participant to every candidate venue
141
- 5. **Scoring** — apply the fairness strategy to produce a single score per venue
142
- 6. **Ranking** — sort by score ascending and return the top `limit` suggestions
147
+ 5. **Filtering** — remove venues where any participant exceeds the time budget or is unreachable
148
+ 6. **Scoring** — apply the fairness strategy to produce a single score per venue
149
+ 7. **Ranking** — sort by score ascending and return the top `limit` suggestions
143
150
 
144
151
  If the isochrones do not overlap, `findRendezvous` returns an empty array. If no venues are found, it falls back to the geometric centroid of the intersection.
145
152
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rendezvous-kit",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "type": "module",
5
5
  "description": "Find fair meeting points for N people — isochrone intersection, venue search, and fairness scoring.",
6
6
  "main": "./dist/index.js",