[mapserver-users] Label formatting on GRID

thomas bonfort thomas.bonfort at gmail.com
Thu Oct 22 02:32:05 PDT 2015


There is no such support that I know of in mapserver.
Your first use-case could be implemented by extending the grid labelling
function to get it's text from a mapserver expression, and extending the
expression syntax to include integer division and modulo operators.
Your second use-case is more involved and would require multiple label
blocks along with the aforementioned enhancements.

Both cases are not trivial and would require funding.

regards,
thomas

On 13 October 2015 at 05:59, Matt McClelland <matt at wildwalks.com> wrote:

> Hi All
>
> I am wanting to truncate (simplify) the grid numbering to match the grid
> reference users would use in the field.
>
> Looking at the top right (of the attached example) I would like
> 236000 to just display as 36 and
> 6263000 to just display as 63
>
> In a perfect world I would love it to display like this
> a subscript (little) 2 followed by standard 36 =  236  and
> a subscript (little) 62 followed by standard 63 =  6263
>
> Any suggestions ??
>
> Thanks :)
>
> The attache map I generated using mapserver 7.0
> The Grid map file is
> LAYER
>   GROUP "default"
>   NAME "grid"
>   METADATA
>     "DESCRIPTION" "Grid"
>   END
>   TYPE LINE
>   STATUS ON
>   CLASS
>     NAME "Graticule"
>     COLOR 100 100 100
>     LABEL
>       COLOR  255 0 0
>       FONT sc
>       TYPE truetype
>       SIZE 8
>       POSITION AUTO
>       PARTIALS FALSE
>       FORCE TRUE
>       BUFFER -10
>       OUTLINECOLOR 255 255 255
>     END
>   END
>   PROJECTION
>     "init=epsg:28356"
>   END
>   GRID
>     LABELFORMAT '%.0f'
>     MININTERVAL 1000
>   END
> END # Layer
>
> Matt :)[image: Inline image 1]
> <http://www.wildwalks.com/office/newsletters/>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20151022/921db346/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mapserv (1).jpg
Type: image/jpeg
Size: 79286 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20151022/921db346/attachment-0001.jpg>


More information about the mapserver-users mailing list