osm2pgsql

sudo osm2pgsql -s -U postgres -W -d osm_hagenzentrum Downloads/HagenZentrum-map.osm

\r\nsollte die Datei HagenZentrum-map.osm in die DB schreiben.\r\nLeider gibt es einen Fehler:\r\n

osm2pgsql SVN version 0.70.5\r\nPassword:\r\nConnection to database failed: FATAL:  Peer authentication failed for user "postgres"\r\n

\r\n\r\nUm diesen Fehler zu beheben: in /etc/postgresql//main/pg_hba.conf\r\naus dem „peer“ bei „postgres“ „trust“ machen.\r\n\r\n\r\nDann ist man einen Schritt weiter und es kommt der nächste Fehler:\r\n

Using projection SRS 900913 (Spherical Mercator)\r\nCouldn't open style file '/usr/share/default.style': No such file or directory\r\nError occurred, cleaning up\r\n

\r\nDieser Fehler ist bekannt: lists.openstreetmap.org\r\nAlso kopiere ich die Datei /usr/share/osm2pgsql/default.style\r\nnach: /usr/share/default.style\r\n\r\nWieder einen Schritt weiter.\r\nnächster Fehler:\r\n

Using projection SRS 900913 (Spherical Mercator)\r\nSetting up table: planet_osm_point\r\nNOTICE:  table "planet_osm_point" does not exist, skipping\r\nNOTICE:  table "planet_osm_point_tmp" does not exist, skipping\r\nPREPARE get_way (int4) AS SELECT AsText(way) FROM planet_osm_point WHERE osm_id = $1;\r\n failed: ERROR:  function astext(geometry) does not exist\r\nLINE 1: PREPARE get_way (int4) AS SELECT AsText(way) FROM planet_osm...\r\n                                         ^\r\nHINT:  No function matches the given name and argument types. You might need to add explicit type casts.\r\nError occurred, cleaning up\r\n

\r\n\r\n…der ERROR muß weg.\r\n\r\nlegacy_faq\r\npostgis_installation\r\n\r\nXubuntu 12.04 legacy.sql\r\n/usr/share/postgresql/9.1/contrib/postgis-2.0/legacy.sql\r\n

psql -U postgres -d osm_hagenzentrum -f /usr/share/postgresql/9.1/contrib/postgis-2.0/legacy.sql\r\n

\r\n\r\nOK, das hat funktioniert, also ein neuer Versuch die .osm datei in die DB zu bekommen.\r\n\r\n

Using projection SRS 900913 (Spherical Mercator)\r\nSetting up table: planet_osm_point\r\nNOTICE:  table "planet_osm_point" does not exist, skipping\r\nNOTICE:  table "planet_osm_point_tmp" does not exist, skipping\r\nSetting up table: planet_osm_line\r\nNOTICE:  table "planet_osm_line" does not exist, skipping\r\nNOTICE:  table "planet_osm_line_tmp" does not exist, skipping\r\nSetting up table: planet_osm_polygon\r\nNOTICE:  table "planet_osm_polygon" does not exist, skipping\r\nNOTICE:  table "planet_osm_polygon_tmp" does not exist, skipping\r\nSetting up table: planet_osm_roads\r\nNOTICE:  table "planet_osm_roads" does not exist, skipping\r\nNOTICE:  table "planet_osm_roads_tmp" does not exist, skipping\r\nMid: pgsql, scale=100, cache=800MB, maxblocks=102401*8192\r\nSetting up table: planet_osm_nodes\r\n*** WARNING: intarray contrib module not installed\r\n*** The resulting database will not be usable for applying diffs.\r\nNOTICE:  table "planet_osm_nodes" does not exist, skipping\r\nNOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "planet_osm_nodes_pkey" for table "planet_osm_nodes"\r\nSetting up table: planet_osm_ways\r\nNOTICE:  table "planet_osm_ways" does not exist, skipping\r\nNOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "planet_osm_ways_pkey" for table "planet_osm_ways"\r\nSetting up table: planet_osm_rels\r\nNOTICE:  table "planet_osm_rels" does not exist, skipping\r\nNOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "planet_osm_rels_pkey" for table "planet_osm_rels"\r\n\r\nReading in file: /home/allapow/zeug/OSM_GIS/HagenZentrum-map.osm\r\nWARNING: Found Out of order node 994740242 (3068578,18) - this will impact the cache efficiency\r\nProcessing: Node(34k) Way(6k) Relation(253)  parse time: 7s\r\n\r\nNode stats: total(34945), max(2136197385)\r\nWay stats: total(6840), max(222812607)\r\nRelation stats: total(253), max(2825698)\r\n\r\nGoing over pending ways\r\nprocessing way (4k)\r\n\r\nGoing over pending relations\r\n\r\nnode cache: stored: 25203(72.12%), storage efficiency: 1.29%, hit rate: 66.73%\r\nStopping table: planet_osm_nodes\r\nStopping table: planet_osm_ways\r\nStopping table: planet_osm_rels\r\nStopped table: planet_osm_nodes\r\nStopped table: planet_osm_rels\r\nCommitting transaction for planet_osm_point\r\nCommitting transaction for planet_osm_roads\r\nStopped table: planet_osm_ways\r\nSorting data and creating indexes for planet_osm_roads\r\nCommitting transaction for planet_osm_line\r\nCommitting transaction for planet_osm_polygon\r\nSorting data and creating indexes for planet_osm_point\r\nSorting data and creating indexes for planet_osm_polygon\r\nSorting data and creating indexes for planet_osm_line\r\nCREATE INDEX planet_osm_roads_index ON planet_osm_roads USING GIST (way GIST_GEOMETRY_OPS) TABLESPACE pg_default;\r\n failed: ERROR:  operator class "gist_geometry_ops" does not exist for access method "gist"\r\n\r\nError occurred, cleaning up\r\n

\r\n\r\nERROR aber Daten in der Tabelle :)\r\n\r\nlegacy_faq_gist\r\n\r\nWegen dem ERROR dann die neueste Version von PostGIS runterladen und aus dem Verzeichnis /postgis-2.0.3/postgis/ die Datei legacy_gist.sql.in umbenennen und ausführen:\r\n

psql -U postgres -d osm_hagenzentrum -f Downloads/legacy_gist.sql\r\nCREATE OPERATOR CLASS

\r\n\r\nok, ein neuer Versuch:\r\n

sudo osm2pgsql -s -U postgres -W -d osm_hagenzentrum /home/allapow/zeug/OSM_GIS/HagenZentrum-map.osm

\r\ngibt:\r\n

Using projection SRS 900913 (Spherical Mercator)\r\nSetting up table: planet_osm_point\r\nNOTICE:  table "planet_osm_point_tmp" does not exist, skipping\r\nSetting up table: planet_osm_line\r\nNOTICE:  table "planet_osm_line" does not exist, skipping\r\nSetting up table: planet_osm_polygon\r\nNOTICE:  table "planet_osm_polygon" does not exist, skipping\r\nSetting up table: planet_osm_roads\r\nNOTICE:  table "planet_osm_roads_tmp" does not exist, skipping\r\nMid: pgsql, scale=100, cache=800MB, maxblocks=102401*8192\r\nSetting up table: planet_osm_nodes\r\n*** WARNING: intarray contrib module not installed\r\n*** The resulting database will not be usable for applying diffs.\r\nNOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "planet_osm_nodes_pkey" for table "planet_osm_nodes"\r\nSetting up table: planet_osm_ways\r\nNOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "planet_osm_ways_pkey" for table "planet_osm_ways"\r\nSetting up table: planet_osm_rels\r\nNOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "planet_osm_rels_pkey" for table "planet_osm_rels"\r\n\r\nReading in file: /home/allapow/zeug/OSM_GIS/HagenZentrum-map.osm\r\nWARNING: Found Out of order node 994740242 (3068578,18) - this will impact the cache efficiency\r\nProcessing: Node(34k) Way(6k) Relation(253)  parse time: 6s\r\n\r\nNode stats: total(34945), max(2136197385)\r\nWay stats: total(6840), max(222812607)\r\nRelation stats: total(253), max(2825698)\r\n\r\nGoing over pending ways\r\nprocessing way (4k)\r\n\r\nGoing over pending relations\r\n\r\nnode cache: stored: 25203(72.12%), storage efficiency: 1.29%, hit rate: 66.73%\r\nStopping table: planet_osm_nodes\r\nStopping table: planet_osm_ways\r\nStopping table: planet_osm_rels\r\nStopped table: planet_osm_rels\r\nCommitting transaction for planet_osm_roads\r\nCommitting transaction for planet_osm_point\r\nStopped table: planet_osm_nodes\r\nStopped table: planet_osm_ways\r\nCommitting transaction for planet_osm_polygon\r\nCommitting transaction for planet_osm_line\r\nSorting data and creating indexes for planet_osm_point\r\nSorting data and creating indexes for planet_osm_roads\r\nSorting data and creating indexes for planet_osm_polygon\r\nSorting data and creating indexes for planet_osm_line\r\nCompleted planet_osm_roads\r\nCompleted planet_osm_point\r\nCompleted planet_osm_line\r\nCompleted planet_osm_polygon

\r\n\r\nDas sieht gut aus 🙂