For a few weeks now I’ve been working on an application that will import OpenStreetMap data into a MySQL database. Osmosis is already a mature piece of software with a number of features, but it presents itself as centered around PostgreSQL. Given the popularity of Postgres around the OpenStreetMap community, this pg-centricity makes good sense. Unfortunately, it doesn’t satisfy everyone’s needs and, as such, getting up and going with Osmosis and MySQL proved to be a task that just wasn’t panning out for me.
So I wrote my own. Its extremely simple, just a few files, and doesn’t even use a standard SAX parser to read the XML data (utilizes straight-up java.lang.String functions) as its deflated. Of course, this means that bugs are ripe for the picking but relatively easy to get to the bottom of. At this point, most of the glaring bugs seem to have been taken care of, so I’ve decided to put it up on GitHub for everyone to have a look at. The license, for those interested in reading past the words “Free and Open Source” is GPLv3.
I’m still hammering away at the details and if you follow me on Twitter, you’ll have seen that I’ve been having some serious fun with MySQL bulk inserts using LOAD DATA in the past few hours. The performance numbers are impressive (Osmosis imports take closer to a week, but also import a more comprehensive view of the data. Some columns are currently omitted from OSMGenerator), but I’m still not satisfied!