[mapserver-dev] Disabling GML output for one layer

Rahkonen Jukka (Tike) jukka.rahkonen at mmmtike.fi
Sun Oct 19 11:03:16 PDT 2014


Hi,

WMS standard does not mandate any info format. Only one that is fixed is the service exception format which is "XML" by default in WMS 1.3.0. Standard only says that the supported formats must be advertised. Nothing prevents disabling GML as far as I understand .

>From WMS 1.3.0 standard:

7.4.3.5 INFO_FORMAT
The mandatory INFO_FORMAT parameter indicates what format to use when returning the feature information.
Supported values for a GetFeatureInfo request on a WMS server are listed as MIME types in one or more
<Request><FeatureInfo><Format> elements of its service metadata. The entire MIME type string in <Format> is
used as the value of the INFO_FORMAT parameter. In an HTTP environment, the MIME type shall be set on the
returned object using the Content-type entity header. If the request specifies a format not supported by the server,
the server shall issue a service exception (code = InvalidFormat).
EXAMPLE The parameter INFO_FORMAT=text/xml requests that the feature information be formatted in XML.

-Jukka Rahkonen-

Angelos Tzotsos wrote: 
>  From IRC discussion:
> 
> It seems that GML output cannot be disabled: part of the WMS spec.
> 
> Also, setting
> TOLERANCE 0.0
> to the layer definition, reduces the number of empty elements.
> 
> Thanks,
> Angelos
> 
> On 10/19/2014 06:33 PM, Angelos Tzotsos wrote:
> > Update: I managed to remove all gml features with:
> >
> >    "gml_exclude_items" "all"
> >    "gml_geometries" "none"
> >
> > but I still want to get rid of the noise caused by the layer:
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> >
> > <msGMLOutput
> >      xmlns:gml="http://www.opengis.net/gml"
> >      xmlns:xlink="http://www.w3.org/1999/xlink"
> >      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> >     <MODIS_GPP_Latest_layer>
> >     <gml:name>Gross Primary Production</gml:name>
> >         <MODIS_GPP_Latest_feature>
> >         </MODIS_GPP_Latest_feature>
> >         <MODIS_GPP_Latest_feature>
> >         </MODIS_GPP_Latest_feature>
> >         <MODIS_GPP_Latest_feature>
> >         </MODIS_GPP_Latest_feature>
> >         <MODIS_GPP_Latest_feature>
> >         </MODIS_GPP_Latest_feature>
> >         <MODIS_GPP_Latest_feature>
> >         </MODIS_GPP_Latest_feature>
> >         <MODIS_GPP_Latest_feature>
> >         </MODIS_GPP_Latest_feature>
> >         <MODIS_GPP_Latest_feature>
> >         </MODIS_GPP_Latest_feature>
> >         <MODIS_GPP_Latest_feature>
> >         </MODIS_GPP_Latest_feature>
> >         <MODIS_GPP_Latest_feature>
> >         </MODIS_GPP_Latest_feature>
> >         <MODIS_GPP_Latest_feature>
> >         </MODIS_GPP_Latest_feature>
> >     </MODIS_GPP_Latest_layer>
> >     <CLASSIFICATION_layer>
> >     <gml:name>Classification</gml:name>
> >         <CLASSIFICATION_feature>
> >             <gml:boundedBy>
> >                 <gml:Box srsName="EPSG:900913">
> > <gml:coordinates>2303460.117760,4833416.360730
> > 2373331.753604,4888216.511498</gml:coordinates>
> >                 </gml:Box>
> >             </gml:boundedBy>
> >             <HABITAT>9530</HABITAT>
> >             <TYPOI_OIKO>(Ypo-)Mesogeiaka Peukodasi me endimika
> > mauropeuka</TYPOI_OIKO>
> >             <CLASSIFY>MAVROPEYKO</CLASSIFY>
> >             <AREA>554669629.609</AREA>
> >             <AT_ACRES>137061.850</AT_ACRES>
> >             <PERIMETER>1440445.923</PERIMETER>
> >             <CLASSID>2</CLASSID>
> >         </CLASSIFICATION_feature>
> >     </CLASSIFICATION_layer>
> > </msGMLOutput>
> >
> > On 10/19/2014 06:24 PM, Angelos Tzotsos wrote:
> >> Sorry, I forgot: MapServer version 6.4.1 from UbuntuGIS Unstable :)
> >>
> >> On 10/19/2014 05:44 PM, Angelos Tzotsos wrote:
> >>> Hi all,
> >>>
> >>> I am having trouble to disable GML output (for WMS GetFeatureInfo
> >>> request) for one of my layers.
> >>>
> >>> 83.212.100.7/cgi-
> bin/mapserv?map=/home/data/WMS/wms.map&LAYERS=MODIS
> >>>
> _GPP_Latest,CLASSIFICATION&QUERY_LAYERS=MODIS_GPP_Latest,CLASSIFICA
> T
> >>>
> ION&STYLES=,&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&BB
> OX=2
> >>>
> 316381.337124%2C4845849.841337%2C2351083.747961%2C4879902.537433&
> FEA
> >>>
> TURE_COUNT=10&HEIGHT=891&WIDTH=908&FORMAT=image%2Fpng&INFO_F
> ORMAT=ap
> >>> plication%2Fvnd.ogc.gml&SRS=EPSG%3A900913&X=391&Y=309
> >>>
> >>>
> >>> From the documentation it seems that DUMP OFF used to do that.
> >>> How do I replicate this feature on latest versions?
> >>>
> >>> My layer definition:
> >>>
> >>>  LAYER
> >>>   NAME MODIS_GPP_Latest
> >>>  PROJECTION
> >>>    "init=epsg:32634"
> >>>   END
> >>>   TYPE RASTER
> >>>   DUMP FALSE
> >>>   STATUS ON
> >>>   DATA ./latest_GPP.tif
> >>>   TEMPLATE ./template.html
> >>>   PROCESSING "SCALE=AUTO"
> >>>   OFFSITE 0 0 0
> >>>   METADATA
> >>>    "ows_title"    "Gross Primary Production"
> >>>    "ows_abstract"    "Latest Gross Primary Production"
> >>>    "ows_keywordlist"    "NASA,MODIS"
> >>>    "wms_opaque"    "0"
> >>>    "wms_metadataurl_format" "text/html"
> >>>    "wms_dataurl_format" "image/png"
> >>>    "ows_metadataurl_type" "FGDC"
> >>>    "ows_metadataurl_href" "http://modis.gsfc.nasa.gov/"
> >>>    "wms_dataurl_href" "ftp://e4ftl01.cr.usgs.gov"
> >>>   END
> >>>  END
> >>>
> >>> My MAP metadata:
> >>>
> >>>   METADATA
> >>>    "ows_schemas_location" "http://schemas.opengis.net"
> >>>    "ows_title" "MapServer for PindosGIS Project"
> >>>    "ows_abstract" "Latest MODIS imagery through OGC Web Services"
> >>>    "ows_keywordlist" "MapServer,MODIS,NASA"
> >>>    "ows_enable_request" "*"
> >>>    "ows_onlineresource"
> >>> "http://83.212.100.7/cgi-bin/mapserv?map=/home/data/WMS/wms.map"
> >>>    "ows_fees" "none"
> >>>    "ows_accessconstraints" "none"
> >>>    "ows_srs" "EPSG:32634 EPSG:4326 EPSG:900913 EPSG:3857 EPSG:102113
> >>> EPSG:2100"
> >>>    "wms_feature_info_mime_type"  "text/html"
> >>>    "wms_getmap_formatlist" "image/png,image/gif"
> >>>    END
> >>>
> >>> I have one vector layer and one raster layer and I want to disable
> >>> the raster layer result.
> >>> Unfortunately the layer cannot be removed from the request (I drill
> >>> down WMS GetFeatureInfo on my GeoExt application)
> >>>
> >>> Thanks,
> >>> Angelos
> >>>
> >>
> >>
> >
> >
> 
> 
> --
> Angelos Tzotsos
> Remote Sensing Laboratory
> National Technical University of Athens
> http://users.ntua.gr/tzotsos
> 
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-dev


More information about the mapserver-dev mailing list