3

QGIS project, which was saved in 2.0 has defined CRS for project as a whole and for each of the layers.

When I open the project in QGIS 2.2 and higher, one of the layers is shifted and does not match the rest of the project.

Changing CRS of that layer does not help and neither does exporting the layer in certain CRS and importing it again.

list of CRS:

  • project: EPSG 3857
  • shifted layer: EPSG 4326
  • the rest of the layers: EPSG 5221
10
  • Have you tried enabling/disabling the on-the-fly reprojection option from Settings > Options > CRS? – Joseph Aug 24 '15 at 9:41
  • Yes, I did. The layer is "shifted" just a few metres from where it should be (disabling otf reprojection moves it accross the globe) – Zbynek Aug 24 '15 at 9:43
  • Was the data captured in QGIS 2.0? – HeikkiVesanto Aug 24 '15 at 9:51
  • What do you mean by captured? – Zbynek Aug 24 '15 at 9:52
  • Who created the data and using what? – HeikkiVesanto Aug 24 '15 at 10:16
2

There seems to be some inconsitency about the datum shift parameters for EPSG:5221.

Using gdalsrsinfo epsg:5221, GDAL 1.11.2 reports:

+proj=krovak +lat_0=49.5 +lon_0=42.5 +alpha=30.28813972222222 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=589,76,480,0,0,0,0 +pm=ferro +units=m +no_defs

Whereas the current QGIS 2.8.2 has this definition:

+proj=krovak +lat_0=49.5 +lon_0=42.5 +alpha=30.28813972222222 +k=0.9999 +x_0=0 +y_0=0 +ellps=bessel +towgs84=542.5,89.2,456.9,5.517,2.275,5.516,6.96 +pm=ferro +units=m +no_defs

The towgs84 parameters are different (3-parms vs 7-parms). I'm not sure which one is more accurate, and if and when parameters changed in QGIS.

If you have still access to QGIS 2.0, look up the parameters there. You can set up a custom CRS in your running QGIS and assign it to the Krovak projected files.

Alternatively, you can save the WGS84 layer in QGIS 2.0 into Krovak projection, take it into QGIS 2.2, and save it back to WGS84 there. BTW, I suggest to update to QGIS 2.8.3. There are lots of bugs fixed since QGIS 2.2.

This bug report might be related: https://hub.qgis.org/issues/9760 and there was a patch in http://lists.osgeo.org/pipermail/qgis-commit/2013-June/010976.html. The quoted source for the parameters has moved to http://freegis.fsv.cvut.cz/gwiki/S-JTSK_/_%C4%8Ceskoslovensk%C3%BD_transforma%C4%8Dn%C3%AD_kl%C3%AD%C4%8D.

The site offers different shift parameters for the Czech Republic, Slovakia, and the whole former Czechoslovakia. The values now used by QGIS are for the last one, while GDAL still uses the 3-parms set up by NIMA when WGS84 was established.

2
  • Perfect - after creating custom CRS with new parameters, the data align perfectly – Zbynek Aug 24 '15 at 11:47
  • The second CRS likely has a more accurate transformation statement: as you said 9 parameters vs 3 parameters. Since the data was captured from a different CRS using the 3 parameter transformation the data will not be as accurate as it would be using the current CRS 9 parameter transformation. There was a similar issue with British National Grid when migrating between GDAL versions. To fix this you might want to try: Open the file in QGIS 2.0, save the data as EPSG 5221, open the newly created layer in QGIS 2.2+ and reproject it back to EPSG 4326. – HeikkiVesanto Aug 24 '15 at 12:06

Your Answer

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

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