1

It is possible to stylize a layer with integer numbers stored in a shapefile and then choose a symbol out of a font.

I would like to use the label engine instead, because i'm more flexible, for example i can rotate the label.

Is it possible to label a point layer with unicode numbers stored as integer within a shapefile?

  • I'm not sure to understand your question properly. It is possible to use an integer field for labelling: just select the field you need inside the labelling tool. Therefore, no conversion to unicode is necessary. – wiltomap Apr 3 '15 at 9:38
  • I was able to do it with the function editor, but i'm not able to use mini-Mardown formatting..grrrr :""" Converts Integer Values from Shapefile to Unicode Values Important: No Values above 256 allowed! For dkmSSB define a query to get rid of the values above 200. These values are just used for labeling. """ from qgis.core import * from qgis.gui import * @qgsfunction(args=1, group='Custom') def INTtoUNICODE(values, feature, parent): value = values[0] return chr(value) – RolandG Apr 3 '15 at 12:15
  • Could you please edit your initial post and add either a screenshot or the code you have written in the function editor? – wiltomap Apr 3 '15 at 12:17
1

I was able to do it with the function editor. This is the code:

""" Converts Integer Values from Shapefile to Unicode Values
Important: No Values above 256 allowed! For dkmSSB define a query to
get rid of the values above 200. These values are just used for
labeling. """

from qgis.core import
from qgis.gui import

@qgsfunction(args=1, group='Custom')

def INTtoUNICODE(values, feature, parent):

value = values[0]

    return chr(value)

Then choose custom functions: INTtoUNICODE("Fieldname")

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.