Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

How to determine whether a route overlaps another route in Google Map?

  1. Mar 7, 2013 #1
    I've two routes in google map:

    i) A ---> B
    ii) C ---> D

    How can I determine if these routes overlap or not?
  2. jcsd
  3. Mar 7, 2013 #2
    I dont know any computer science....

    But my first thought is to list each route as a collection of points and then search for a match between the collections of points. This presumes that your routes are taking place on a gird with well defined points.
  4. Mar 19, 2013 #3
    I can't find a specific API function to determine if 2 routes overlap. However there is one that returns a route as a list of latitude/longitude pairs and you should be able to work it out from that.


    The algorithm to determine if 2 lines intersect is basic maths and is wikipedia


    If you actually need code for that, I am sure someone on stackoverflow can be persuaded to do it for some internet karma points.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Similar Threads for determine whether route
Java: Which Term determines this is a Sum?