Hi. First of All. I'm new to OSM. I ask this question in general form because I don't know where to look for this kind of solution. I need the list of Cities and Villages that will be along the route from from point A (specified by lat,lon) to the point B (also specified by lat,lon). This list should be in correct order from point A to B. For now I have a database with all Cities, and Villages in Country with lat,lon coordinates for each entry. I don't have connections between those places in this database. Now I'm wondering how to add to this feature to show me the names of the places on the route from point A to point B (or from one place to other) Can anybody give me some advice how to develop this kind of feature similar to routing. This feature will be developed for the website that is based on PHP and MySQL only. asked 13 Dec '11, 12:56 Kapucha aseerel4c26 ♦ |
If you want details for each step, then this question should be broken into multiple questions. At a high level, here's the approach I would take.
Items 3 and 4 may not be very practical to do with MySQL because its support for spatial data is very limited. If you could use any free, open source database for this, then PostgreSQL + PostGIS extension would be a much better choice. If you're locked into MySQL, then you'll probably need to do the spatial calculations externally to the database, and I'd look for a PHP wrapper of GEOS or JTS (Java Topology Suite). I'd also recommend trying the GIS StackExchange site for questions that aren't primarily about working with OSM data. answered 17 Dec '11, 17:53 DanHomerick |
Where is OSM in your question ? the places locations ? the path between them ? Or is it just a developer question about routing algorithmes ?
Several questions come up in my mind. First of all: do you need an exact route between the two places or just an "as the crow flies" straight line? What is the coverage of your app? Whole world or just a single country?
Where did these cities, villages etc come from? OSM? If so, you need to also get the roads or tracks or rivers or railways or cycleways or whatever your route is using to then calculate the route.
Cities and villages are not a single lon-lat. They cover an area. if your route just passes the lon-lat for a village did it go through the edge of a big village or pass a small one by?
@Breki One Country. No straight line. along the public roads. Straight line with some kilometers tolerancy is simple for me. I see that I need to calculate the route along the public roads. Then in some way analyze this route and get the cities and villages near this route in correct order.
@ChrisH The data is not from OSM. I have database with all the cities and villages from one country but this is not from OSM. I don't have connections between those places in database. I need to get it from some place because without this I can't calculate the route I assume.