I'm new to OSM and I'm particularly interested in address point data. Currently I'm hoping to extract address point data using osmosis: osmosis --rx washington-latest.osm --tf accept-nodes 'addr:housenumber=', 'addr:street=' --tf reject-ways --tf reject-relations --wx ap_hn_st_nd_only.osm I found that many nodes that have housenumber and street information do not have a city or state tag. For instance: <node id="31368542" version="8" timestamp="2016-07-08T22:50:39Z" uid="137875" user="lukobe" changeset="40602379" lat="47.6611364" lon="-122.3140309"> <tag k="name" v="Neptune Theatre"/> <tag k="source" v="local knowledge"/> <tag k="amenity" v="theatre"/> <tag k="addr:street" v="Northeast 45th Street"/> <tag k="addr:housenumber" v="1303"/> </node> Is there a way to find out and backfill the data? For my use case, housenumber, street, city, and state are indispensable. |
The safest way would be loading the whole Washington file into a database with osm2pgsql (use hstore!) and then copy interesting objects into a new table, filling in missing state (well all should be Washington, right?) and city info based on what polygons the points are in. Thank you for the suggestion. Actually, we are working on extracting address point data at different countries. As far as I understand, in many countries (other than US), I can download data in the country-level granularity. Does OSM provide administrative boundary data as well (e.g., city, state)? If yes, I assume the type should be relation, right? If I understand you correctly, I probably can backfill missing city/state information in terms of the point-in-polygon relationship?
(06 Mar '17, 04:45)
zlzhao1104
|