aptitude install postgresql-8.4-postgis aptitude install libdbi-perl libhtml-template-perl libdbd-pg-perl createdb -O gernot -E UTF8 osm createlang plpgsql osm psql -d osm -f /usr/share/postgresql/8.4/contrib/postgis.sql psql -d osm -f /usr/share/postgresql/8.4/contrib/postgis_comments.sql psql -d osm -f /usr/share/postgresql/8.4/contrib/spatial_ref_sys.sql psql -d osm -f /home/gernot/osmosis-0.31/script/pgsql_simple_schema_0.6.sql psql -d osm -f /home/gernot/osmosis-0.31/script/pgsql_simple_schema_0.6_linestring.sql ALTER FUNCTION public.osmosisupdate() OWNER TO gernot; ALTER TABLE public.geometry_columns OWNER TO gernot; ALTER TABLE public.node_tags OWNER TO gernot; ALTER TABLE public.nodes OWNER TO gernot; ALTER TABLE public.relation_members OWNER TO gernot; ALTER TABLE public.relation_tags OWNER TO gernot; ALTER TABLE public.relations OWNER TO gernot; ALTER TABLE public.schema_info OWNER TO gernot; ALTER TABLE public.spatial_ref_sys OWNER TO gernot; ALTER TABLE public.users OWNER TO gernot; ALTER TABLE public.way_nodes OWNER TO gernot; ALTER TABLE public.way_tags OWNER TO gernot; ALTER TABLE public.ways OWNER TO gernot; CREATE TABLE completeborders ( id bigint, name character varying, complete integer, adminlevel integer, border geometry, path character varying, CONSTRAINT enforce_dims_border CHECK ((ndims(border) = 2)), CONSTRAINT enforce_srid_border CHECK ((srid(border) = 4326)) ); ALTER TABLE public.completeborders OWNER TO gernot; CREATE VIEW completebordersm AS SELECT completeborders.id, completeborders.name, completeborders.complete, (completeborders.adminlevel)::character varying AS admin_level, st_transform(completeborders.border, 900913) AS geom FROM completeborders; ALTER TABLE public.completebordersm OWNER TO gernot; insert into geometry_columns ( f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, type ) values ('', 'public', 'completebordersm', 'geom', '2', 900913, 'GEOMETRY'); CREATE TABLE completebordersp ( id bigint, geom geometry, name text ); ALTER TABLE public.completebordersp OWNER TO gernot; insert into geometry_columns ( f_table_catalog, f_table_schema, f_table_name, f_geometry_column, coord_dimension, srid, type ) values ('', 'public', 'completebordersp', 'geom', '2', 900913, 'POINT'); dpkg-reconfigure dash --> get rid of /bin/sh -> dash link See also: http://wiki.openstreetmap.org/wiki/Osmosis/PostGIS_Setup http://postgis.refractions.net/documentation/manual-1.4/ch02.html#id2701228 http://www.postgis.org/documentation/manual-1.4/ch02.html#upgrading http://wiki.ubuntuusers.de/Postgresql