Converts OpenStreetMap data to a PostgreSQL / PostGIS database
Converts OSM planet.osm data to a PostgreSQL / PostGIS database suitable for specific applications like rendering into map tiles by Mapnik or geocoding with Nominatim.
osm2pgsql currently supports two different database schemas 1) A database schema that is optimized for ease of rendering by Mapnik. 2) A database schema that is optimized for geocoding with Nominatim, emphasizing the spatially hierarchical organizations of objects.
Both schemas were specifically optimized for the purpose they were intended for and they may therefore be less suitable for other general purpose processing. Nevertheless, the rendering schema might be useful for other purposes as well, and has been used for a variety of additionally purposes.
For more info see http://wiki.openstreetmap.org/index.php/Osm2pgsql