Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

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

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

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.