Thank you for your reply.
I have imported the osm data by not specifying the epsg code (the default sr is 900913):
osm2pgsql -d test -U postgres -s -v planet.osm
It would be ideal if the coordinate system could be converted to some other SRs (e.g. 4326). I tried the approach you provided:
update qrt.planet_osm_point set way=transform(way,4326);
but got the following error:
ERROR: AddToPROJ4SRSCache: couldn't parse proj4 string: '+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs': squared eccentricity < 0
I have created the SR definition from osm2pgsql/900913.sql:
INSERT INTO spatial_ref_sys (srid, auth_name, auth_srid, srtext, proj4text)VALUES (900913,'EPSG',900913,'PROJCS["WGS84 / Simple Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS_1984", 6378137.0, 298.257223563]],PRIMEM["Greenwich", 0.0],UNIT["degree", 0.017453292519943295],AXIS["Longitude", EAST],AXIS["Latitude", NORTH]],PROJECTION["Mercator_1SP_Google"],PARAMETER["latitude_of_origin", 0.0],PARAMETER["central_meridian", 0.0],PARAMETER["scale_factor", 1.0],PARAMETER["false_easting", 0.0],PARAMETER["false_northing", 0.0],UNIT["m", 1.0],AXIS["x", EAST],AXIS["y", NORTH],AUTHORITY["EPSG","900913"]]','+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs');
Not sure whats wrong with the convert function on my database. I am using PostGIS1.4.2 with PostgreSQL 8.4.4 and Proj4.6.1-3 on Fedora12.
Thanks