Home | Docs | Issue Tracker | FAQ | Download | |
Date: | 2011/07/01 |
---|---|
Author: | Stefan Leopold (stefan.leopold at reflex.at) |
Author: | Stephan Meissl (stephan.meissl at eox.at) |
Last Edited: | 2012/03/09 |
Status: | Adopted on 2012/03/08 |
Version: | MapServer 6.2 |
Id: | $Id$ |
In order to achieve INSPIRE view service compliance, several enhancements need to be implemented in MapServer to support the specification :
This RFC aggregates and extends the already provided ideas/solutions regarding INSPIRE view service support.
INSPIRE specific metadata can either be referenced in an external INSPIRE service metadata document (scenario 1) or can be directly embedded in the capabilities document (scenario 2). MapServer needs to support both scenarios.
As suggested in Ticket 3608, activation of the corresponding scenario for INSPIRE support takes place in the WEB.METADATA section of the mapfile through “wms_inspire_capabilities”. If activated, the corresponding INSPIRE namespace as well as appropriate validation warnings are generated in the capabilities document.
Scenario 1 - activate INSPIRE support using a reference to external service metadata
WEB
METADATA
"wms_inspire_capabilities" "url"
...
END
END
Scenario 2 - activate INSPIRE support using embedded service metadata
WEB
METADATA
"wms_inspire_capabilities" "embed"
...
END
END
INSPIRE requires multi-language support and requests a list of all supported languages as well as the default language in the capabilities document. Based on the language parameter in the GetCapabilites request, certain specific metadata values, namely
- “wms_title”
- “wms_abstract”
- “wms_rootlayer_title”
- “wms_rootlayer_abstract”
- “wms_group_title”
- “wms_group_abstract”
- “wms_style_title”
- “wms_style_<name>_title”
need to be provided in the requested language. If the language is not supported (or no language parameter is present), the default language has to be used.
As suggested in Ticket 3608, all supported languages are specified as comma separated list (first language is default) through “wms_languages” in the WEB.METADATA section of the mapfile. This language parameter is also added to the onlineresource in the GetCapabilites output.
WEB
METADATA
...
"wms_languages" "eng,ger" #first default, values according ISO 639-2/B
...
END
END
To address the second issue, different options regarding implementation were evaluated.
For language specific metadata values, a key extension method is applied.
WEB
METADATA
...
"wms_title.eng" "myservicetitle"
"wms_title.ger" "myservicetitleger"
"wms_abstract" "mylayerabstract" #fallback
"wms_abstract.ger" "mylayerabstractger"
...
END
END
For language dependent reference data, a similar approach like the runtime-substitution feature of MapServer has been followed (only DATA and CONNECTION values with %language% are substituted).
...
LAYER
NAME TN.RoadTransportNetwork.RoadLink
DATA "road_%language%"
...
END
...
If the language is not supported (or no language parameter is present), the default language is substituted.
Depending on the scenario, additional metadata information is required to support the specification. The INSPIRE related fields are provided below:
Scenario 1 - INSPIRE related fields using referenced external service metadata
WEB
METADATA
"wms_inspire_capabilities" "url"
"wms_languages" "eng,ger" #first default, values according ISO 639-2/B
"wms_inspire_metadataurl_href" "http://INSPIRE.service/metadata"
"wms_inspire_metadataurl_format" "application/vnd.ogc.csw.capabilities.response_xml"
"wms_keywordlist_ISO_items" "infoMapAccessService" #value according "classification of spatial data services"
"wms_keywordlist_vocabulary" "ISO"
"wms_title" "myservicetitle"
"wms_abstract" "myabstract"
"wms_fees" "conditions unknown" #value either "no conditions apply"|default "conditions unknown"|<specific conditions>
"wms_accessconstraints" "None" #value according ISO 19115 (MD_RestrictionCode codelist) or default "None"
"wms_contactorganization" "MapServer" #responsible organization
"wms_contactposition" "owner" #responsible organization, value according "INSPIRE Metadata Regulation" (part D6)
...
END
END
Scenario 2 - INSPIRE related fields using embedded service metadata
WEB
METADATA
"wms_inspire_capabilities" "embed"
"wms_languages" "eng,ger" #first default, values according ISO 639-2/B
"wms_inspire_temporal_reference" "2011-09-19" #date of last revision, value according YYYY-MM-DD
"wms_inspire_mpoc_name" "mympocname" #point of contact
"wms_inspire_mpoc_email" "mympoc@e.mail" #point of contact
"wms_inspire_metadatadate" "2011-09-19" #value according YYYY-MM-DD
"wms_inspire_resourcelocator" "http://myinspireresource" #URL for ResourceLocator
"wms_inspire_keyword" "infoMapAccessService" #value according "classification of spatial data services"
"wms_keywordlist_ISO_items" "infoMapAccessService"
"wms_keywordlist_vocabulary" "ISO"
"wms_title" "myservicetitle"
"wms_abstract" "myabstract"
"wms_fees" "conditions unknown" #value either "no conditions apply"|default "conditions unknown"|<specific conditions>
"wms_accessconstraints" "None" #value according ISO 19115 (MD_RestrictionCode codelist) or default "None"
"wms_contactorganization" "MapServer" #responsible organization
"wms_contactposition" "owner" #responsible organization, value according "INSPIRE Metadata Regulation" (part D6)
...
END
END
Notes:
INSPIRE mandates usage of named group layers. Thus the functionality of wms_layer_group is extended to support named group layers. If a layer with the same name as used in wms_layer_group is found it is treated as named group if no layer with this name is found as unnamed group as before.
To provide this functionality the variable isUsedInNestedGroup is introduced in methods msWMSPrepareNestedGroups() and msWMSPrintNestedGroups() which is used in the various methods to prepare WMS responses e.g. msWMSGetCapabilities().
Provided that ability, a hierarchy of any level can be achieved. See the “wms_inspire.map” mapfile in msautotest for an example.
TN
+--- TN.CommonTransportElements
+--- TN.CommonTransportElements.TransportArea
+--- TN.CommonTransportElements.TransportLink
+--- TN.CommonTransportElements.TransportNode
+--- TN.RoadTransportNetwork
+--- TN.RoadTransportNetwork
+--- TN.RoadTransportNetwork.VehicleTrafficArea
+--- TN.RoadTransportNetwork.RoadServiceArea
+--- TN.RoadTransportNetwork.RoadArea
+--- TN.RailTransportNetwork
+--- TN.RailTransportNetwork.RailwayLink
+--- TN.RailTransportNetwork.RailwayStationArea
+--- TN.RailTransportNetwork.RailwayYardArea
+--- TN.RailTransportNetwork.RailwayArea
For regular layers, the concept of GROUP and CLASSGROUP can be used to set the layer style name to the according value. Additionally - as suggested in Ticket 3850 - the layer style titles can be overwritten through wms_style_<stylename>_title and the layer style legendURLs through wms_style_<stylename>_legendurl_* (width, height, format and href need to be provided).
...
LAYER
NAME TN.RoadTransportNetwork.RoadLink
DATA "road"
METADATA
"wms_title.eng" "Transport networks: Road Link"
"wms_title.ger" "Verkehrsnetze: Strassensegment"
...
"wms_style_inspire_common:DEFAULT_title" "mylayerstyletitle" #style title
"wms_style_inspire_common:DEFAULT_legendurl_width" "85" #override style legendurl (mandatory: width, height, format, href)
"wms_style_inspire_common:DEFAULT_legendurl_height" "40"
"wms_style_inspire_common:DEFAULT_legendurl_format" "image/png"
"wms_style_inspire_common:DEFAULT_legendurl_href" "http://path/to/onlineresource...roadlink"
END
...
END
...
CLASSGROUP "inspire_common:DEFAULT"
CLASSITEM "NAME_E"
CLASS
NAME "myclass1"
GROUP "inspire_common:DEFAULT"
EXPRESSION "Trans-Canada Highway"
COLOR 255 0 0
END
CLASS
NAME "myclass2"
GROUP "inspire_common:DEFAULT"
COLOR 0 255 0
END
...
The following method is suggested to support (customizable) style sections in the root layer
and possibly existing group layers
...
WEB
METADATA
...
"wms_style_name" "inspire_common:DEFAULT" #style name
"wms_style_title" "myroadarealayerstyletitle" #style title
"wms_style_legendurl_width" "85" #override style legendurl (mandatory: width, height, format, href)
"wms_style_legendurl_height" "40"
"wms_style_legendurl_format" "image/png"
"wms_style_legendurl_href" "http://path/to/onlineresource...roadarea"
END
END
LAYER
NAME TN.RailTransportNetwork.RailwayLink
GROUP TN.CommonTransportElements.TransportLink
DATA "road"
METADATA
"wms_group_title.eng" "Transport networks: Generic Transport Link"
"wms_group_title.ger" "Verkehrsnetze: Generisches Verkehrssegment"
"wms_group_abstract" "mygenerictransportlinklayerabstract" #fallback
"wms_group_abstract.ger" "mygenerictransportlinklayerabstract"
"wms_group_style_name" "inspire_common:DEFAULT" #style name
"wms_group_style_title" "mygenerictransportlinklayerstyletitle" #style title
"wms_group_style_legendurl_width" "85" #override style legendurl (mandatory: width, height, format, href)
"wms_group_style_legendurl_height" "40"
"wms_group_style_legendurl_format" "image/png"
"wms_group_style_legendurl_href" "http://path/to/onlineresource...generictransportlink"
"wms_title.eng" "Transport networks: Railway Link"
"wms_title.ger" "Verkehrsnetze: Eisenbahnverbindung"
"wms_abstract" "myrailwaylinklayerabstract" #fallback
"wms_abstract.ger" "myrailwaylinklayerabstractger"
...
END
...
END
...
Provided that ability, 3 levels of hierarchy can be achieved as done in the example mapfiles “wms_inspire_scneario1.map” and “wms_inspire_scneario2.map” in msautotest.
TN.RoadTransportNetwork.RoadArea
+--- TN.RoadTransportNetwork.RoadLink
+--- TN.CommonTransportElements.TransportLink
+--- TN.RailTransportNetwork.RailwayLink
+--- TN.AirTransportNetwork.AirLink
In order to implement these enhancements, the following changes need to be implemented in the MapServer codebase:
The following files are affected by this RFC:
mapows.c/mapows.h
[N] MS_DLL_EXPORT const char *msOWSLookupMetadataWithLanguage(.., const char *validated_language)
[N] MS_DLL_EXPORT char *msOWSGetOnlineResource2(.., const char *validated_language)
[N] MS_DLL_EXPORT char **msOWSGetInspireLanguageList(..)
[N] MS_DLL_EXPORT char *msOWSGetInspireLanguage(.., const char *requested_language)
[N] MS_DLL_EXPORT int msOWSPrintInspireCommonExtendedCapabilities(..)
[N] int msOWSPrintInspireCommonMetadata(..)
[N] int msOWSPrintInspireCommonLanguages(..)
[C] int msOWSPrintEncodeMetadata(..)
[N] int msOWSPrintEncodeMetadata2(.., const char *validated_language)
[C] int msOWSPrintGroupMetadata(..)
[N] int msOWSPrintGroupMetadata2(.., const char *validated_language)
[C] int msOWSPrintMetadataList(..)
[C] int msOWSPrintEncodeMetadataList(..)
mapwms.c
[S] int msDumpLayer(.., const char *validated_language, int grouplayer)
[S] void msWMSPrepareNestedGroups(.., int* isUsedInNestedGroup)
[S] void msWMSPrintNestedGroups(.., int* isUsedInNestedGroup, const char *validated_language)
[S] int msWMSGetCapabilities(.., const char *requested_language)
[C] int msWMSLoadGetMapParams(..)
[C] int msWMSFeatureInfo(..)
[C] int msWMSDescribeLayer(..)
[C] int msWMSGetLegendGraphic(..)
[C] int msWMSGetStyles(..)
[C] int msWMSDispatch(..)
[N] void msWMSPrintAuthorityURL(..)
[N] void msWMSPrintIdentifier(..)
[N] void msWMSPrintKeywordlist(..)
mapdraw.c
[C] int msLayerIsVisible(..)
maputil.c
[C] int msExtentsOverlap(..)
This changes provide new functionality with no MapScript issues being considered.
This change provides new functionality with no backwards compatibility issues being considered.
The code for this RFC can be found in the inspire_soc2011 sandbox.
The GetCapabilites responses with these mapfiles validate against the INSPIRE schemas as well as the WMS INSPIRE tester without any critical warnings or errors.
Adopted on 2012/03/08 with +1 from FrankW, SteveL, and DanielM and +0 from SteveW.