1

I have MultiPointMs in a PostGIS (v. 2.2.2) database.

I would like to know if it is possible in QGIS (v. 2.14.1) to label each point with its M-Value.

For instance:

MultiPointM(1 1 0, 2 2 1, 3 3 2); Coordinates obviously made up

And in QGIS I would like to have the point (1 1) to have a label with "0". The point(2 2) would be labeled "1" and the point (3 3) would be labeled "2".

I would prefer having a script-free solution (as the final user is not myself).

A friend suggested this : How can I label both coordinates in mmQGIS?

Which gives some hints on the direction to go... The $x and $y work perfectly... But it doesn't seem to like $m (and I wouldn't know where to search for to know what would be the equivalent).

2

The answer is actually in the label expression editor under Geometry (I had to look it up ;)). To show the M value, you'd do this:

 m($geometry)   

You can also use an arbitrary geometry definition as given in the example.

  • Thanks! This worked out well to get the M value, but I still have issues labeling each point of the multipoint individually... – benoitespinola Aug 4 '16 at 13:23
  • Oh, right... I'll look into that when I have a chance. If nothing else, you can create a view on the table that uses ST_DumpPoints to provide a row for each point. That way your user will never have to update anything. – Rob Skelly Aug 4 '16 at 17:03

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.