Hi, I am pretty new to OSM and GIS, i wondering how can i determine if a given point(lat,lon) is in a road segment or out. Further explanation on what i want to achieve : I have a reference point(lat1,lon1). I determine a circle with a radius of 30 meters, and a center (lat1, lon1). if want to know if this circle intersect roads. Any tips will be welcome ! Regards, Julien asked 02 Jul '13, 04:31 Julzen |
So you have the OSM road network and want to ask for some coordinate whether a road is (less than) 30 meters away? The relevant GIS terminology would probably be "buffering" (this is drawing the circle of 30m around your point) and "intersection testing" (to see whether a road intersects the buffer around the point). There are a few options for choosing software for that task. You could use a Desktop GIS like Quantum GIS, and then script your analysis with e.g. python scripting. This will have a steep learning curve if you never used a GIS before. You could import all OSM data into a PostGIS DB and then make the spatial queries using SQL, this would work better if you had a "working knowledge" of SQL. answered 02 Jul '13, 13:29 gormo |
The following will give you the most accurate results:
You can skip the whole "convert to geography" bit and use a suitable projection for your area of interest which will then usually yield results in the +/- 1 metre range; if you go with the default projection of Spherical Mercator and your area of interest is far away from the Equator you will be searching ellipses, not circles. SQL statements in this answer written from memory - not syntax proofed. answered 02 Jul '13, 21:13 Frederik Ramm ♦ |
Could you please tell more
do you want to do this rather once or rather automatically hundreds of times per second?
do you want an offline service with local data or rather an online service?
Hi Roland,
I want to do this automatically hundreds of times and i want an offline service.
Hope this would help!