2

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.

  • For sure the problem is that you don't know the projection of layer a, in fact you don't have a .prj file of it. Maybe this post gis.stackexchange.com/questions/7839/… can help – matteo Jun 12 '15 at 7:13
  • Thanks Matteo! By following you link I did the following: – SaMoz Jun 12 '15 at 8:11
  • Thanks Matteo! By following the suggestions on your link I did the following: 1). Used projfinder.com 2). Tried the suggested CRS:s. I found a match for layer a with EPSG:3034 (eg. both layers are displayed at the same time). Now the problem is that the layers do not aling perfectly. The a layer is too much to the east and shouth by some smaller distance- but since I'm using it for research I really would like them to align. Any suggestions of what to do next? – SaMoz Jun 12 '15 at 8:18
  • Have you tried saving both shapefiles using the Save As.. option and then setting the same CRS for both? This way, the new shapefiles should have the same CRS. – Joseph Jun 12 '15 at 8:48
  • How much offset in meters or km do you measure? – AndreJ Jun 12 '15 at 9:46
1

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.

  • Great Mr. Compte! Looked through your suggested list and again 3034 is the only that shows up (and 3035, but then the two Sweden do not overlap at all). The next question then is how do I change the datum? I did as the QGIS user guide suggest and went to Setting: Options: Ask fo datum transformation when no default is defined. Now when I OTF project in 3034 to 3006 QGIS tells me: 1). EPSG Transformation code 1149 ETRS89 and WGS 84 are realisations of ITRS coincident to within 1 metre. This transformation has accuracy equal to the coincidence figure. – SaMoz Jun 12 '15 at 12:03
  • 2). EPSG Transformation code 1571 Dutch sources also quote an equivalent transforamtion within parameter values dX=+593.032 dY=+26.000 dZ=+478.741 m, rX rY rZ and dS as this tfm. These values belong to a diffrent transformation method and cannot be used with the Coordinate Frame method. – SaMoz Jun 12 '15 at 12:03
  • Neither of the two option makes the layers align better. What is this with Dutch source? I think the guys producing layer a might be Dutch! I really do not understand much of the text. What is tfm and Coordinated Frame? – SaMoz Jun 12 '15 at 12:04
  • I mentioned the datum only as an example. Could be this, but could also be something else. I once had a similar problem and found out my proj4 library did not have the proper params for the EPSG of origin. So when the system transformed the data, it produced some shift. I searched other libraries for the proper values and updated my proj4. – Marc Compte Jun 15 '15 at 11:10
  • I would not just produce a new projection with a datum you think might be good. Instead I would try to test the available & known projections. Find variations of those or check/update my proj4 library to make sure it's not that one who causes the shift. – Marc Compte Jun 15 '15 at 11:19

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.