[mapserver-dev] getExpressionString issue

Donald mrdonald8000 at gmail.com
Thu Mar 24 07:56:06 PDT 2016


I'm using MapServer version 6.2.0, in Ubuntu. I pasted a piece of the code
that I'm using that is a little different from the one you presented but
it's working for all expressions that don't have dots in it. Do you think
that it could be a problem related to MapServer version ?


   public static function _zoomtoclass ( $_map, $_classname ){

        $class = $_map->getClassByName($_classname);
        $layer = $class->getLayer();

        if ($class->isPostgisType()){
            $connection = $class->getConnection();

            $metadatatable = $class->getMetadataDataTable();
            if ($metadatatable != ''){
                $table = $metadatatable;
            } else {
                $table = $class->getDataTable();
            }

            $postis_table_obj = new ngPostgisLayer($connection, $table);

            $classitem = $class->getClassitem();

            $expression = $class->getExpressionString();


[...]

2016-03-24 14:06 GMT+00:00 Jeff McKenna <jmckenna at gatewaygeomatics.com>:

> Hi David,
>
> I have tested this locally using a string field that has values of "0.5 -
> 1.0" the same as yours, and have setup a mapfile layer with an expression
> of: EXPRESSION "0.5 - 1.0"  I am able to correctly echo that expression
> through PHPmapscript's getExpressionString() such as:
>
>   // open existing mapfile
>   $oMap = ms_newMapObj("./getexpression.map");
>   //get layer
>   $oLayer = $oMap->getLayerByName("test");
>   //get class
>   $oClass = $oLayer->getClass(0);
>   //get expression
>   $expression =  $oClass->getExpressionString();
>
>   echo $expression;
>
>
> I am testing with MS4W 3.1.3 (MapServer 7.0.1).
>
> -jeff
>
>
> --
> Jeff McKenna
> MapServer Consulting and Training Services
> http://www.gatewaygeomatics.com/
>
>
>
> On 2016-03-24 8:23 AM, Donald wrote:
>
>> Hello everyone,
>>
>> I have a mapfile with the folowing setup.
>>
>> CLASS
>>        NAME "a7127d96d561327f30ee0e4d3d3bb43e"
>>        EXPRESSION ('[reu]' = '0.5 - 1.0')
>>        STYLE
>>          COLOR 76 179 42
>>          OUTLINECOLOR 76 179 42
>>          SIZE 3
>>        END # STYLE
>>        TITLE "1525c/62c//0.5 - 1.0"
>> END # CLASS
>>
>>   Whenever I call the method
>> /$class->getExpressionString() /I get a string "05 - 10" instead of "0.5
>> - 1.0". What should I do to solve this issue ?
>>
>> Thanks,
>>
>> David
>> /
>> /
>>
>>
>
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20160324/95c3f015/attachment.html>


More information about the mapserver-dev mailing list