[mapserver-users] Something odd with queries in 5.6.1

Andy Colson andy at squeakycode.net
Wed Mar 10 17:46:28 EST 2010


On 3/10/2010 3:53 PM, Carlos Ruiz wrote:
> 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()) {
--------^
theme?


> 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
>
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the mapserver-users mailing list