RES: [UMN_MAPSERVER-USERS] queryBypoint problem - Please help
Murilo Lacerda Yoshida
murilo.yoshida at AGX.COM.BR
Mon Feb 14 06:24:20 PST 2005
Hi Nagu,
Are you sure your shapefile is correct? Because the code and the
mapfile seems ok to me, except the $buffer variable which is not set on
the code but I guess you set it before.
So if the code and the map seems ok, I think the problem is either
your shapefile isn't correct, or the point you are querying isn't inside
of any shape of the shapefile.
Test the qurybyPoint with a high value for $buffer... Then praticly
any point on the map will be valid for querying.
On the mapfile, the template attribute belongs to the class object,
not the layer object ... you can set it on the layer object though.
There is a STATUS ON on the class object ... that's wrong, there isn't
a status attribute on the class object ...
Hope the helps,
Murilo
-----Mensagem original-----
De: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] Em
nome de Nagu Govind
Enviada em: domingo, 13 de fevereiro de 2005 06:24
Para: MAPSERVER-USERS at LISTS.UMN.EDU
Assunto: Re: [UMN_MAPSERVER-USERS] queryBypoint problem - Please help
Hi Ruggero,
Thanks for your reply.
I added the MetaData Key word in layer as follows.
METADATA
"DESCRIPTION" "My layer ind"
"RESULT_FIELDS" "DISTRICT STATE"
END
But I still get the same warning "Warning: [MapServer
Error]: msQueryByPoint(): No matching record(s)
found".
I change the Lat and Lon and checked but there is no
change.
Please tell me Where Iam going wrong?. Is there any
thing else i have to check.
Regards
Nagu
--- Ruggero Valentinotti <valruggero at libero.it> wrote:
> Nagu Govind wrote:
>
> > 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/ <http://nagaraj:9000/maps/tmp/>"
> > 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
> >
>
<http://us.rd.yahoo.com/mail_us/taglines/virus/*http://promotions.yahoo.
com/new_mail/static/protection.html>
>
> > - Helps protect you from nasty viruses.
>
> Hi Nagu,
> you need METADATA keyword in Layer class:
>
> LAYER
> NAME "Ind"
> TYPE POLYGON
> STATUS ON
> METADATA
> "DESCRIPTION" "My layer ind"
> "RESULT_FIELDS" "DISTRICT STATE"
> END
> 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
>
>
> And then use Use '@' to avoid warning if query found
> nothing
>
> @$layer1->queryBypoint($point,MS_SINGLE,$buffer);
>
>
> Hope this help
>
> ruggero
>
>
>
>
> --
>
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
>
> /\ Ruggero Valentinotti
>
> //\\ /\ Studio Tecnico Ambientale
> Forestale
> ///\\\//\\ Frazione Tozzaga - Via alle
> Pozze, 2
> ////\\\\/\\\ 38022 CALDES (TN) - Italy
>
> /////\\\\\\\\\
>
> ||////\\\\\
> http://digilander.libero.it/valruggero/
>
> _____||___||_____ E-mail: valruggero at libero.it
>
>
__________________________________
Do you Yahoo!?
The all-new My Yahoo! - Get yours free!
http://my.yahoo.com
More information about the MapServer-users
mailing list