My question is similar to this one, but the only answer offered over there does not satisfy my requirement. I need a to create a database containing the required data to auto-complete a postal address filled in by a user in a mobile application. In this context, my technical goal is to create a SQLite database with the cities, zip code and streets. I do not need the coordinates of the points.
I have no problem converting from a classic SQL flavor database to SQLite. I'm however having trouble going from I have the feeling that I'm not dealing with the problem with the right strategy and adequate tools.
Here is what I tried: Using an extract from OpenStreetMap Extracts, I have successfully created a SQLite database with osm2sqlite. I'm a bit confused about the format of the rows. And there is a lot of information I don't care about. While I could remove it, it feels backward to import it from osm to SQL to then remove it. Would be much more efficient to not import it in the first place.
Updated to describe an other try:
Seems nice, but I can't find the zip code. Is it not available for France in original osm file, or is it the import that skipped it? asked 04 Dec '12, 14:52 Guillaume aseerel4c26 ♦ |
Please have a look at the OSM wiki and do a search there for the tools called osmfilter and osmconvert. If you have your rae OSM source data, do a filtering for any objects to keep addr:* tags Then process the result file with osmconvert where you can produce CSV data sets easily. Then import that CSV data in any database you like. answered 04 Dec '12, 17:07 stephan75 @stephan75 If I want to import everything in the database, do I need to run the osmfilter command (your line "do a filtering for any objects to keep addr:* tags" sounds like you need to explicitly hint you want to keep a specific tag). I will try osmconvert to write a csv. I have also updated my question, to document my latest try with osm2pgsql
(04 Dec '12, 21:40)
Guillaume
hi Guillaume, Well, I am not so familiar with OSM import to an SQL database ... but if you want to know whether you NEED to do some filtering before importing: try it on your own! Take a small raw OSM file from an area, maybe your hometown or similar, and try all features of osmfilter to find out how it works and if you can benefit from it before importing. There are enough examples about filtering on the OSM wiki page of osmfilter. Tell us when you get stuck somewhere in detail, with adequate examples.
(05 Dec '12, 17:44)
stephan75
|