So far, we've only used Osmosis to process OpenStreetMap data in local XML files. It can also read and write data to a database, which is more complex to set up, but faster for many operations. Setting up a database for the data can be complicated, but you only need to do it once.
Osmosis supports three types of databases:
PostGIS with a simple schema
The OpenStreetMap API schema on PostgreSQL
A legacy API schema on MySQL
We'll cover the first of these in this chapter. The second format is used when handling data on the OpenStreetMap servers, and isn't intended for use with any other system. The last format is no longer actively supported, as it isn't used on OpenStreetMap's servers any more, and you shouldn't use this format for new databases.
PostGIS (http://postgis.refractions.net/) is a version of the open source PostgreSQL database with geospatial extensions that allows you to retrieve geographic data, such as OpenStreetMap, efficiently. You can use PostGIS...