2

I have got a raster file and a vector file of a UK which I try to overlap to use zonal statistics. The files according to the data providers are projected in British National Grid (EPSG 27700). However, when I load the 2 files, QGIS first fails to recongize the correct CRS and creates a custom CRS for each.

For the vector: +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.999601272 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs

For the raster: +proj=tmerc +lat_0=49 +lon_0=0 +k=1 +x_0=400000 +y_0=-100000 +ellps=airy +units=km +no_defs

The resulting image I get enter image description here

Although the maps are overlapping visually, zonal statistics does not output anything. When I set both files CRS to EPSG 27700, I get the following: enter image description here

The raster file is the small point in the centre, it is much smaller and is rotated.

How could I align the two maps?

  • 1
    Have you tried saving them both from their initially loaded states to a new file each with 27700 set as the file CRS? – Phil G Nov 11 '16 at 13:11
  • @phil-g, yes, it did not work – Anton Kram Nov 11 '16 at 13:22
  • Are you reprojecting to anything on-the-fly? If so have you tried turning on-the-fly projection off? – Phil G Nov 11 '16 at 13:46
  • @philg, i tried turning it on/off and also nothing changed. When I saved the files as you recommended, the image I get is similar to the first picture attached where the maps are side-to-side. However, zonal statistics still outputs zero. – Anton Kram Nov 11 '16 at 13:55
  • 1
    Just tested your raster custom CRS with two identical layers (both equivalent to your vector layer actually) and I noticed that the units are set to km. Changing this to m results in an overlapping of both datasets to the same degree as yours. That said - changing the -lon offset from 0 to -2 results in an exact match. – Phil G Nov 11 '16 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.