1

My problem is that I need to detect whether the green point in the picture is in the same street or not. I was first thinking about to check if all points are on the same line. But that will probably fail, because the street can have a defined width and therefore if the green point is not in the same line the result will false and I would have still the same problem. How can detect if the point is in the same street as the other two? Exists there a possible solution? Can I determine if a point is next to a line? Scenarios

Irgendw Pointer
  • 1,770
  • 3
  • 30
  • 67
  • 1
    Will the street always be straight or will you have to cater for bends? – npinti Sep 18 '13 at 12:41
  • 1
    You should write a method that can tell you which street(s) the point lies on. That probably has many other useful applications in your program, and allows you to do a trivial comparison to answer your initial question. – nitegazer2003 Sep 18 '13 at 12:51
  • You have to look for a geocoding solution. Feed all relevant points to the API and check whether you get the same street. – BetaRide Sep 18 '13 at 12:52
  • 5
    Any purely geometrical approach is probably doomed to eventual failure in the real world, for example [this is all the same street](https://maps.google.co.uk/maps?saddr=Ridge+Rd,+Greenbelt,+MD+20770,+USA&daddr=38.9998121,-76.8737527+to:39.0111874,-76.8843549+to:Crescent+Rd&hl=en&ll=39.005979,-76.883698&spn=0.02798,0.038581&sll=39.007146,-76.886487&sspn=0.027979,0.038581&geocode=FeAgUwIdRNtq-ykR9xgSz8O3iTE--TcfsxczKQ%3BFQQXUwId6P9q-ylPLuCT0sO3iTFmj7QkMCJgjg%3BFXNDUwIdftZq-ylRG92lx8O3iTHQ_R9HLPb23A%3BFVAuUwIdWrtq-w&dirflg=w&mra=dpe&mrsp=1&sz=15&via=1,2&t=m&z=15) – AakashM Sep 18 '13 at 13:01
  • 1
    Do you have any (minimum?) info defining the street boundaries/geometry? – yechabbi Sep 18 '13 at 13:02
  • I was thirstily thinking about to use the geometry given in osm. But later I figured out I can use the bearing function to determine if a point is in the same street or not. That works only for straight streets and I came on something on it that I need it only for crossing areas. – Irgendw Pointer Sep 18 '13 at 13:53

1 Answers1

0

You haven't defined what the same street actually means. Is it just the street name? Is it still the same street if the name changes, but there are no intersections? Is it still the same street if the name stays but the street class changes?

If it is just the name then doing a simple reverse-geocoding could be enough. In the case of OpenStreetMap you can use Nominatim to run a reverse-geocoding query for your points and compare the returned addresses. But remember to either comply with the usage policy of the official Nominatim instance or use an alternative instance, for example MapQuest's Nominatim instance or your own Nominatim instance.

scai
  • 20,297
  • 4
  • 56
  • 72
  • You are right I didn't define this. I thought the graphic will tell it. It is only about to know on junctions where the points are and if I'm going to connect them to avoid the possibility of intersections with buildings. That's why I'm now using the bearing function. to know if there is a junction or not. – Irgendw Pointer Sep 19 '13 at 09:33