[OSM-dev] Using osmosis for a daily from-scratch import into PostgreSQL and SQLite support

Ævar Arnfjörð Bjarmason avarab at gmail.com
Wed Mar 3 11:23:34 GMT 2010


On Wed, Mar 3, 2010 at 01:57, Jochen Plumeyer <jochen at plumeyer.org> wrote:
> Dear Ævar Arnfjörð,
>
> On Mar 02 Mar 2010, Ævar Arnfjörð Bjarmason wrote:
>> It would be even better if it could write to an SQLite database, then
>> it would be trivial to turn a .osm file into a .sqlite file for easy
>> querying of the data. There's a lot of tools in the OSM SVN that could
>> use something like this but right now they just implement their own
>> ad-hoc XML parsing in a while (<>) {}.
>
> I wrote scripts which are using the expat library, no dirty parsing, to
> SQLite:
> http://plumeyer.org/osm/osm2sqlite.pl
>
> The bottlenecks of this rather slow script is conversion from date strings to
> UNIX epoch seconds, and the whole SQLite latency, although the data is
> committed in larger chunks.

That's neat. I hacked it up to use prepared statements & changed the
schema which brought the runtime from c.a. 4m52.121s to 2m44.241s
(real).

My changes are here: http://github.com/avar/osm2sqlite




More information about the dev mailing list