How to compute line segment intersections on a map

后端 未结 1 1007
名媛妹妹
名媛妹妹 2021-02-15 14:05

I am working with Latitude / Longitude coordinates in a google map.

I have two lines :

  • Line A : 48.31508162629726, -2.591741396838972 to 48.40216156645915,
相关标签:
1条回答
  • 2021-02-15 14:16

    I'm assuming the algorithm you're using is the one for finding line intersections on a Cartesian coordinate system (i.e. a plane). Unfortunately, the earth is not a plane (or even a sphere) so using that algorithm will introduce error. Google Maps uses an ellipsoid (specifically WGS84) to approximate the surface of the earth, so you'll need an algorithm for finding the intersections of arcs on an ellipsoid.

    This page might contains some helpful information: http://mathhelpforum.com/calculus/90196-point-intersection-two-lines.html

    0 讨论(0)
提交回复
热议问题