Saturday, 18 August 2018

qgis - Raster incorrectly reprojected to OSGB(27700)


Ubuntu 12.04, QGIS 1.8.0, GDAL/OGR 1.7.3, GEOS 3.2.2



Open a Spatialite db with OS Mastermap poly layer (EPSG:27700);
Add OpenLayers Plugin (1.0) from QGIS offical repository;
Add a Google Satellite layer (EPSG:3857) and make OS poly fills transparent;
Zoom & drag map a bit till it 'settles down' - then both aligned nicely;
Make poly layer not visible and save map as image (jpg + jpgw);
Add saved jpg back in as a layer (EPSG:3857) - still aligned;
Reproject (warp) jpg layer from EPSG:3857 to a EPSG:27700 Gtiff;
Add this Gtiff layer - no longer aligned but shifted about 6m North.
???!!!???


(On the fly CRS transformation is enabled)



I've had this issue before with the unstable flavour of UbuntuGIS QGIS, so went back to the stable & all was ok. This time I'm getting the 'shift' in the stable UbuntuGIS QGIS and no amount of wiping out the libraries (with Synaptic) & reinstalling has so far got rid of this 'shift'.


Any help or ideas gratefully received...




No problem reproducing the error (thanks underdark), but some more digging might narrow the issue a bit more.


The proj4 CRS projection string for OSGB/27700 in GDAL1.9.1 is:


+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=375,-111,431,0,0,0,0 +units=m +no_defs

The same thing in GDAL1.7.3 is:


+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +datum=OSGB36 +units=m +no_defs


Even though QGIS is reporting the CRS as 27700 with the same proj4 string as the earlier GDAL1.7.3 it's probably using the later GDAL1.9.1 parameters for the reprojection behind the scenes. That would be fine if the image lined up after reprojection - but it doesn't.


To test a step further I created a QGIS user-defined CRS with the same projection parameters as the earlier GDAL version, and then reprojected with this - everything now lines up fine.


Are the EPSG:27700 projection parameters the likely suspect in the later GDAL (which QGIS is using) - or am I barking up the wrong tree?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...