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

Hi I've converted some OSM data of Cambridgeshire UK into POSTGIS using osm2pgsql like this.

 createDB osm
 createlang plpgsql osm –U username 
 psql –U username –d osm  -f /path/to/postgis1.5/postgis.sql
 psql –U username –d osm  -f /path/to/postgis1.5/spatial_ref_sys.sql
 osm2pgsql –S /path/to/osm2pgsql/default.style –U username –d osm  -l –c /path/to/ cambridgeshire.osm.bz2

I've overlayed it on some imagery of the area. The image has been orthorectified to WGS84 Geographical & fits all other data sets used. In QuantumGis both the image and the OSM data are showing the same datum but the OSM vectors are approximately 25m -30m North East of the image.

 QGIS Layer spatial referance system
 +proj=longlat +ellps=WGS84 +datum=WG84 +no_defs

How might I get the OSM data to fit the image? Please note once i've worked out how to do this i'll be moving on to a larger dataset Thanx Holly

asked 11 Jun '12, 17:59

HollyG's gravatar image

HollyG
1111
accept rate: 0%

1

Could you add a permalink to the area (zoom the map on www.openstreetmap.org to the area and select the "Permalink" link) to your question? Thanks

(12 Jun '12, 14:08) SimonPoole ♦

I am using a standalone system

(12 Jun '12, 18:17) HollyG

An extremely late (archival) answer!

There were some bugs in various OSGeo products in transforming in and out of the OSGB NT36 (EPSG code 27700). In addition failure to specify a complete Helmert Transformation in WKT or proj4 or in ESRI projection files often results in this type of error. (I would have to find a 3 year old installation of PostGIS to demonstrate this properly, but one could put in a known British National Grid co-ordinate and convert to WGS, or ECTS or Google Spherical Mercator and back and the point would be dislocated a few metres). (This caused me quite a few problems when preparing my SotM-EU presentation in 2011).

In conclusion it was probably the orthorectified images transformed to either WGS84 or Spherical Mercator which were misaligned.

permanent link

answered 13 Mar '15, 16:23

SK53's gravatar image

SK53 ♦
28.1k48268433
accept rate: 22%

OSM data is true WGS84. Without any links to the area in question I can not tell exactly what is going on. When I look at Camebridge OSM matches bing areal, google maps and even the raw gps data collected. If you open an editor for the area you can select other sources to add as layers and view the accuracy. It might be that there are some errors in the osm data, that there are some errors in your setup or that your orthorectified sources are wrong. I can not tell.

permanent link

answered 12 Jun '12, 14:43

Gnonthgol's gravatar image

Gnonthgol ♦
13.8k16103198
accept rate: 16%

I'm not suggesting OSM is wrong it uses google Mercator projection 900913 which is aligned to WGS84 we use unprojeted WGS84 datum EPSG:4326 all the imagery sources you quot use the same google Mercator projection so they will fit what i'm after is a trigonometric function that when applied to the coordinates of OSM 900913 data to shift them to EPSG:4326

(12 Jun '12, 19:11) HollyG

Again in Qgis I've inserted the raw osm file I then overlayed the PostGIS layers they align perfectly. I had assumed there would be differences between the 900913 projected osm vectors and the unprojected WGS84 datum EPSG:4326.

(13 Jun '12, 07:07) HollyG
1

You need to realise that OSM data is recorded in WGS84, and that's what you receive when you download any osm.bz2 files. Sure, the maps and the editing interface is (often, but not always) shown in 900913, but underneath it's all pure WGS84.

(14 Jun '12, 09:49) Andy Allan

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
×134
×9

question asked: 11 Jun '12, 17:59

question was seen: 7,700 times

last updated: 13 Mar '15, 16:23

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