[mapserver-users] Old code must be deprecated

Lime, Steve D (MNIT) Steve.Lime at state.mn.us
Fri Sep 27 13:17:48 PDT 2013


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: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Michael McInnis
Sent: Friday, September 27, 2013 12:06 PM
To: mapserver-users at lists.osgeo.org
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;
            }

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20130927/112a0f6f/attachment.html>


More information about the mapserver-users mailing list