Replies: 1 comment 1 reply
-
I don't think there is a robust/generic distance method like you are looking for that takes any geometry. A brute force method could be to iterate through the coordinates in both geometries (using for example turf.coordEach()) calculating the shortest distance between each possible pair of coordinates to find the shortest distance, using turf.distance(p1, p2) or the possibly faster cheap-ruler library - https://github.com/mapbox/cheap-ruler |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i`m install [email protected]
I have a question. How can I calculate geometry to geometry shortest distance?
i only found “turf-point-to-line-distance”
example like: https://developers.arcgis.com/javascript/3/jsapi/esri.geometry.geometryengine-amd.html#distance
Beta Was this translation helpful? Give feedback.
All reactions