[OSM-talk] set up PostGIS with OSM data
Torsten Mohr
tmohr at s.netic.de
Thu Apr 16 09:16:30 BST 2009
Hello,
i have two sources of information that seem to contradict sometimes,
maybe somebody can give me some hints?
I used subversion to checkout svn.openstreetmap.org.
After installing geos-3.1.0 i could compile and install osm2pgsql.
I also downloaded and installed postgis-1.3.5.
I've also set up PostgreSQL on my linux system.
In svn.openstreetmap.org/applications/rendering/mapnik/install.txt
i've read how to set up the tables in PostgreSQL (see below).
This description is missing on:
http://wiki.openstreetmap.org/wiki/Mapnik#World_Boundaries
Isn't it necessary?
<snip>
# some line breaks are added...
export user_name="tmohr"
sudo -u postgres createuser -Upostgres -S -D -R "$user_name"
echo "GRANT ALL ON SCHEMA PUBLIC TO \"$user_name\";" |
sudo -u postgres psql -Upostgres gis
sudo -u postgres createlang plpgsql gis
sudo -u postgres psql -Upostgres gis </usr/share/postgresql/lwpostgis.sql \
2>&1 | grep -v -e 'FEHLER: aktuelle Transaktion' \
-e 'ERROR: current transaction is aborted' \
-e 'CREATE FUNCTION' -e OPERATOR
echo "GRANT ALL on geometry_columns TO \"$user_name\";" |
sudo -u postgres psql -Upostgres gis
echo "GRANT ALL on spatial_ref_sys TO \"$user_name\";" |
sudo -u postgres psql -Upostgres gis
echo "GRANT ALL ON SCHEMA PUBLIC TO \"$user_name\";" |
sudo -u postgres psql -Upostgres gis
</snip>
I had also downloaded:
1. planet-090408.osm.bz2
2. relations-090408.osm.bz2 (what is this one for? I did not use it at all.)
3. world_boundaries-spherical.tgz
4. processed_p.zip
5. shoreline_300.tar.bz2
I installed 3, 4 and 5, all files directly into
/usr/share/mapnik/world_boundaries.
Importing planet.osm as described on the openstreetmap wiki fails:
schleim:/local/ftp/osm # bzcat /local/ftp/osm/planet-090408.osm.bz2 |
sudo -u postgres osm2pgsql -m -
osm2pgsql SVN version 0.65-14495
Using projection SRS 900913 (Spherical Mercator)
Setting up table: planet_osm_point
Setting up table: planet_osm_line
Setting up table: planet_osm_polygon
Setting up table: planet_osm_roads
Mid: Ram, scale=100
Reading in file: -
Processing: Node(330350k) Way(159k) Relation(0k)
Speicherzugriffsfehler
# The line above is German, means memory access error.
Can anybody give me a hint if i've set up something wrong?
Thanks for any hints,
Torsten.
More information about the talk
mailing list