Have a look to see if there are any columns in your database named "addr
" or similar. If there are then you may be able to query the database directly and isolate these rows.
If not, you probably need to create a database schema with address tags included from scratch. Broadly how I might go about doing it is as follows:
- Run the raw .osm datafile through Osmosis, filtering out only those tags with an
addr:*
prefix. Probably using the --tag-filter. It might be easier to filter out only points, but some polygons may have the tag as well.
- As part of the same osmosis task, dump the resulting filtered data into a postgis database. You may need to develop a custom schema for the addresses, as they may not be imported by default
- Generalise the resulting data if you have line or polygon objects (e.g. get centroid) so that each address has one co-ordinate.
- Query the database for your geocoded addresses
Steps 1 and 2 could be replaced by creating your own osm2pgsql schema, which might be easier.
If this seems like a lot of work that's because it is. AFAIK there are relatively few osm tools to support getting addresses like this at the moment, but happy to be corrected. I would check before you start that it's going to be worth your while - i.e. people have been busy in your area tagging addresses on the map and address tags are not very sparse.
osm2pgsql -U user RU-SPE.osm