Force labels uppercase

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Force labels uppercase

Anton Bakker
Hi list,

I am trying to set a label to uppercase in my mapfile (example https://i.imgur.com/ExRZhia.png). Seems it is already implemented (https://github.com/mapserver/mapserver/issues/4255), but I cannot figure out how use it.

The comments in the issue seem to hint at an expression element in the label element:

LABEL
  TYPE TRUETYPE
  ALIGN LEFT
  ANGLE AUTO
  ANTIALIAS TRUE
  BUFFER 2
  COLOR 107 107 108
  FONT arial
  MINDISTANCE 200
  MINFEATURESIZE AUTO
  PARTIALS FALSE
  POSITION AUTO
  PRIORITY 10
  SIZE 14
  EXPRESSION (upper("[NAME]")
END

But this did not work for me. Anybody knows how to force labels to appear in uppercase?

Thanks!

Kind regards,
Anton

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Force labels uppercase

jratike80
Hi,

By trial and error and with a little help from http://www.mapserver.org/mapfile/expressions.html#expressions this line gives me a lowercase label

TEXT (lower("[ATTRIBUTE]"))

Looks rather similar to your request despite that I have TEXT and  I counted the brackets to match.

-Jukka Rahkonen-


-----Alkuperäinen viesti-----
Lähettäjä: mapserver-users [mailto:[hidden email]] Puolesta Anton Bakker
Lähetetty: 12. lokakuuta 2017 14:59
Vastaanottaja: [hidden email]
Aihe: [mapserver-users] Force labels uppercase

Hi list,

I am trying to set a label to uppercase in my mapfile (example https://i.imgur.com/ExRZhia.png). Seems it is already implemented (https://github.com/mapserver/mapserver/issues/4255), but I cannot figure out how use it.

The comments in the issue seem to hint at an expression element in the label element:

LABEL
  TYPE TRUETYPE
  ALIGN LEFT
  ANGLE AUTO
  ANTIALIAS TRUE
  BUFFER 2
  COLOR 107 107 108
  FONT arial
  MINDISTANCE 200
  MINFEATURESIZE AUTO
  PARTIALS FALSE
  POSITION AUTO
  PRIORITY 10
  SIZE 14
  EXPRESSION (upper("[NAME]")
END

But this did not work for me. Anybody knows how to force labels to appear in uppercase?

Thanks!

Kind regards,
Anton

_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Reply | Threaded
Open this post in threaded view
|

Re: Force labels uppercase

Seth G-2
In reply to this post by Anton Bakker
Hi,

Are you missing a bracket at the end of your expression?

EXPRESSION (upper("[NAME]"))

Also maybe check that the following hard coded string works?

EXPRESSION (upper("test"))

Regards,

Seth

--
web:http://geographika.co.uk
twitter: @geographika

On Thu, Oct 12, 2017, at 01:59 PM, Anton Bakker wrote:

> Hi list,
>
> I am trying to set a label to uppercase in my mapfile (example
> https://i.imgur.com/ExRZhia.png). Seems it is already implemented
> (https://github.com/mapserver/mapserver/issues/4255), but I cannot figure
> out how use it.
>
> The comments in the issue seem to hint at an expression element in the
> label element:
>
> LABEL
>   TYPE TRUETYPE
>   ALIGN LEFT
>   ANGLE AUTO
>   ANTIALIAS TRUE
>   BUFFER 2
>   COLOR 107 107 108
>   FONT arial
>   MINDISTANCE 200
>   MINFEATURESIZE AUTO
>   PARTIALS FALSE
>   POSITION AUTO
>   PRIORITY 10
>   SIZE 14
>   EXPRESSION (upper("[NAME]")
> END
>
> But this did not work for me. Anybody knows how to force labels to appear
> in uppercase?
>
> Thanks!
>
> Kind regards,
> Anton
>
> _______________________________________________
> mapserver-users mailing list
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________
mapserver-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapserver-users