[mapserver-users] GetFeatureInfo request doubts

David Alda Fernandez de Lezea dalda at ikt.es
Mon May 24 02:48:54 EDT 2010


Hello Jukka, 

I think now I've understood how getFeatureInfo works in mapserver.

Thanks.

-----Mensaje original-----
De: Rahkonen Jukka [mailto:Jukka.Rahkonen at mmmtike.fi] 
Enviado el: viernes, 21 de mayo de 2010 14:18
Para: David Alda Fernandez de Lezea; mapserver-users at lists.osgeo.org
Asunto: Re: [mapserver-users] GetFeatureInfo request doubts

Hi,

This is indeed a little bit odd.

This is captured from http://mapserver.org/ogc/wms_server.html

# GetFeatureInfo: return info about feature(s) at a query (mouse click) location. MapServer supports 3 types of responses to this request:

    * text/plain output with attribute info.
    * text/html output using MapServer query templates specified in the CLASS template parameter. The MIME type returned by the Class templates defaults to text/html and can be controlled using the metadata "wms_feature_info_mime_type".
    * application/vnd.ogc.gml, GML.1 or GML for GML features.



For making the layer queryable at all there must have a TEMPLATE line in LAYER definitions.
TEMPLATE "d:/program files/ms4w/apps/template.html"

The template file must exist and it must validate the security test "Templates must contain the magic string 'mapserver template' in the first line of the template."

Now when you have TEMPLATE set and valid template file on disk your server should support GetFeatureInfo. The only supported info_format now it text/plain. However, it does not give any other info about features than a feature ID.
You must add first a line into LAYER-METADATA "wms_include_items" "all" starts to sent all the attributes "wms_include_items" "SPA,SCI,SCI2"  selects the named attributes. Attributes must be comma separated but there must not be any white space characters.

Now you should be able to get results as plain text.  Adding support for gml output is done by adding DUMP TRUE into LAYER definitions.  Now INFO_FORMAT=application/vnd.ogc.gml  However, you will need to define what will be includen in the output by adding "gml_include_items" "all" or something.

If you want to give also output as text/html you must do two further things:
- add to LAYER "wms_feature_info_mime_type" "text/html"
- creare valid template, header and footer documents on server. You did have a template file already, that is compulsory for making GetFeatureInfo work at all, but until now it could be just a fake file.

There is some extra magic with metadata inputs, for example ows_include_items should be enought instead of using both the wms_include_items and gml_include items.  But by remembering these four things, reading the documentation and experimenting you will do it.

TEMPLATE - to turn it on
DUMP TRUE - to make it support gml
"wms_feature_info_mime_type" - to make it support text/html "***_include_items" - to make is send some usable info

I hope I have understood it right, I have not used GetFeatureInfo very often.

-Jukka Rahkonen-




> -----Alkuperäinen viesti-----
> Lähettäjä: mapserver-users-bounces at lists.osgeo.org
> [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta David Alda 
> Fernandez de Lezea
> Lähetetty: 21. toukokuuta 2010 14:29
> Vastaanottaja: mapserver-users at lists.osgeo.org
> Aihe: [mapserver-users] GetFeatureInfo request doubts
> 
> Hi,
> 
> I've got a WMS service through MapServer, and I want that the layers 
> served in it be queryable through Desktop GIS software. How many ways 
> are there to present the information?? I'm going crazy because of the 
> documentation, I don't understand the differences between using 
> wms_feture_info_mime_type or DUMP TRUE, etc.
> 
> Can someone help me?
> 
> Thanks. 
>  
> Un saludo,
>  
> ······························································
> ····················
> 
> David Alda Fernández de Lezea
> Lurralde eta Biodibertsitate Saila / Dpto. de Territorio y 
> Biodiversidad
>  
> IKT
> Granja Modelo s/n · 01192 · Arkaute (Araba)
> 
> ······························································
> ····················
> Tlfnos.: 945-00-32-95                         Fax: 945-00.32.90
> ······························································
> ····················
> email: dalda at ikt.es                                web: www.ikt.es
> ······························································
> ····················
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 


More information about the mapserver-users mailing list