3

I use QGIS 3.16 to visualise a layer of the countries of the world. The layer is saved with the WGS84 CRS (EPSG:4326). I have set all my labels through rule-based labeling and saved the coordinates of the said labels in my shp layer.

However, I do not want this countries layer to be saved using WGS84 but World_Mercator (EPSG:54004). So, I have tried to export my layer and tell QGIS to use World_Mercator. But, when I copy and paste the style from the layer in WGS84 to the one in Mercator, something goes wrong.

All of my labels are relocated to the point (0,0) on my map - in the Gulf of Guinea - but still linked to their stored position with a line.

I thought it could be a problem about the way coordinates are stored. It did not make much sense but I translated all the labels coordinates in Mercator and tried to repeat the operation. It did not work, the same problem happens again.

I would not like to make something like "rebuilding" my shape's labels nor use a dots system with the labels positions, which would be not really "pleasant".

Léo Mazel
  • 81
  • 1
  • 1
    What exactly did you do? Did you reproject the layer or did you just "cahnge" the CRS? See here for details: https://gis.stackexchange.com/a/383437/88814 - Please add more information and add a screenshot to be able to identify your problem. – Babel Aug 13 '21 at 16:33
  • I think that translate the label coordinates to the new CRS is the solution, but something went wrong when you did it. So, how are you storing and how are you translating the stored coordinates of the labels? – Gabriel De Luca Aug 16 '21 at 01:27
  • Excuse me for not responding earlier... I used the property "Save the entities as..." and then I indicated the new CRS I wanted, World_Mercator. – Léo Mazel Aug 17 '21 at 08:00
  • About the translation, Gabriel, I translated through R language the coordinates and created a new attribute storing the translated coordinates and then I told QGIS to use this new attribute but it does not change anything... – Léo Mazel Aug 17 '21 at 08:02
  • Excuse me for all the trouble. Actually, as you said Gabriel, I apparently did not conduct my test properly. I did it again more cautiously and it worked fine. Thank you for your kind help! – Léo Mazel Aug 18 '21 at 07:59

0 Answers0