0

I am using GeoSeries.distance to calculate the distance between a point and a linestring in a projected coordinate system. How does Geopandas calculate this distance? What is the logic behind the function? Is it the perpendicular distance of the point to the line? What if the perpendicular is only feasible on the line extension? Does python extend the line?

1
  • It's computing intersection point between line segment (2 sequential vertices) and perpendicular from point. Shortest distance is distance in question. If no intersection found, it's distance to nearest end of line.
    – FelixIP
    Commented May 16, 2023 at 0:13

1 Answer 1

2

geopandas uses shapely under the hood. Distance in shapely Returns the minimum distance (float) to the other geometric object. So it is the euclidean distance from the point to the nearest point on the linestring.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.