[ka-Map-users] query in ka-map with mapserver

Hajime TANAKA hajime.tanaka at tufts.edu
Wed Dec 23 22:14:40 EST 2009


s> 1、what do "fields" mean? Are they the attributes or shapes from my database
> or anything else?
Yes they are the names of the attributes in the shapefile.
You may use Postgis as well.

> 2、what is the template.html  used  for ? Does it give the query rules or
> displaying styles?
I don't understand very well about templates either.
It seems necessary for Mapserver,
http://mapserver.org/mapfile/template.html
but as far as I use, Ka-map often works without templates.

Hajime

2009/12/23 王连波 <happyforev1 at gmail.com>:
> Think you for your quick reply, Hajime. However, I still have two quetions:
> 1、what do "fields" mean? Are they the attributes or shapes from my database
> or anything else?
> 2、what is the template.html  used  for ? Does it give the query rules or
> displaying styles?
> thank you again, and I will read the resources you give me here.
>
> 2009/12/23 Hajime TANAKA <hajime.tanaka at tufts.edu>
>>
>> Hi,
>>
>> according to
>> http://ka-map.ominiverdi.org/wiki/index.php/Query
>> http://ka-map.ominiverdi.org/wiki/index.php/Mapfile_Metadata_Configuration
>> you need
>>
>> METADATA
>>  "queryable" "true"
>>  "fields" "A:alias_A, B:alias_B, C:alias_C" # the selected fields
>> will be displayed on the left panel with alias names
>> END
>>
>> in a layer. and you also need to make template.html for the layer
>>
>> #---------------template.html-----------------#
>> <!-- MapServer Template -->
>> <html>
>>  <head><title>Global Template</title></head>
>>  <body>
>>       <li> [A]
>>       <li> [B]
>>       <li> [C]
>>  </body>
>> </html>
>> #---------------template.html end---------------#
>>
>> and, put TEMPLATE in CLASS
>>
>> CLASS
>> # skip #
>>  TEMPLATE template.html
>> # skip #
>> END
>>
>> I remember <!-- Mapserver Template--> is necessary.
>>
>> 2. You need to entirely include the polygon with the rectangle
>>
>> 3. My understanding is that when query is successful, MS_SUCCESS will
>> be returned as the value of 1
>> http://mapserver.org/mapscript/php/index.html
>> map_query_float.php, first getResult($a) should be changed to
>> getResult(0) for multiple layer queries.
>> http://lists.maptools.org/pipermail/ka-map-users/2007-June/003026.html
>>
>> I hope this helps,
>>
>> Hajime
>>
>> 2009/12/23 王连波 <happyforev1 at gmail.com>:
>> > hello all,
>> >
>> >  I want to query something from my map which is displayed through ka-map
>> > from mapserver. However, the problem is I am not clear about how to use
>> > query. Should I add QUERYMAP in my mapfile, or what is ITEMQUERY mean? I
>> > have read the MapServer docs, but it is too little for me to understand.
>> > Is
>> > there some examples or resources for me, thank you in advance.
>> >  BTW, in ka-map there is a file named map_query_float.php. I read it and
>> > got
>> > something, but I am not clear about that:
>> > 1、the "fields" I should add into my mapfile mean what?  Is it the
>> > queried
>> > shape's attributes from the table where I store the shapes in my
>> > database,
>> > or something  else?
>> > 2、If I want to query something (eg. population) of a city in a state,
>> > while
>> > I just draw a box to select part of the city, can I get that city's
>> > population or that just the cities which are totally selected in the box
>> > can
>> > be queried? I hope someone can understand me and give me some hints.
>> > 3、this is a simple question: why I can not get the "if" sentences
>> > executed
>> > with "if ($check_query == MS_SUCCESS)" , while it is ok with "if
>> > ($check_query == 1)"? (I had loaded PHP/MapScript module in my PHP
>> > script
>> > file.)
>> >
>> > Any help is appreciated.
>> >
>> > --
>> > 天道酬勤
>> >
>> > _______________________________________________
>> > ka-Map-users mailing list
>> > ka-Map-users at lists.maptools.org
>> > http://lists.maptools.org/mailman/listinfo/ka-map-users
>> >
>> >
>>
>>
>>
>> --
>> Hajime Tanaka
>> _______________________________________________
>> ka-Map-users mailing list
>> ka-Map-users at lists.maptools.org
>> http://lists.maptools.org/mailman/listinfo/ka-map-users
>
>
>
> --
> 天道酬勤
>



-- 
Hajime Tanaka


More information about the ka-Map-users mailing list