Hi OSM community, I am totally new to Geodata and gis, so please try to answer even if its a dumb question. My task is to find the distance between 2 given addresses using osm. What I have done so far ?
Approach for my task: So to calculate the distance between 2 points I thought of gecoding the addresses first and then use st_distance() to find the distance between the 2 points. (Please correct me if my approach is not advisable) Where I am stuck ? To select the polygon using the postal code, I thought of filtering it through postal_code. Unfortunately it does not have a column named postal_code. So how could I achieve this using the above mentioned tables and geocode the address. EDIT 1: Or is it possible to just extract "addr:city", "addr:country", "addr:housenumber", "addr:housename", "addr:postcode", "addr:street", "lat", "lon"fields from osm file using osmconvert and then query against it to get the lat/lon ? asked 01 Feb '17, 15:25 3yK |
It is of course possible to extract the addresses. Take a look at http://wiki.openstreetmap.org/wiki/Nominatim It depends on where you are located, but there is a good chance that there won't be polygon features associated with postal codes, or perhaps even much address data at all. answered 01 Feb '17, 16:12 maxerickson But the installation of nominatim seems a little bit complicated. My query looks simple. Is it possible to geocode using the question I asked in the section EDIT 1 ? will it miss some data ? What are the advantages of using nominatim over manual querying ?
(01 Feb '17, 16:42)
3yK
1
You can investigate the results nominatim returns using the public server: http://nominatim.openstreetmap.org/ nominatim builds on the osm2pgsql schema that you have used above, adding indexes and associations that are not necessarily explicitly given in any of the osm2gpsql tables. So what you are doing is starting to implement pieces of what nominatim does.
(01 Feb '17, 17:01)
maxerickson
1
Nominatim takes the same data as you did but processes and stores it in such a way that geocoding is fast. This includes combining information from different types of relations and objects. Postal code boundaries as mapped as separate relations in some countries (e.g. Germany, part of Belgium). This technique is not possible in e.g. the USA and the UK where zip codes are not areas.
(02 Feb '17, 12:04)
escada
|