5

I got a vector data layer that I need to project onto a map. When I import the layer, everything seems to work, but the layer ends up in the wrong place:

enter image description here

The red dot in the bottom left corner is my vector layer. it should be projected onto the map in the top right corner.

The CRS I'm using is CH1903+ / LV95 and the layer I'm importing has the same CRS. I figured out that the coordinates are almost right, apart from the fact that everything is shifted by 2'000'000 on the x and by 1'000'000 on the y-axis:

enter image description here

For example, the 2 points above should be:

x=2'637'258.155, y=1'105'635.889

x=2'637'254.899, y=1'105'632.778

I figured out how to adjust the points manually with the Vertex editor. However, I have hundreds of points in this layer with that problem, so adjusting everything manually is not a feasible way of solving my problem. Is there any way to adjust the coordinates of the whole layer?

The only other way I can think of is to drag the layer onto the map manually, but I don't know if I can manually drag the layer precisely enough for what I need it to be.

1

2 Answers 2

8

Solution

You are using the Swiss national grid which exists in two versions:

  • The coordinates in your layer are in the "old" style: CH1903 / LV03, corresponding to EPSG:21781 ( fundamental reference point with coordinates x= 600'000, y = 200'000),
  • You use the "new" style: CH1903+ / LV 95, corresponding to EPSG:2056, where the same fundamental reference point has coordinate values x= 2'600'000, y = 1'200'000.

So with the coordinates you have, the layer should have EPSG:21781 as the CRS definition, but you have assigned EPSG:2056 and thus, the "missing" 2000 km on x / 1000 km on the y-axis. Either the CRS from your data source is not correctly recognized or you somehow manually "changed" the layer's CRS (don't do that!). Reload the layer or set the correct CRS to solve the problem (see below).

Schematic overview: coordinates in EPSG:21781 (black) and EPSG:2056 (red) for the same fundamental reference point (red dot), but with two (hypothetical) origins of the coordinate system (blue dots), both with value 0/0 in their respective CRS definition: enter image description here

What caused the problem

The difference in the coordinate values has to do with the difference of older vs. newer coordinates that were introduced with an additional "shift" (false easting/northing) to get 7-digit coordinates instead of the older 6-digit ones:

Thus with LV95 the almost hundred-year-old coordinates defined in LV03 were replaced. The most noticeable difference resulting from this change of reference frame was that the coordinates now comprised seven digits instead of six. The value 2,000,000 was added to the coordinates towards the east (E) and 1,000,000 m to the coordinates to the north in order to distinguish them from the designations in the old system.

See here for background on the Swisstopo website, the official national authority that defines these coordinates.

How to solve the problem

Your coordinates should not be shifted/translated. Rather use the appropriate CRS definition.

Normally, QGIS should automatically recognize the correct CRS and locate the points in the correct place because CRS info normally should be saved in the data source. If, for whatever reason, the CRS is not automatically recognized correctly (and only in this case), you should manually assign it : right-click layer > Layer CRS > Set Layer CRS. However, you should not do that if you're not 100% sure what you do - see here why.

Remark: Whenever you load a layer, you should first check if it is in the correct place (using a basemap). If you want to have the layer in another CRS, reproject the layer (don't set/change the layer CRS): either use Menu Processing > Toolbox > Reproject layer or export/save the layer with a new CRS definition.

1
  • 1
    You can assign the right CRS to the source via ogr2ogr new_file file_with_incorrect_crs -a_srs EPSG:<right EPSG code>. gdal.org/programs/ogr2ogr.html
    – zabop
    Commented Dec 22, 2023 at 14:34
6

If you are sure there is nothing wrong with your CRS you can use "Translate" from the Processing Toolbox (Ctrl+Alt+T). Simply set your X and Y values and run it:

enter image description here

e.g result (brown original and green translated):

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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