Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Hi I wonder if someone can clarify as I'm confused.

I need to load planet OSM data into Postgis so I downloaded a small data set of a UK County and followed the instructions here loading the Google Mercator projection 900931.sql first.

looking at the data in Geoserver the co-ordinate readout on the location bar appears to be in metric East / West and not Longitude/Latitude yet the osm wiki states World Geodetic System 1984 is the coordinate system of OSM data.

What am I doing wrong?

Also is there a best practice for displaying OSM as a base layer?

Where can I get a Point.sld from?

share|improve this question
    
check some coordinates in your nodes table - do they look like they are decimal degrees between +/- 180 / +/- 90? GeoServer may be projecting the data as it's rendered because of your layer configuration or WMS URL parameters –  tomfumb Apr 21 '12 at 20:22

2 Answers 2

OpenStreetMap stores data in WGS84 coordinates. You can check this by downloading the XML data for any OSM node:

 $ curl "http://www.openstreetmap.org/api/0.6/node/327031143"
 <?xml version="1.0" encoding="UTF-8"?>
 <osm version="0.6" generator="OpenStreetMap server">
   <node id="327031143" lat="44.4795174" lon="26.0865814" [..]>
[..]

However, the tool that imports the OSM data to postgresql (osm2pgsql) defaults to re-projecting node coordinates:

$ ./osm2pgsql --help

This will import the data from the OSM file(s) into a PostgreSQL database
suitable for use by the Mapnik renderer

Options:
[..]
   -l|--latlong     Store data in degrees of latitude & longitude.
   -m|--merc        Store data in proper spherical mercator (default)
   -M|--oldmerc     Store data in the legacy OSM mercator format
   -E|--proj num    Use projection EPSG:num
   -u|--utf8-sanitize   Repair bad UTF8 input data (present in planet

If you use the -l option, the postgresql database will contain WGS84 coordinates (EPSG 4326).

share|improve this answer

World Geodetic System 1984 is not a coordinate system. You can have coordinates Easting/Northing and Lat/Long both referenced to WGS84.

share|improve this answer
    
How might i do that? set the srs to 4236 on import? –  Holly Apr 22 '12 at 13:43
    
@Holly - I believe you mean 4326 which is WGS84. OSGB is 27700. Anyway, I don't believe Spharios is being entirely clear; typically if something is in WGS84 then it'll be Lat/Lon. If its in OSGB then it'll be in metres (eastings/northings). –  GIS-Jonathan Apr 23 '12 at 9:07
    
OSM use the Google Mercator projection SRID=900913 wiki.openstreetmap.org/wiki/Projection –  Mapperz Apr 23 '12 at 14:44
1  
@Mapperz: No, OSM database stores WGS84 coords. The rendering toolchain (mapnik) is configured historically to use 900913 so the importer (osm2pgsql) defaults to re-projecting data to Mercator when creating a Postgresql database for rendering purposes. –  diciu Apr 23 '12 at 15:11

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.