NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Using osm2pgsql to import an OSM-File to PostGIS I get the following error:

SELECT AddGeometryColumn('planet_osm_point', 'way', 900913, 'POINT', 2 ); failed: FEHLER: AddGeometryColumn() - invalid SRID CONTEXT: SQL statement "SELECT AddGeometryColumn('','',$1,$2,$3,$4,$5, $6)" PL/pgSQL-Funktion »addgeometrycolumn« Zeile 5 bei SQL-Anweisung

Error occurred, cleaning up

Any hints what could be wrong would be helpful! Thank you.

asked 23 May '12, 12:59

faxx's gravatar image

faxx
11335
accept rate: 0%

Sorry, just recognised I forgot some information: Windows (I know, Linux could do better...) osm2pgsql SVN version 0.69-21289M, pgAdmin III

(23 May '12, 13:32) faxx

Your version of osm2pgsql is ancient. This is likely to give you more trouble in the future but for now, running this file through your PostGIS will likely help:

http://svn.openstreetmap.org/applications/utils/export/osm2pgsql/900913.sql

For the record, if you have a rather new PostGIS, the easiest way is often not to add this projection but to make osm2pgsql use 3857 (-E 3857).

permanent link

answered 23 May '12, 14:24

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

I have latest version of osm2pgsql(downloaded and installed from github) but I still ran into that problem.

The download link for 900913.sql doesn't work anymore but if you installed osm2pgsql also from source code then you should have the file in here:

/usr/local/share/osm2pgsql/900913.sql

So what i did to fix this problem was following code:

psql -f /usr/local/share/osm2pgsql/900913.sql -d gis

(18 Jun '14, 11:49) hukko
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×263

question asked: 23 May '12, 12:59

question was seen: 8,598 times

last updated: 18 Jun '14, 11:49

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum