Query Feature from a database source

Obe, Regina DND\MIS robe.dnd at CITYOFBOSTON.GOV
Tue Feb 14 10:08:40 EST 2006


The fields in postgis are lowercase and Mapserver is case sensitive so I
think you have to make [NAME]   [name].  Also you need to put name as a
field output in your subselect.

-----Original Message-----
From: Bryce Bangerter [mailto:bryceb at TULGAGAMES.COM] 
Sent: Monday, February 13, 2006 8:39 PM
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: [UMN_MAPSERVER-USERS] Query Feature from a database source


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
 




-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally
privileged and/or exempt from disclosure pursuant to Massachusetts
law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and
delete the material from any computer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060214/431d613e/attachment.html


More information about the mapserver-users mailing list