[mapserver-users] Mapserver Expressions

Lime, Steve D (MNIT) Steve.Lime at state.mn.us
Mon Dec 16 13:00:03 PST 2013


Did you get this fixed? The layer looks right to me. --Steve

From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Charlie Allgrove
Sent: Wednesday, December 11, 2013 11:11 AM
To: mapserver-users at lists.osgeo.org
Subject: [mapserver-users] Mapserver Expressions

Hi

I'm looking to change the symbol used on a given layer, based on the (Google) zoom level supplied to the mapserv CGI.

The Layer in question in the map file looks like this:

LAYER
    VALIDATION
        'tile'  '^[0-9]+ [0-9]+ [0-9]{1,2}$'
    END
    PROJECTION
        "init=epsg:4326"
    END
    NAME hubs
    TYPE point
    STATUS ON
    DATA 'hub_data.shp'
    CLASS
     EXPRESSION('%tile%' ~ '16$')
      NAME 'hub_layer_small'
      STYLE
        SYMBOL 'cloud_500'
      END #STYLE
    END #CLASS
    CLASS
      EXPRESSION('%tile%' ~ '17$')
      NAME 'hub_layer_large'
      STYLE
        SYMBOL 'cloud_200'
      END #STYLE
    END #CLASS
    CLASS
      NAME 'hub_layer_default'
      STYLE
        SYMBOL 'cloud_200'
       SIZE 2
      END #STYLE
    END #CLASS

    TEMPLATE "xxx"
        METADATA
            "wms_title" "Hub data layer"
        END
  END #LAYER


Requests are made to the CGI with the following example querystring:
?layer=hubs&mode=tile&tilemode=gmap&tile=19288 24631 16

I *thought* it was possible to use EXPRESSION to test the 'tile' variable and act accordingly, but it's not working (I always get the default class used instead).

> ./mapserv -v
MapServer version 6.0.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=CAIRO SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=FASTCGI SUPPORTS=THREADS SUPPORTS=GEOS INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

Any pointers? Thanks in advance.

Charlie

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20131216/36b0373b/attachment.html>


More information about the mapserver-users mailing list