1

I'm working from a database (PostgreSQL/ PostGIS). I created a view in QGIS of joined polylines from one table with the ST_union function. I want to label this polylines in QGIS. So, I created 2 virtual columns with $x and $y expressions for the labels coordinates and configured the properties. But, the virtual columns are not editable and I can't move the labels.

Do you have an idea ?

1

Virtual fields are the wrong kind of field for creating moveable labels. Virtual field values cannot be edited, because they are defined by an expression. Create regular (not virtual) fields using the $x and $y expressions. Then you will be able to edit the field values and move your labels.

Note: moveable labels work differently in QGIS 3 compared to 2.18. So if/when you update to QGIS 3 you'll want to read the manual or find a more recent tutorial.

  • The way it works in 2.18 does also work in 3.x. QGIS 3 just offers more and other possibilities. – MrXsquared Jan 15 at 20:00
  • 1
    Yes, you can set up moveable labels in QGIS 3 the same as in QGIS 2.18. But QGIS can also automatically create auxiliary storage fields to control label locations.This is a pretty major difference, and it can cause confusion if encountered unexpectedly. Hence my recommendation to look at the documentation after updating. – csk Jan 15 at 20: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.