QUERYMAP and postgis

Peter Huis in 't Veld peterh at IVS90.NL
Wed Jan 18 08:59:36 PST 2006


Hello

I've the question: How can I show the attributes of a a postgis query 
using mapserver. At the moment I've GIS layer showing me all the object 
in the spatial database, so the query isn't isn't the problem. Changing 
the mode into query mode Ik get the following message:

msQueryByPoint(): Search returned no results. No matching record(s) found.

I've seen the remark on the mapserver web-site by Bart vd Eijnden, but 
this doesn't give me any additional info. I made the following changes
to the code in order to query the Map file by clicking on the map item:

*QUERYMAP
   STATUS ON
   STYLE HILITE
   COLOR 0 255 0
END
*

LAYER
    CONNECTIONTYPE POSTGIS
    CONNECTION  ....
    DATA "object_geom  from  (SELECT a, b, c, object_geom  from table) 
as myquery using unique object_geom"
    *TOLERANCE 5*
    CLASS
        LABEL
           ...
        END          
    END
  *  TEMPLATE "query_result.html"*
    PROJECTION
             ......
    END
END

The query_result.html looks like:

  <table>
     <tr>
       <td>[lrn]</td>
       <td>[a]</td>
       <td>[b]</td>
       <td>[c]</td>
     </tr>
  </table>

Should the query_result.html be in a specific directory? I've places it 
in htdocs where my index.html is present.

Thanks for any help!

Peter



More information about the MapServer-users mailing list