Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm working with TextSymbolizer in Mapnik. I have a shape file with a attribute which is a real. I wish to print the value of this attribute as integer and I don't find how I can do it in Mapnik.

I must not change the source shape file. Can someone advise of the recommended way to do this?

share|improve this question
add comment

1 Answer

Not having found a solution to do exactly what I want, I bypassed the problem using a regular expression. If the real attribute is 'VAL' and the decimal separator is '.':

<TextSymbolizer placement = "line" fontset-name = "fontset-0" size = "11" dy = "-4" halo-fill = "rgba (255, 255, 255, 0.5)" halo-radius = "1" > 
<! [CDATA [[VAL]. replace ('\. [0-9] +','')]]>
</ TextSymbolizer>
share|improve this answer
add comment

Your Answer

 
discard

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.