manuelbieh/geolib

Add precise version of isPointInLine

groupsky opened this issue · 0 comments

When processing some data I stumbled on the difference in the two distance calculation methods.

isPointInLine(
  { latitude: 41.61884689, longitude: 24.66986465 },
  { latitude: 41.6166666286222, longitude: 24.5994927167 },
  { latitude: 41.6191097253556, longitude: 24.7194241952577}
)

Returns true, but if using the getPriceDistance for calculating the distance to the line it results in around 100m.

A sample geojson also shows the point is outside of the poly and not on the line.

For situations like this would be good to have the ability to provide the distancing function to isPointInLine similar how it's done for getPathLength.