If you try to use the simple PostGIS schema for Osmosis with QGIS, it complains about not having the right kind of index column in the schema. Is there a different schema for Osmosis that will work, or some hacking that you can do to make it work? asked 28 Jun '10, 14:35 Jonathan Ben... |
From the hacking side of things, you can add a serial column.
There is the same problem with osm2pgsql database schema, where this hack needs to be repeated after every fresh import since the table is dropped. I don't know if it's the same with osmosis PostGIS schema answered 06 Jul '10, 16:29 Andy Allan |
QGIS and other programs need a column with a unique 32 bit integer ("int" or "int4" in PostgreSQL) for every table they access. The Osmosis simple database schema uses larger integers ("bigint" or "int8" in PostgreSQL), so QGIS can't use them. There are two ways to fix this: Either change the id columns from int8 to int4 in the simple database schema before importing or add an additional column to each table like this:
You might have to do this after every re-import of data if the table was dropped in between. Also you probably want to add an index to this column:
Note that currently there are less than 2 billion nodes in the OSM database. This will change at some point. Then an int4 can't hold the id any more and we have to think about new solutions. answered 14 Jul '10, 13:47 Jochen Topf |
A similar problem occurs with GeoDjango. The affected tables in the Osmosis simple schema are all tables without id:
Adding a serial column as Andy Allan proposed helps, for example
answered 10 Jul '10, 10:21 emka |