Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

how to show the two field values as a label on features. I have done it for a field called "ErrorDescr" with this i need to show another field values. Other field is "MarkerId"

layer.setCustomProperty("labeling", "pal")
    layer.setCustomProperty("labeling/enabled", "true")
    layer.setCustomProperty("labeling/fontFamily", "Arial")
    layer.setCustomProperty("labeling/fontSize", "10")
    layer.setCustomProperty("labeling/fieldName", "ErrorDescr")
    layer.setCustomProperty("labeling/placement", "2")

is it possible to bring the output like this:

enter image description here

enter image description here

share|improve this question
up vote 3 down vote accepted

You need

layer.setCustomProperty("labeling/isExpression", True)

and you can use the expression in the string:

layer.setCustomProperty("labeling/fieldName", "concat(ErrorDescr, Markerid)")
share|improve this answer
Thanks Nathan Its working fine. How to add a separator like - , / between ErrorDescr and Markerid? – venkat May 20 '13 at 11:46
concat(ErrorDescr,'-', Markerid) – Nathan W May 20 '13 at 11:50
Thanks a lot. its achieved my requirement – venkat May 20 '13 at 12:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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