Can someone help
Bob Bruce
covariance at SHAW.CA
Tue Mar 8 13:02:04 PST 2005
Right off the top of my head, this is what I recently did to select the
database attributes for the objects inside of the current map view:
1) $CurrentMapRectObj= $MyMapObj->extent;
2) $AlayerObj = $MyMapObj->getLayer(1); // (if you're querying on 2nd
layer in the map)
3) $AlayerObj->queryByRect($CurrentMapRectObj);
4) $NumObjects = $AlayerObj->getNumResults();
5) for($i=0; $i < $NumObjects; $i++) {
$ThisCacheObj = $AlayerObj->getResult($i)
$ThisShapeObj = $AlayerObj->getShape($ThisCacheObj->tileindex,
$ThisCacheObj->shapeindex);
$MyShapeAttribute = $ThisShapeObj->values["theattributename"];
//
// Now connect to the database using mysql_connect and formulate
your
// query string based on $MyShapeAttribute and submit the SQL query
// and retrieve the results
//
}
I hope that this helps you.
Bob Bruce
On Mon, 7 Mar 2005 22:56:44 +0500, padmapriya balachandran
<abcpriya at LYCOS.COM> wrote:
>Hi all,
> I am developing an application for satellite data availability
using Mapscript,PHP and MySQL.My .dbf file has path and row fields.
>My database contains information about pathrow,DateofPass,etc.
>
>I want to get information available in the database just by selecting the
area of interest in the mapfile.
>
>How to connect mapfile fields with MySQL attributes(Both having common
entity-path&row)?
>
More information about the MapServer-users
mailing list