Hi all,<br> I added TEMPLATE to my mapfile and changed the codes in the tools/search/kaSearch.php file to the following: if($oLayer->connectiontype == MS_POSTGIS){<br> $searchstring = "($szSearchfield ilike '%$psearch%')";<br>
} else {<br> $searchstring = "\"".$szSearchfield."~* '".$psearch."'\"";<br> }<br>And now I am so happy to tell you that it is ok to search with ka-map from Postgis although it still does not work with shapefile data source. Even so, when I search with ka-map the database system gives the following error:<br>
ERROR: type "ilike" does not exist at character 225<br>STATEMENT: select encode(AsBinary(force_collection(force_2d("the_geom")),'NDR'),'base64') as geom,"gid" from xzqj_s where the_geom && GeomFromText('POLYGON((120 39,120 43,124 43,124 39,120 39))',find_srid('','xzqj_s','the_geom')) and ilike '%jinzhou%'<br>
<br>if I take the integer field as the search string, then there is another error:<br>ERROR: operator does not exist: integer ~~* unknown at character 230<br>HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.<br>
STATEMENT: select "gid",encode(AsBinary(force_collection(force_2d("the_geom")),'NDR'),'base64') as geom,"gid" from hl_l where the_geom && GeomFromText('POLYGON((120 39,120 43,124 43,124 39,120 39))',find_srid('','hl_l','the_geom')) and gid ilike '%23%'<br>
<br>Maybe the database server takes the number I input as a string, I will study on it. BTW, the searching results can not output Chinese, because the database in postgis is encoded in EDU_CN while my FreeBSD operating system' locale is UTF-8. I tried HEADER encoding in the PHP file. and ICONV( "EUC_CN","UTF-8",$ResultString), neigther of them is useful, anybody know a simple way to resolve this problem, thank you in advance. <br>
<br><div class="gmail_quote">2009/12/24 王连波 <span dir="ltr"><<a href="mailto:happyforev1@gmail.com">happyforev1@gmail.com</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;">
Thank you, Hajime. <br> I have just tried what you indicated me. But, nothing is changed and I still can not get "no matching results". Some other suggestion, please?<div><div></div><div class="h5"><br><br><div class="gmail_quote">
On Thu, Dec 24, 2009 at 6:24 PM, Hajime TANAKA <span dir="ltr"><<a href="mailto:hajime.tanaka@tufts.edu" target="_blank">hajime.tanaka@tufts.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Please give a try of setting<br>
<br>
CLASSITEM<br>
and<br>
EXPRESSION in the CLASS<br>
<br>
2009/12/24 王连波 <<a href="mailto:happyforev1@gmail.com" target="_blank">happyforev1@gmail.com</a>>:<br>
<div><div></div><div>> Hi all,<br>
> I am really anxious about ka-map query and search now. In my mapfile I<br>
> configured a layer as follows and it displayed a city's boundary constituted<br>
> of 68 lines. Then I think it is valid to select some of the lines and get<br>
> their id from the table where the_geo DATA is stored in my database.<br>
> However, when I finished the query just get "no matching results". I have<br>
> read the script file "map_query_float.php" and found nothing special. Should<br>
> I configure the mapfile to tell ka-map which table in postgis is going to be<br>
> looked for? If so, how? If not, why I can not get what I want ? Thank you<br>
> for any clues.<br>
><br>
> a querable layer of my mapfile<br>
> LAYER<br>
> METADATA<br>
> 'queryable' 'true'<br>
> fields "bound_id:BID"<br>
> hyperlink "cat|myurl"<br>
> "searchfield" "gid"<br>
> END<br>
> NAME xzqj_x<br>
> group "xzqj"<br>
> STATUS ON<br>
> TYPE line #if POINT is used,every polygon is white and<br>
> label is ineffective<br>
> CONNECTIONTYPE POSTGIS<br>
> CONNECTION "dbname=*** host=*** user=*** password=*** port=***"<br>
> DATA "the_geom from xzqj_x"<br>
> # labelitem cname<br>
> CLASS<br>
> NAME xzqj_x<br>
> STYLE<br>
> symbol dashed1<br>
> size 3<br>
> color 100 100 100<br>
> END<br>
> END<br>
> END<br>
><br>
><br>
><br>
<br>
<br>
<br>
</div></div>--<br>
<div><div></div><div>Hajime Tanaka<br>
_______________________________________________<br>
ka-Map-users mailing list<br>
<a href="mailto:ka-Map-users@lists.maptools.org" target="_blank">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></div></div><font color="#888888">-- <br>天道酬勤<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>天道酬勤<br>