It will give you the bounding coordinates of the all the shapes in your
result.  

We use it to dynamically zoom in on the results from our query.  It works
fine for our purposes.

Keep in mind that you can get most everything you need from shape objects
that the loop iterates through.  You can parse out the lines, get the wkt,
centroid or whatever you want.

Check out 
http://mapserver.gis.umn.edu/docs/reference/phpmapscript-class/classes/shape
obj

Hope this helps,

Paul

On 2/29/08 7:54 AM, "Pearson, Gregory" <[EMAIL PROTECTED]>
wrote:

> Thanks, Paul. I was hoping the API provided this function. So, you¹re saying I
> can derive the coordinates from the min/max X and Y points? Have you
> implemented this?
>  
> Greg
>  
> 
> 
> From: Paul Moen [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 28, 2008 4:16 PM
> To: Pearson, Gregory; [EMAIL PROTECTED]
> Subject: Re: [UMN_MAPSERVER-USERS] Mapscript Question
>  
> You could try to use the bounds and loop through the results.
> 
>     [EMAIL PROTECTED]>queryByAttributes($item,$temptest,MS_MULTIPLE);
>     if ($test == MS_SUCCESS) {
>             $minX=-1;
>             $minY=-1;
>             $maxX=-1;
>             $maxY=-1;
>             for ($ind = 0;$ind<$qlayer->getNumResults();$ind++) {
>                 $result = $qlayer->getResult($ind);
>                 $shpindex = $result->shapeindex;
>                 $tilindex = $result->tileindex;
>                 $shptemp = $qlayer->getShape($tilindex,$shpindex);
>                 $rec = $shptemp->bounds;
>                 if ($minX == -1 or $minX > $rec->minx)
> $minX=Round($rec->minx);
>                 if ($minY == -1 or $minY > $rec->miny)
> $minY=Round($rec->miny);
>                 if ($maxX == -1 or $maxX < $rec->maxx)
> $maxX=Round($rec->maxx);
>                 if ($maxY == -1 or $maxY < $rec->maxy)
> $maxY=Round($rec->maxy);
>             }
>     }
> 
> On 2/28/08 2:23 PM, "Pearson, Gregory" <[EMAIL PROTECTED]>
> wrote:
> I am doing a layer search using the method queryByAttributes and want to know
> if I can get the map coordinates from the result. So far, I haven¹t seen
> anything in the API documentation that supports this. Is this possible?
>  
> Greg
> 
> 
> Paul
> 


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

Reply via email to