yes, now it is a little clear. I think when I draw a box on my map, then all the features in that box will be included in the query results. So I can check the query fields for what I want.<br>Is it that? However, when I finished the query the output results from the file named map_query_float.php is 0, and I am sure I have included a city (which is defined as polygon in my mapfile) in my query area? what is the matter? Can you give me some ideas? Thank you very much !<br>
<br> <br><div class="gmail_quote">2009/12/24 Hajime TANAKA <span dir="ltr"><<a href="mailto:hajime.tanaka@tufts.edu">hajime.tanaka@tufts.edu</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
s> 1、what do "fields" mean? Are they the attributes or shapes from my database<br>
> or anything else?<br>
Yes they are the names of the attributes in the shapefile.<br>
You may use Postgis as well.<br>
<div class="im"><br>
> 2、what is the template.html used for ? Does it give the query rules or<br>
> displaying styles?<br>
</div>I don't understand very well about templates either.<br>
It seems necessary for Mapserver,<br>
<a href="http://mapserver.org/mapfile/template.html" target="_blank">http://mapserver.org/mapfile/template.html</a><br>
but as far as I use, Ka-map often works without templates.<br>
<div><div></div><div class="h5"><br>
Hajime<br>
<br>
2009/12/23 王连波 <<a href="mailto:happyforev1@gmail.com">happyforev1@gmail.com</a>>:<br>
> Think you for your quick reply, Hajime. However, I still have two quetions:<br>
> 1、what do "fields" mean? Are they the attributes or shapes from my database<br>
> or anything else?<br>
> 2、what is the template.html used for ? Does it give the query rules or<br>
> displaying styles?<br>
> thank you again, and I will read the resources you give me here.<br>
><br>
> 2009/12/23 Hajime TANAKA <<a href="mailto:hajime.tanaka@tufts.edu">hajime.tanaka@tufts.edu</a>><br>
>><br>
>> Hi,<br>
>><br>
>> according to<br>
>> <a href="http://ka-map.ominiverdi.org/wiki/index.php/Query" target="_blank">http://ka-map.ominiverdi.org/wiki/index.php/Query</a><br>
>> <a href="http://ka-map.ominiverdi.org/wiki/index.php/Mapfile_Metadata_Configuration" target="_blank">http://ka-map.ominiverdi.org/wiki/index.php/Mapfile_Metadata_Configuration</a><br>
>> you need<br>
>><br>
>> METADATA<br>
>> "queryable" "true"<br>
>> "fields" "A:alias_A, B:alias_B, C:alias_C" # the selected fields<br>
>> will be displayed on the left panel with alias names<br>
>> END<br>
>><br>
>> in a layer. and you also need to make template.html for the layer<br>
>><br>
>> #---------------template.html-----------------#<br>
>> <!-- MapServer Template --><br>
>> <html><br>
>> <head><title>Global Template</title></head><br>
>> <body><br>
>> <li> [A]<br>
>> <li> [B]<br>
>> <li> [C]<br>
>> </body><br>
>> </html><br>
>> #---------------template.html end---------------#<br>
>><br>
>> and, put TEMPLATE in CLASS<br>
>><br>
>> CLASS<br>
>> # skip #<br>
>> TEMPLATE template.html<br>
>> # skip #<br>
>> END<br>
>><br>
>> I remember <!-- Mapserver Template--> is necessary.<br>
>><br>
>> 2. You need to entirely include the polygon with the rectangle<br>
>><br>
>> 3. My understanding is that when query is successful, MS_SUCCESS will<br>
>> be returned as the value of 1<br>
>> <a href="http://mapserver.org/mapscript/php/index.html" target="_blank">http://mapserver.org/mapscript/php/index.html</a><br>
>> map_query_float.php, first getResult($a) should be changed to<br>
>> getResult(0) for multiple layer queries.<br>
>> <a href="http://lists.maptools.org/pipermail/ka-map-users/2007-June/003026.html" target="_blank">http://lists.maptools.org/pipermail/ka-map-users/2007-June/003026.html</a><br>
>><br>
>> I hope this helps,<br>
>><br>
>> Hajime<br>
>><br>
>> 2009/12/23 王连波 <<a href="mailto:happyforev1@gmail.com">happyforev1@gmail.com</a>>:<br>
>> > hello all,<br>
>> ><br>
>> > I want to query something from my map which is displayed through ka-map<br>
>> > from mapserver. However, the problem is I am not clear about how to use<br>
>> > query. Should I add QUERYMAP in my mapfile, or what is ITEMQUERY mean? I<br>
>> > have read the MapServer docs, but it is too little for me to understand.<br>
>> > Is<br>
>> > there some examples or resources for me, thank you in advance.<br>
>> > BTW, in ka-map there is a file named map_query_float.php. I read it and<br>
>> > got<br>
>> > something, but I am not clear about that:<br>
>> > 1、the "fields" I should add into my mapfile mean what? Is it the<br>
>> > queried<br>
>> > shape's attributes from the table where I store the shapes in my<br>
>> > database,<br>
>> > or something else?<br>
>> > 2、If I want to query something (eg. population) of a city in a state,<br>
>> > while<br>
>> > I just draw a box to select part of the city, can I get that city's<br>
>> > population or that just the cities which are totally selected in the box<br>
>> > can<br>
>> > be queried? I hope someone can understand me and give me some hints.<br>
>> > 3、this is a simple question: why I can not get the "if" sentences<br>
>> > executed<br>
>> > with "if ($check_query == MS_SUCCESS)" , while it is ok with "if<br>
>> > ($check_query == 1)"? (I had loaded PHP/MapScript module in my PHP<br>
>> > script<br>
>> > file.)<br>
>> ><br>
>> > Any help is appreciated.<br>
>> ><br>
>> > --<br>
>> > 天道酬勤<br>
>> ><br>
>> > _______________________________________________<br>
>> > ka-Map-users mailing list<br>
>> > <a href="mailto:ka-Map-users@lists.maptools.org">ka-Map-users@lists.maptools.org</a><br>
>> > <a href="http://lists.maptools.org/mailman/listinfo/ka-map-users" target="_blank">http://lists.maptools.org/mailman/listinfo/ka-map-users</a><br>
>> ><br>
>> ><br>
>><br>
>><br>
>><br>
>> --<br>
>> Hajime Tanaka<br>
>> _______________________________________________<br>
>> ka-Map-users mailing list<br>
>> <a href="mailto:ka-Map-users@lists.maptools.org">ka-Map-users@lists.maptools.org</a><br>
>> <a href="http://lists.maptools.org/mailman/listinfo/ka-map-users" target="_blank">http://lists.maptools.org/mailman/listinfo/ka-map-users</a><br>
><br>
><br>
><br>
> --<br>
> 天道酬勤<br>
><br>
<br>
<br>
<br>
</div></div>--<br>
<div><div></div><div class="h5">Hajime Tanaka<br>
_______________________________________________<br>
ka-Map-users mailing list<br>
<a href="mailto:ka-Map-users@lists.maptools.org">ka-Map-users@lists.maptools.org</a><br>
<a href="http://lists.maptools.org/mailman/listinfo/ka-map-users" target="_blank">http://lists.maptools.org/mailman/listinfo/ka-map-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>天道酬勤<br>