[mapserver-dev] getExpressionString issue

Jeff McKenna jmckenna at gatewaygeomatics.com
Thu Mar 24 08:30:05 PDT 2016


I'm not sure.  I know that for PHPmapscript there is no getClassByName 
function (it was filed as a ticket back in 2002 ha).  I'm also not aware 
of any recent changes in MapServer that fixed your issue.  Maybe others 
have ideas.  I just cannot reproduce this with MapServer 7.0.1

-jeff


-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/



On 2016-03-24 11:56 AM, Donald wrote:
> 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
> <mailto: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
>         /
>         /
>
>



More information about the mapserver-dev mailing list