QueryByAttributes with postgresql

Claudio Cesar Trevisani claudio.trevisani at PMMG.MG.GOV.BR
Mon Oct 4 13:10:01 EDT 2004


Hi,

I'm from Brazil. For first, excuse my english!!!
When I use the function "querybyattributes" in a shapefile, everthing is
OK!!! Wherever, after export my shapefile to postgresql (use shp2pgsql),
this function (querybyattributes) don't work...(nothing appear);

This is my php code:



         $oLayBairro = $map->getLayerByName("lotes");
  $expressao = "entityid=".$GET_["PARCEL-NUMBER"]; echo $expressao;

if (($oLayBairro->querybyattributes("entityid",$expressao,
MS_SINGLE))==MS_SUCCESS){

    echo "passou";
    $oResult = $oLayBairro->getResult(0);
    $oLayBairro->open();
    //echo $oLayBairro->getclass(0);
    $oZoomTo = $oLayBairro->getShape(-1,$oResult->shapeindex);
 $nminx = $oZoomTo->bounds->minx - 100;
 $nminy = $oZoomTo->bounds->miny - 100;
 $nmaxx = $oZoomTo->bounds->maxx + 100;
 $nmaxy = $oZoomTo->bounds->maxy + 100;
    $map->setextent($nminx, $nminy, $nmaxx, $nmaxy);



Somebody Help me, please.

Claudio C. Trevisani.



More information about the mapserver-users mailing list