Hi Michael: It should look like:

$layer->queryByShape($circle);

for($i=0; $i<$layer->getNumResults(); $i++) {
        $shape = $layer->getShape($layer->getResult($i));
       # do whatever with the shape
}

The RFC that describes the changes is here: 
http://mapserver.org/development/rfc/ms-rfc-65.html.

Steve


From: [email protected] 
[mailto:[email protected]] On Behalf Of Michael McInnis
Sent: Friday, September 27, 2013 12:06 PM
To: [email protected]
Subject: [mapserver-users] Old code must be deprecated

I'm trying to get some old code to work with 6.+ and can't retrieve census 
counts yet via the old method.
Does someone know what the new syntax would be below?

Thanks

$layer->queryByShape($circle);
            $numResults = $layer->getNumResults();

            if($numResults > 0 && $numResults < 10000){
                        echo '';
                        echo '<br/><br/> numResults : '.$numResults;

                        $totalPop = 0;
                        $error = false;
                        debug("  $numResults results.");

                        $layer->open();

                        for($i=0;$i<$numResults;++$i){
                                    // New way
                                    $shpIdx = $layer->getResult($i)->shapeindex;
                                    echo 'shpIdx : '.$shpIdx;

                                    //$feat = $layer->getFeature($shpIdx);      
    // <- DOES NOT WORK
                                    //echo 'feat : '.$feat;

                        }

                        $layer->close();

                        return 1;
            }else{
                        return 0;
            }

_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to