[Mapserver-users] querying WMS layer

Gregor Mosheh stigmata at blackangel.net
Wed Jun 2 23:32:50 PDT 2004


On Wed, 2 Jun 2004, Kralidis,Tom [Burlington] wrote:

> Basically, you have to set DUMP TRUE in your LAYER object to enable
> this, as well as setting template header,body,footer.
> At this point, your WMS' GetCapabilities response will advertise your
> queryable layers with an XML attribute of 'queryable="1"', which means
> that a client can query as per the WMS spec.

I've been through both the WMS howtos a dozen times, but I just can't see
the part that describes how to set up query templates. There's a vague
reference to setting the mime type for query results, but nothing about
how setting up the templates differs from that of a "normal" mapfile. (Am
I just being dense?)

Here's a layer definition from the WMS server:

# USA state boundaries
LAYER
  NAME states
  TYPE polygon
  STATUS on
  DUMP true

  CONNECTIONTYPE postgis
  CONNECTION "user=XXX dbname=XXX password=XXX host=localhost"
  DATA "the_geom from states"

  PROJECTION
    "init=epsg:4269"
  END
  METADATA
    "wms_title" "states"
  END

  CLASS
    OUTLINECOLOR 50 50 50
    COLOR 255 255 255
    TEMPLATE "states.html"
  END
END


It must be partly right, cuz the GetCapabilities does indeed now say that
this is a queryable layer (previously, it did not):

    <Layer queryable="1" opaque="0" cascaded="0">
        <Name>states</Name>
        <Title>states</Title>
        (and so on)
    </Layer>



So I guess the server part is working, so I need to setup the client part,
right? I put these in the client's layer definition, which worked A-OK
when the layer was in a shapefile. Now that the layer is WMS, I just get
the blank template.

TOLERANCE 4
TEMPLATE "query_templates/template_states.html"












More information about the MapServer-users mailing list