[mapserver-users] Something odd with queries in 5.6.1

Carlos Ruiz boolean10001 at yahoo.com
Wed Mar 10 13:53:45 PST 2010


Hi all,

I noticed something odd when I do a query with the new 5.6.1 version.

The getFeature method seems to return a NULL value, when it was working good before the new version update.

Here's the code:

$n = $map->numlayers;

for ($i = 0; $i < $n; $i++) {

    $theme = $map->GetLayer($i);
    
    if ($tema->isVisible()) {
        if (($regs = $theme->getNumResults()) == 0) {
            continue;
        }
    }
    else {
        continue;
    }
        
    $theme->open();            
    $values = $theme->getitems();
    
    unset($atts);

    for ($reg = 0; $reg < $regs; $reg++) {

        $result = $theme->getResult($reg);
        // getFeature is returning NULL with the 5.6.1 version
        $element = $theme->getFeature($result->shapeindex, $result->tileindex);
        
        for ($value = 0; $value < count($values); $value++) {
            $atts[] = $values[$value] . " " . $element->values[$values[$value]];
        }
        
        // php crash because $element is a non object
        $element->free();
        
    }
        
    $theme->close();
        
        ...
        
}

Any help or idea will be appreciated.

Thanks in advance


IC Carlos Ruiz


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100310/709ad21d/attachment.htm>


More information about the MapServer-users mailing list