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

Brett Henderson brett at bretth.com
Wed Mar 3 22:03:01 GMT 2010


On Wed, Mar 3, 2010 at 8:32 PM, Ævar Arnfjörð Bjarmason <avarab at gmail.com>wrote:

> On Wed, Mar 3, 2010 at 01:21, Brett Henderson <brett at bretth.com> wrote:
> > Hi Ævar,
> >
> > Can you provide the full error output from Osmosis.  I suspect there's a
> > "caused by" nested exception that provides the root cause for the error.
>
> After some more debugging it turns out that the issue is simply that
> the script/*.sql files are very out of date and in no way reflect the
> current DB schema or the tables that osmosis tries to insert into.
>

Um, I think you may be using the wrong tasks against the wrong schema.  It
sounds like you're trying to use "apidb" tasks against the Osmosis simple
schema.

The "pgsql" tasks are the ones required for the Osmosis "simple" schema that
you've created.  This schema doesn't have a concept of history tables so in
fact every table is a current table.  It is a PostGIS schema with optional
linestring and bbox columns on the way table.
http://wiki.openstreetmap.org/wiki/Osmosis/DetailedUsage#PostGIS_Tasks

The "apidb" tasks are the ones that write to the production rails API
schema.  There is a script called "script/contrib/apidb_0.6.sql" included
with Osmosis to create it.  It is somewhat out of date because I don't have
a working rails port, but should still be compatible if you switch on the
allowIncorrectSchemaVersion=yes on all database tasks.
http://wiki.openstreetmap.org/wiki/Osmosis/DetailedUsage#API_Database_Tasks


>
> In the attached patch I fixed some of these but it doesn't fix all the
> issues, the current_* tables are still missing. It would be nice if
> one could skip importing into current_* for one-off imports like
> these.
>

I had a quick look and it appears that you're adding APIDB tables to the
"simple" schema.

As for current_* tables, the "apidb" tasks do have a
populateCurrentTables=no option, but I don't think this is what you're
looking for.
http://wiki.openstreetmap.org/wiki/Osmosis/DetailedUsage#--write-apidb_.28--wd.29

Unless you really need apidb tasks, I'd stick with pgsql tasks because the
associated schema is much simpler.

Brett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20100304/488bb964/attachment.html>


More information about the dev mailing list