php/mapscript queryByRect on raster files

Andrea Marelli maro.jam at TISCALI.IT
Mon Feb 13 07:18:38 PST 2006


Any hint?
i will hopefully wait...
Thanks!!

bye
Andrea




>Hi guys,
>
>i'm implementing queryByRect on raster files using php/mapscript.
>The script i've written (see following code) works well, but i have a little
>problem when i make queries on large areas...
>It seems that the getShape function uses a very large amount of memory on
>the server, so i put $shape->free(); but it seems to do nothing..
>Any suggestion on how to free shared memory on server?
>
>
>   $query_rect = ms_newRectObj();
>   $query_rect->setextent($westlon, $northlat, $eastlon, $southlat);
>   @$layer = $map->getLayer(0);
>   $return = $layer->queryByRect($query_rect);
>   if($return == MS_SUCCESS){
>
>        $num_results = $layer->getNumResults();
>        $layer->open();
>
>        for($i=0; $i<$num_results; $i++){
>
>            $shape = $layer->getShape(0, $i);
>            $values = $shape->values;
>
>            // output
>            echo $values['value_list'];
>            echo '<br>';
>
>            $shape->free();   // ??????
>            unset($shape);
>            unset($values);
>
>         }
>
>      $layer->close();
>      $map->freequery(0);
>      $query_rect->free();
>
>    }



More information about the MapServer-users mailing list