Improve distance computation and add distance tool - #183
Draft
LionelZoubritzky-IGN wants to merge 5 commits into
Draft
Improve distance computation and add distance tool#183LionelZoubritzky-IGN wants to merge 5 commits into
LionelZoubritzky-IGN wants to merge 5 commits into
Conversation
LionelZoubritzky-IGN
force-pushed
the
138/distance-tool
branch
2 times, most recently
from
July 29, 2026 16:50
a0ce3c6 to
95059e1
Compare
Contributor
Author
|
In the current state, all distance tests pass except a few edge cases where an ill-formed polygon circles around a pole. Those are marked as expected failures because I'm not sure it's really possible to do better without introducing a LOT of new code dedicated to the analysis of this special case... which does not seem worth it (the case of a well-formed polygon does work). If you are curious though, there is a vibe-coded version in the https://github.com/ignfab/geocontext/tree/138/PROJECTIONS/distance-tool branch. |
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.
Replace the previous distance helper implementation with a turf-based implementation.
Also add a distance tool to expose this primitive to the LLM for the specific case of point-to-point computation. This tool works with four different profiles:
direct: distance as the crow flies (close Distance between two points tool #138).vincentyfor high-precision ellipsoid distance.carandpedestrian: distances along an itinerary, computed with the Geoplateforme.With the two latest mode, the time of travel is also returned. The itinerary can be chosen as the shortest time or the shortest distance.
Replaces #156 (updated algorithm and this PR is easier to maintain because it does not rely on my fork)