Query Feature from a database source

Bryce Bangerter bryceb at TULGAGAMES.COM
Mon Feb 13 20:39:06 EST 2006


I've been looking at the Itasca demo and see how they query a feature
from a given layer.  I want to be able to do the same when my
information is stored in a database, but I have been unable to figure
out how to do so.
 
I have the following layer:
 
LAYER
  NAME Machine_Outlines
  GROUP Machine
  CONNECTIONTYPE postgis
  CONNECTION "host=localhost port=5432 dbname=thedatabase
password=thepassword user=testuser"
  DATA "outline FROM (SELECT instance_id AS id, Translate(outline,
X(position), Y(position), 0) AS outline FROM instance INNER JOIN
primitive_def_footprint ON instance.primitive_def_id =
primitive_def_footprint.primitive_def_id WHERE primitive_type =
'machine') AS instance USING UNIQUE id USING SRID=-1"
  TYPE POLYGON
  STATUS OFF
  CLASS
    NAME 'Machine'
    OUTLINECOLOR 0 0 0
    COLOR 192 64 192
    TEMPLATE templates/Machines.html
  END
  
  HEADER "templates/Machines_header.html"
  FOOTER "templates/Machines_footer.html"

END
 
And then Machines.html looks like
<tr><td>[lrn]</td><td>[NAME]</td></tr>
 
What I have been unable to figure out is how to get [NAME] to represent
the column 'name' from the instance table of my database.
 
Bryce Bangerter
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060213/fd39ae4c/attachment.html


More information about the mapserver-users mailing list