Calculate number of roads/lines a line crosses

  1. Hi guys,

    I have a really tricky problem here and I'm hoping that there is a math guru here who can help.

    The problem

    Using Google maps, I need to allow a user to draw a line. This line can be in any direction and basically, I need to determine if the user has drawn the line over a road and if so, how many.

    Below is an example:
    The image doesn't seem to be showing so here is the link: View image: map basic

    With Google Directions service, I am able to get the nearest road of the dropped marker (markers indicated by arrow in image).

    For a single road, I believe that I can do this with Pythagoras, but for multiple roads by brain starts to boil.

    If anyone here could help, I'd really appreciate it. I appreciate it is pretty tough so I'm open to all suggestions.

    Thanks!
     
    Last edited: Jun 18, 2014
  2. jcsd
  3. adjacent

    adjacent 1,533
    Gold Member

    I really don't understand what you want to do. Do you want to calculate he number of roads the line is intersecting?
     
  4. Yes, exactly that :)
     
Know someone interested in this topic? Share a link to this question via email, Google+, Twitter, or Facebook

Have something to add?

0
Draft saved Draft deleted