Add route and isochrone methods backed by Felt's routing service - #146
Closed
noisyneuron wants to merge 1 commit into
Closed
noisyneuron wants to merge 1 commit into
noisyneuron wants to merge 1 commit into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extensions and embeds can now ask Felt's routing service for a route through a list of waypoints, or for the area reachable from a point within a travel time, and get geometry back without anything being drawn on the map. A route comes back as a GeoJSON LineString with its distance in metres and duration in seconds, so it can be passed straight on to methods that take a line. An isochrone always comes back as a single MultiPolygon, so a reachable area that splits into disconnected parts keeps every part. Waypoints and the origin are
{ latitude, longitude }objects, matching how the SDK already names single places. The travel mode isroutingMode, as on route elements and the route tool, but without"flying", since the service only follows roads and paths; the mode of transport on route elements is now the exportedRoutingModetype so the relationship is visible.Input limits (2–50 waypoints, travel time above 0 and at most 120 minutes) are enforced by the SDK's schema, so out-of-range requests are rejected before they reach Felt. Both methods live in a new Routing module with its own docs page and section in
llms-full.txt.Test plan
felt.getRoute({ waypoints: [a, b], routingMode: "driving" })with two points a few streets apart. Observe that the promise resolves to aLineStringthat follows roads, plus adistancein metres and adurationin seconds.felt.getIsochrone({ origin: a, routingMode: "walking", minutes: 15 })on a map whose workspace plan includes isochrones. Observe that it resolves to{ geometry }withtype: "MultiPolygon".felt.getRoutewith one waypoint, orfelt.getIsochronewithminutes: 0. Observe that the promise rejects before any request is made.Made with Cursor