[mapserver-users] validation block

Marc-André Trottier marcandre_trottier at hotmail.com
Tue Aug 21 10:33:38 PDT 2012


here is an example of two class in 'adn_station_max_v.map' :

CLASS
    NAME "Information non disponible (grande échelle)"
    EXPRESSION ( '[etat]' = 'GRIS' AND [id_bassin] in '%ID_BASSIN%')
    GROUP "BASSIN"
        MINSCALEDENOM 0
    MAXSCALEDENOM 150000
    STYLE
        SYMBOL 'circle'
        COLOR 128 128 128
        OUTLINECOLOR 0 0 0
        SIZE 9
    END

    LABEL
        COLOR           0 0 0
        OUTLINECOLOR    255 255 255
        ANTIALIAS       FALSE
        TYPE            TRUETYPE
        FONT            "ubuntu"
        SIZE            14
        POSITION auto
        FORCE                     TRUE
    END
END

CLASS
    NAME "Seuil d\'inondation majeure"
    EXPRESSION ( '[etat]' = 'ROUGE' AND [region_admin_id] in '%ID_REG%')
    GROUP "REG_ADMIN"
    MINSCALEDENOM 110000

    STYLE
        SYMBOL 'circle'
        COLOR   255 0 0
        OUTLINECOLOR 0 0 0
        SIZE 14
    END

    LABEL
        WRAP            "!"
        ALIGN           CENTER
        COLOR           0 0 0
        OUTLINECOLOR    255 255 255
        ANTIALIAS       FALSE
        TYPE            TRUETYPE
        FONT            "ubuntu"
        SIZE            14
        FORCE                     TRUE
        OFFSET          0 12
    END
END

if i understant this meant that for a layer, i must validate all variables
of all class even if i don't use them all.
My include of 'adn_station_max_v.map' contains X substitutions in X class
so i must have X validations even if i don't use all X class.

In my example, i include many class with 'adn_station_max_v.map' but i'm
using only one variable at a time. All class in CLASSGROUP 'REG_ADMIN' only
use 'ID_REG'.


2012/8/21 Stephen Woodbridge <woodbri at swoodbridge.com>

> You probably need to quote:
>
>               'ID_BASSIN' '[[a-zA-Z0-9]{0,10},??]*'
>
>               "#ID_REG' '[[a-zA-Z0-9]{0,10},??]*'
>
> And I would be very suspicious that '#ID_REG' is a value identifier
> because of the '#' character.
>
> -Steve W
>
>
> On 8/21/2012 11:38 AM, Marc-André Trottier wrote:
>
>> there is my layer's definition :
>>
>>      LAYER
>>          VALIDATION
>>              ID_BASSIN '[[a-zA-Z0-9]{0,10},??]*'
>>              #ID_REG '[[a-zA-Z0-9]{0,10},??]*'
>>          END
>>          INCLUDE "../layers/bd/adn_station_max_**v.map"
>>          CLASSGROUP "BASSIN"
>>          NAME "adn_station_bassin"
>>      END
>>
>>      LAYER
>>          VALIDATION
>>              #ID_BASSIN '[[a-zA-Z0-9]{0,10},??]*'
>>              ID_REG '[[a-zA-Z0-9]{0,10},??]*'
>>          END
>>          INCLUDE "../layers/bd/adn_station_max_**v.map"
>>          CLASSGROUP "REG_ADMIN"
>>          NAME "adn_station_reg_admin"
>>      END
>>
>> with these commented lines a got this error :
>> msValidateParameter(): Regular expression error. Parameter pattern
>> validation failed.
>>
>> without comment, i got no error.
>>
>> CLASSGROUP 'BASSIN' contains many class but each class use only
>> 'ID_BASSIN' and
>> CLASSGROUP 'REG_ADMIN' contains many class but each class use only
>> 'ID_REG'
>>
>> is it the right thing to do ? or like i thought, the validation block
>> can contains only the variable used by the layer ?
>>
>>
>>
>> ______________________________**_________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.**org <mapserver-users at lists.osgeo.org>
>> http://lists.osgeo.org/**mailman/listinfo/mapserver-**users<http://lists.osgeo.org/mailman/listinfo/mapserver-users>
>>
>>
> ______________________________**_________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.**org <mapserver-users at lists.osgeo.org>
> http://lists.osgeo.org/**mailman/listinfo/mapserver-**users<http://lists.osgeo.org/mailman/listinfo/mapserver-users>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120821/229bcce1/attachment.htm>


More information about the MapServer-users mailing list