1

I got some shapefiles out of a WFS service and the points and polygons are not where they supposed to be.

After taking a closer look in the data I came to the conclusion, that the X an Y coordinates are switched, which can be seen by the extents of the shapefiles.

Is there a way to switch the coordinates back?

  • Can you not go back to the WFS and request the data in the correct format? – Hornbydd May 10 at 9:46
  • Thanks for you answer, but the solution was to change an option in the WFS properties. It is called SRS Axis Order and had to be changed to the values "2, 1", where the values indicate the x- and y- axis. – U_V May 13 at 7:03
  • @U_V , please post your comment as an answer – J.R May 20 at 13:58
3

QGIS has a tool called "Swap X and Y coordinates" that does exactly that:

This algorithm swaps the X and Y coordinate values in input geometries. It can be used to repair geometries which have accidentally had their latitude and longitude values reversed.

1

Ok, i found the solution.

I forgot to activate the right Axis Order in the WFS parameters.

The solution was to change an option in the WFS properties. It is called SRS Axis Order and had to be changed to the values "2, 1", where the values indicate the x- and y- axis.

  • 1
    That is not an answer to the question you asked. ;) – bugmenot123 May 8 at 13:29
0

You could convert everything to points, then export the points as csv and load that csv with switched coordinate-columns.

  • You mean convert the shapefiles with polygons to points aswell? Could work, yes. – U_V May 8 at 12:04

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.