[ka-Map-users] search function for several fields from postgis

donny wicaks donnywicaks at yahoo.com
Fri Dec 19 05:35:11 EST 2008


Hi, All

I'm Donny Wicaksono from Indonesia. i'm developing a web-gis. I use ka-map and postgis as database.

I have difficulties, i really hope anyone can help me.. :)

I'm developing accident occurrences in a certain location, for example in one district. They are displayed as points in ka-map. The occurrences are yearly, in 2004, 2005, and 2006. The map and the points have already successfully displayed. The identify function per point is working and also is the search function.

But this is the problem i'm facing:

I need to make the 'search function' that can get data by inserting word query from two or more fields in my database. For example, i can search by "Car Type" which comes from one field from my database, and i can also search by "Accident Type" which comes from another field. So i can get search results if i use either car name or accident type.
But from what i have learned in ka-map wiki, it seems that  the 'search function'  can only be applied for one field. So, i have to choose between by "Car Type" or by "Accident Type" in my map file configuration in 'searchfield' part.

This is my map file in Layer part:
.................................
LAYER
    NAME 'accident 2006'
    GROUP 'Accident 2006'
    TYPE POINT
    CONNECTIONTYPE postgis
    CONNECTION "host=localhost user='postgis' password=password dbname='car_accidents'"
    DATA 'coordinates FROM cases' 
    FILTER "extract(year from date)='2006'"
    
    METADATA
      'wms_title' 'cases'
      'queryable'    'true'
      'searchfield'    'car_type'
      'fields'    'car_type:Car Type,accident_type:Accident Type,description:Description,date:Date,time:Time,time_zone:Time Zone'
    END
    STATUS on
    TRANSPARENCY 100
    PROJECTION
    'proj=longlat'
    'ellps=WGS84'
    'datum=WGS84'
    'no_defs'
    ''
    END
    LABELITEM 'car_type'
    CLASS
    TEMPLATE "kueri.html"
       NAME 'Year 2006' 
       STYLE
         SYMBOL 'CIRCLE' 
         SIZE 7 
         OUTLINECOLOR 0 0 0
         COLOR 255 0 0
       END
      LABEL 
      SIZE small
      COLOR 0 0 0 
      ANGLE 0
      BUFFER 2
     END 
    END
    PROCESSING "close_connection=DEFER"
  END
    #Circle symbol
      SYMBOL
        NAME 'CIRCLE'
        TYPE ellipse
        FILLED true
        POINTS
          1 1
        END
      END 
  ...........................

I have tried to make it
'searchfield' 'car_type', 'accident_type' 
or
'searchfield' 'car_type'
'searchfield' 'accident_type'

But none of them works. 

How should i configure my map file in order to have search function works by using data from more than one field? Is it possible to do? Or do I have to configure another files? If so, which files, and how should i do that?


i will appreciate any helps....

thank you

-don-


       
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/ka-map-users/attachments/20081219/3475dd54/attachment.html 


More information about the ka-Map-users mailing list