[Mapserver-users] querying WMS layer

bartvde at xs4all.nl bartvde at xs4all.nl
Thu Jun 3 03:45:30 EDT 2004


Hi Gregor,

what you are trying to do is called cascading GetFeatureInfo. This is not
implemented. Cascading means you have a CONNECTIONTYPE WMS layer, these
type of layers cannot be queried.

You can query your "server-side" layer in most other WMS clients, such as
Chameleon, but these don't go through Mapserver WMS client for
GetFeatureInfo but call the WMS server directly.

A technical story, but I hope you get the drift.

As an example I will paste a "server-side" layer which will be querable
and which can be queried with output type GML, but this is just for the
record as your setup will not work because GetFeatureInfo is not cascaded:

  LAYER
      CONNECTION "user=Administrator dbname=bart host=localhost"
      CONNECTIONTYPE postgis
        METADATA
          WMS_TITLE "Top50"
          WMS_ABSTRACT "Top50 via UMN Mapserver"
          WMS_SRS "EPSG:28992"
          WFS_TITLE "Top50"
        END
      NAME "Top50"
      DATA "the_geom from top50"
      MINSCALE 0
      MAXSCALE 50000
      TEMPLATE "blank.html"
      TOLERANCE 0
      TOLERANCEUNITS PIXELS
      DUMP TRUE
      STATUS ON
      TYPE POLYGON
      DEBUG ON
      CLASS
        NAME "Foreign Lands"
        STYLE
          MAXSIZE 100
          MINSIZE 1
            OUTLINECOLOR 0 0 0
          SIZE 2
          SYMBOL 0
        END
      END
  END

Best regards,
Bart

>
> 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"
>
>
>
>
>
>
>
>
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>




More information about the mapserver-users mailing list