queryBypoint problem - Please help
Nagu Govind
lsnagu at YAHOO.COM
Sun Feb 13 00:31:59 PST 2005
Hi,
Iam using MapScript.
I want to find out the State and District name using latiudes and longitudes. My .dbf file has the following fields
1.Dst_ID
2.District
3. State
I want to get this info corresponding to my lat and long.
My map file layer is like this
---------------------
MAP
NAME "ind"
SIZE 500 500
STATUS ON
SYMBOLSET "maps/symbols/examples.sym"
EXTENT 67 5 99 40
SHAPEPATH "maps/data/"
PROJECTION
"proj=latlong"
"datum=NAD83"
END
WEB
IMAGEPATH "maps/tmp/"
IMAGEURL "maps/"
TEMPLATE 'maps/myind.html'
END
QUERYMAP
STATUS ON
STYLE SELECTED
COLOR 255 255 0
END
LAYER
NAME "Ind"
TYPE POLYGON
STATUS ON
DATA "ind_ds"
PROJECTION
"proj=latlong"
"ellps=GRS80"
END
CLASS
NAME "IND MAP"
OUTLINECOLOR 0 0 0
COLOR 255 255 0
SYMBOL dash-long
STATUS ON
END
TEMPLATE ind_query.html
END
END
-----------------------
And Iam calling Query by point as folows
$point = ms_newpointObj();
$point->setXY($lon,$lat);
$layer1 = $map->getLayerByName('Ind');
if($layer1->queryBypoint($point,MS_SINGLE,$buffer) == MS_SUCCESS){
echo "Success : $buffer";
}
Iam getting this warning message
Warning: [MapServer Error]: msQueryByPoint(): No matching record(s) found.
Iam new to mapserver & I really dont know whether this is the right method to get the info from the dbf file. Iam having only one polygon layer. Do i need to have another layer for quering.?.
Please tell me where Iam going wrong.
The concepts of layers are also not much clear to me. Regarding Mapscript and Map File , reference documents are there but I could not find any elaborate examples or application notes.
Please tell me where i can find them.
I also could not find any good samples similar to my requirement.
Some one please help me.
Regards
vdharan
---------------------------------
Do you Yahoo!?
Yahoo! Mail - Helps protect you from nasty viruses.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050213/c8edbf29/attachment.htm>
More information about the MapServer-users
mailing list