Dear community, I spent soe time researching for my problem's solution, but unfortunately I couldn't find any. So here's what I want to do:
Does my approach makes sense? I'd be glad for any hints and tips, especially how to bring my OSM-file of highways into a list of all coordinates of the highway. Or, if this approach is not senseful at all, please let me know. Thanks a lot in advance! asked 24 Oct '17, 14:47 tom_sen |
This is what spatial databases are for. You should load the data into PostGIS with osm2pgsql, create a table with your points in it in PostGIS, and then you can make SQL queries like
Provided your points are stored in the same projection as the highways this will give you points that are roughly within 100m of a highway, of course you can also reduce that to 10m or 2m. The "manual" approach you sketched won't work because "the points of the highway", even if you were to extract them, can be hundreds of metres apart; even if one of your test points was bang in the middle of a highway, it could still be 100m away from the nearest "highway point". The spatial database does all the necessary calculations for you. answered 24 Oct '17, 18:50 Frederik Ramm ♦ Thank you very much, Frederik! That code helped me a lot and thanks for sharing the general approach with me!
(31 Oct '17, 19:09)
tom_sen
|