[GIS] How to detect coordinate reference system (CRS)? – I cannot display two vector layers in QGIS at the same time!

coordinate systemqgis

When I in QGIS try to display layer (a) together with another layer (b) that differ in their CRS it doesn’t work. Both are vector shapefiles. I have tried both with using QGIS ‘on the fly’ CRS transformation and by saving the two different layers in the CRS- format of the other layer. How do I display both layers at the same time?

About layer (a)

I have gotten a .shp file sent to me (together with .dbf,.sbn, .shx, and in addition .sbx, .TAB, .idm and .ind files – which I don’t really know what it is). There is no documentation, but I really want to use the map! QGIS displays it nicely as CRS: WGS 84, EPSG:4326. It maps Sweden. It’s metainfo is:

xMin,yMin 4062955.57,3164156.34 : xMax,yMax 4646582.49,4704921.56

About layer (b)

I trust the other layer (b) more- it is documented to be SWEREF99 TM, EPSG:3006 with metainfo:

xMin,yMin 269616.42,6137945.67 : xMax,yMax 749134.54,6908654.00

More on what happens

I cannot convert layer (a) to EPSG:3006 since I get an error message. When I convert layer (b) to EPSG:4326 it becomes weirdly squeezed, and QGIS don’t want to display the layers at the same time. Their coordinates differ heavily, so I guess it is not strange that QGIS don’t want to display them at the same time. I’m using QGIS 2.8.2 on Mac.

Speculation on "what’s wrong?"

My first guess is that I have not selected the right CRS for layer (a)- but how do I know what it is? I am completely new to all this.

Best Answer

To clarify some things, you shouldn't need to convert a layer. QGIS should be able to transform them on-the-fly for visualization purposes. So you should be able to do the tests on-the-fly and once you find out the true EPSG of each layer then you can save the transformation into a file.

Layer (a) cannot be in 4326 if it's boundaries are those you indicate (xMin,yMin 4062955.57,3164156.34 : xMax,yMax 4646582.49,4704921.56). These are metric values and 4326 is not metric. The boundaries feel more like a UTM projection.

I suggest you check http://epsg.io. You can search by country and filter the results. Check the filter "Projected" to skip unneeded CRS.

http://epsg.io/?q=sweden%20kind%3APROJCRS

If there is a small offset it is probably due to some small differences between the real projection of the layer and the one you used. For instance, the datum. 3034 uses the datum ETRS89 and maybe you need a projection that uses the WGS84 datum.

PS: WGS84 is not a CRS, it's a datum. The datum is the theoretical shape of the earth where the CRS is mapped into.

Related Question