[mapserver-commits] r11833 - in sandbox/inspire_soc2011: mapserver
msautotest/wxs
svn at osgeo.org
svn at osgeo.org
Sat Jun 18 12:26:12 EDT 2011
Author: stefanl
Date: 2011-06-18 09:26:12 -0700 (Sat, 18 Jun 2011)
New Revision: 11833
Modified:
sandbox/inspire_soc2011/mapserver/mapows.c
sandbox/inspire_soc2011/mapserver/mapwms.c
sandbox/inspire_soc2011/msautotest/wxs/wms_inspire_scenario1.map
sandbox/inspire_soc2011/msautotest/wxs/wms_inspire_scenario2.map
Log:
inspire view service metadata support (scenario1+2)
Modified: sandbox/inspire_soc2011/mapserver/mapows.c
===================================================================
--- sandbox/inspire_soc2011/mapserver/mapows.c 2011-06-17 19:06:58 UTC (rev 11832)
+++ sandbox/inspire_soc2011/mapserver/mapows.c 2011-06-18 16:26:12 UTC (rev 11833)
@@ -477,18 +477,21 @@
const char *namespaces, const char *name, const char* validated_language)
{
const char *value = NULL;
- char * name2=NULL;
+ char *name2 = NULL;
size_t bufferSize = 0;
- bufferSize = strlen(name)+(validated_language ? strlen(validated_language) : 0)+2;
- name2 = (char *) msSmallMalloc( bufferSize );
-
- if ( validated_language && name2 )
+ if ( name && validated_language )
+ {
+ bufferSize = strlen(name)+strlen(validated_language)+2;
+ name2 = (char *) msSmallMalloc( bufferSize );
snprintf(name2, bufferSize, "%s_%s", name, validated_language);
- else
- snprintf(name2, bufferSize, "%s", name);
+ value = msOWSLookupMetadata(metadata, namespaces, name2);
+ }
- value = msOWSLookupMetadata(metadata, namespaces, name2);
+ if (value == NULL)
+ {
+ value = msOWSLookupMetadata(metadata, namespaces, name);
+ }
msFree( name2 );
@@ -1516,6 +1519,9 @@
/* msOWSPrintMetadataList()
**
** Prints comma-separated lists metadata. (e.g. keywordList)
+** default_value serves 2 purposes if specified:
+** - won't be printed if part of MetadataList (exclusion)
+** - will be printed if MetadataList is empty (fallback)
**/
int msOWSPrintMetadataList(FILE *stream, hashTableObj *metadata,
const char *namespaces, const char *name,
@@ -1524,9 +1530,17 @@
const char *default_value)
{
const char *value;
- if((value = msOWSLookupMetadata(metadata, namespaces, name)) ||
- (value = default_value) != NULL )
+
+ value = msOWSLookupMetadata(metadata, namespaces, name);
+
+ if(value == NULL)
{
+ value = default_value;
+ default_value = NULL;
+ }
+
+ if(value != NULL)
+ {
char **keywords;
int numkeywords;
@@ -1535,7 +1549,13 @@
int kw;
if(startTag) msIO_fprintf(stream, "%s", startTag);
for(kw=0; kw<numkeywords; kw++)
+ {
+ if (default_value != NULL
+ && strcasecmp(keywords[kw],default_value) == 0)
+ continue;
+
msIO_fprintf(stream, itemFormat, keywords[kw]);
+ }
if(endTag) msIO_fprintf(stream, "%s", endTag);
msFreeCharArray(keywords, numkeywords);
}
@@ -1579,15 +1599,15 @@
int kw;
if(startTag) msIO_fprintf(stream, "%s", startTag);
for(kw=0; kw<numkeywords; kw++)
- {
- if (default_value != NULL
- && strcasecmp(keywords[kw],default_value) == 0)
- continue;
+ {
+ if (default_value != NULL
+ && strcasecmp(keywords[kw],default_value) == 0)
+ continue;
- encoded = msEncodeHTMLEntities(keywords[kw]);
- msIO_fprintf(stream, itemFormat, encoded);
- msFree(encoded);
- }
+ encoded = msEncodeHTMLEntities(keywords[kw]);
+ msIO_fprintf(stream, itemFormat, encoded);
+ msFree(encoded);
+ }
if(endTag) msIO_fprintf(stream, "%s", endTag);
msFreeCharArray(keywords, numkeywords);
}
Modified: sandbox/inspire_soc2011/mapserver/mapwms.c
===================================================================
--- sandbox/inspire_soc2011/mapserver/mapwms.c 2011-06-17 19:06:58 UTC (rev 11832)
+++ sandbox/inspire_soc2011/mapserver/mapwms.c 2011-06-18 16:26:12 UTC (rev 11833)
@@ -1455,6 +1455,10 @@
" </Keywords>\n",
"%s ", NULL);
}
+ else if (nVersion >= OWS_1_3_0 && msOWSLookupMetadata(&(map->web.metadata), "MO", "inspire_capabilities") )
+ {
+ msOWSPrintEncodeMetadata(stdout, &(lp->metadata), "MO", "inspire_keyword", OWS_WARN, " <KeywordList> <Keyword vocabulary='ISO'>%s</Keyword>\n</KeywordList>\n", "");
+ }
else
{
/* <KeywordList><Keyword> ... in V1.0.6+ */
@@ -2186,6 +2190,10 @@
" </Keywords>\n",
"%s ", NULL);
}
+ else if (nVersion >= OWS_1_3_0 && msOWSLookupMetadata(&(map->web.metadata), "MO", "inspire_capabilities") )
+ {
+ msOWSPrintEncodeMetadata(stdout, &(map->web.metadata), "MO", "inspire_keyword", OWS_WARN, " <KeywordList> <Keyword vocabulary='ISO'>%s</Keyword>\n</KeywordList>\n", "");
+ }
else
{
/* <KeywordList><Keyword> ... in V1.0.6+ */
@@ -2471,10 +2479,20 @@
msOWSPrintEncodeMetadata2(stdout, &(map->web.metadata), "MO", "abstract", OWS_NOERR, " <Abstract>%s</Abstract>\n", map->name, validated_language);
- if (msOWSLookupMetadata(&(map->web.metadata), "MO", "rootlayer_keywordlist"))
- pszTmp = msStrdup("rootlayer_keywordlist");
- else
- pszTmp = msStrdup("keywordlist");
+ if (nVersion >= OWS_1_3_0 && msOWSLookupMetadata(&(map->web.metadata), "MO", "inspire_capabilities") )
+ {
+ if (msOWSLookupMetadata(&(map->web.metadata), "MO", "inspire_rootlayer_keyword"))
+ pszTmp = msStrdup("inspire_rootlayer_keyword");
+ else
+ pszTmp = msStrdup("inspire_keyword");
+ }
+ else
+ {
+ if (msOWSLookupMetadata(&(map->web.metadata), "MO", "rootlayer_keywordlist"))
+ pszTmp = msStrdup("rootlayer_keywordlist");
+ else
+ pszTmp = msStrdup("keywordlist");
+ }
if (nVersion == OWS_1_0_0)
{
@@ -2486,6 +2504,10 @@
" </Keywords>\n",
"%s ", NULL);
}
+ else if (nVersion >= OWS_1_3_0 && msOWSLookupMetadata(&(map->web.metadata), "MO", "inspire_capabilities") )
+ {
+ msOWSPrintEncodeMetadata(stdout, &(map->web.metadata), "MO", pszTmp, OWS_WARN, " <KeywordList> <Keyword vocabulary='ISO'>%s</Keyword>\n</KeywordList>\n", "");
+ }
else
{
/* <KeywordList><Keyword> ... in V1.0.6+ */
@@ -2551,7 +2573,15 @@
else
msWMSPrintScaleDenominator(" ", map->web.minscaledenom, map->web.maxscaledenom);
+ if (nVersion >= OWS_1_3_0 && msOWSLookupMetadata(&(map->web.metadata), "MO", "inspire_capabilities") )
+ {
+ msIO_fprintf(stdout, " <Style>\n");
+ msIO_fprintf(stdout, " <Name>inspire_common:DEFAULT</Name>\n");
+ msIO_fprintf(stdout, " <Title>inspire_common:DEFAULT</Title>\n");
+ msIO_fprintf(stream, " </Style>\n");
+ }
+
/* */
/* Dump list of layers organized by groups. Layers with no group are listed */
/* individually, at the same level as the groups in the layer hierarchy */
Modified: sandbox/inspire_soc2011/msautotest/wxs/wms_inspire_scenario1.map
===================================================================
--- sandbox/inspire_soc2011/msautotest/wxs/wms_inspire_scenario1.map 2011-06-17 19:06:58 UTC (rev 11832)
+++ sandbox/inspire_soc2011/msautotest/wxs/wms_inspire_scenario1.map 2011-06-18 16:26:12 UTC (rev 11833)
@@ -13,12 +13,10 @@
NAME TN.RoadTransportNetwork.RoadArea
STATUS ON
-SIZE 400 300
-#EXTENT 2018000 -73300 3410396 647400
-#UNITS METERS
-EXTENT -67.5725 42 -58.9275 48.5
+SIZE 200 200
+EXTENT 40 -70 50 -60
UNITS DD
-IMAGECOLOR 255 255 255
+IMAGECOLOR 200 200 200
SHAPEPATH ./data
SYMBOLSET etc/symbols.sym
FONTSET etc/fonts.txt
@@ -53,7 +51,6 @@
"ows_updatesequence" "myupdatesequence"
"wms_srs" "EPSG:42304 EPSG:42101 EPSG:4269 EPSG:4326"
"ows_schemas_location" "http://schemas.opengis.net"
- "ows_keywordlist" "mykeyword1,mykeyword2"
"ows_service_onlineresource" "http://www.mapserver.org/"
"ows_fees" "conditions unknown" #value either "no conditions apply"|default "conditions unknown"|<specific conditions>
"ows_accessconstraints" "None" #value according ISO 19115 (MD_RestrictionCode codelist) or default "None"
@@ -69,18 +66,15 @@
"ows_contactperson" "mycontactperson"
"ows_contactorganization" "MapServer" #responsible organisation
"ows_contactposition" "owner" #responsible organisation, value according "INSPIRE Metadata Regulation" (part D6)
- "ows_rootlayer_title" "myrootlayertitle"
"ows_rootlayer_abstract" "myrootlayerabstract" #to test fallback
- "ows_rootlayer_abstract_ger" "myrootlayerabstract"
- "ows_rootlayer_keywordlist" "myrootlayerkeyword1,myrootlayerkeyword2"
- "ows_layerlimit" "1"
+ "ows_rootlayer_abstract_ger" "myrootlayerabstractger"
+ "ows_inspire_rootlayer_keyword" "infoFeatureAccessService" #value according "classification of spatial data services"
"ows_enable_request" "*"
"wms_getmap_formatlist" "image/png,image/png; mode=24bit,image/jpeg,image/gif,image/png; mode=8bit,image/tiff"
END
END
PROJECTION
- #"init=epsg:4326"
"init=/home/leopolds/MapServer_SoC_2011/msautotest/wxs/data/epsg2:42304"
END
@@ -95,26 +89,34 @@
METADATA
"wms_title_eng" "Transport networks: Road Link"
"wms_title_ger" "Verkehrsnetze: Straßensegment"
- "wms_abstract" "myabstract" #to test fallback
- "wms_abstract_ger" "myabstractger"
- "wms_srs" "EPSG:43204"
- "gml_include_items" "all"
+ "wms_abstract" "mylayerabstract" #to test fallback
+ "wms_abstract_ger" "mylayerabstractger"
+ "wms_inspire_keyword" "infoManagementService" #value according "classification of spatial data services"
END
TYPE LINE
STATUS ON
PROJECTION
- #"init=epsg:4326"
"init=/home/leopolds/MapServer_SoC_2011/msautotest/wxs/data/epsg2:42304"
END
DUMP TRUE
- CLASSITEM "Name_e"
+ CLASSGROUP "inspire_common:DEFAULT"
+ CLASSITEM "NAME_E"
+
CLASS
- NAME "Roads"
- SYMBOL 0
- COLOR 220 0 0
+ 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
+
END # Layer
END # Map File
Modified: sandbox/inspire_soc2011/msautotest/wxs/wms_inspire_scenario2.map
===================================================================
--- sandbox/inspire_soc2011/msautotest/wxs/wms_inspire_scenario2.map 2011-06-17 19:06:58 UTC (rev 11832)
+++ sandbox/inspire_soc2011/msautotest/wxs/wms_inspire_scenario2.map 2011-06-18 16:26:12 UTC (rev 11833)
@@ -13,12 +13,10 @@
NAME TN.RoadTransportNetwork.RoadArea
STATUS ON
-SIZE 400 300
-#EXTENT 2018000 -73300 3410396 647400
-#UNITS METERS
-EXTENT -67.5725 42 -58.9275 48.5
+SIZE 200 200
+EXTENT 40 -70 50 -60
UNITS DD
-IMAGECOLOR 255 255 255
+IMAGECOLOR 200 200 200
SHAPEPATH ./data
SYMBOLSET etc/symbols.sym
FONTSET etc/fonts.txt
@@ -56,7 +54,6 @@
"ows_updatesequence" "myupdatesequence"
"wms_srs" "EPSG:42304 EPSG:42101 EPSG:4269 EPSG:4326"
"ows_schemas_location" "http://schemas.opengis.net"
- "ows_keywordlist" "mykeyword1,mykeyword2"
"ows_service_onlineresource" "http://www.mapserver.org/"
"ows_fees" "conditions unknown" #value either "no conditions apply"|default "conditions unknown"|<specific conditions>
"ows_accessconstraints" "None" #value according ISO 19115 (MD_RestrictionCode codelist) or default "None"
@@ -72,18 +69,15 @@
"ows_contactperson" "mycontactperson"
"ows_contactorganization" "MapServer" #responsible organisation
"ows_contactposition" "owner" #responsible organisation, value according "INSPIRE Metadata Regulation" (part D6)
- "ows_rootlayer_title" "myrootlayertitle"
"ows_rootlayer_abstract" "myrootlayerabstract" #to test fallback
- "ows_rootlayer_abstract_ger" "myrootlayerabstract"
- "ows_rootlayer_keywordlist" "myrootlayerkeyword1,myrootlayerkeyword2"
- "ows_layerlimit" "1"
+ "ows_rootlayer_abstract_ger" "myrootlayerabstractger"
+ "ows_inspire_rootlayer_keyword" "infoFeatureAccessService" #value according "classification of spatial data services"
"ows_enable_request" "*"
"wms_getmap_formatlist" "image/png,image/png; mode=24bit,image/jpeg,image/gif,image/png; mode=8bit,image/tiff"
END
END
PROJECTION
- #"init=epsg:4326"
"init=/home/leopolds/MapServer_SoC_2011/msautotest/wxs/data/epsg2:42304"
END
@@ -98,26 +92,34 @@
METADATA
"wms_title_eng" "Transport networks: Road Link"
"wms_title_ger" "Verkehrsnetze: Straßensegment"
- "wms_abstract" "myabstract" #to test fallback
- "wms_abstract_ger" "myabstractger"
- "wms_srs" "EPSG:43204"
- "gml_include_items" "all"
+ "wms_abstract" "mylayerabstract" #to test fallback
+ "wms_abstract_ger" "mylayerabstractger"
+ "wms_inspire_keyword" "infoManagementService" #value according "classification of spatial data services"
END
TYPE LINE
STATUS ON
PROJECTION
- #"init=epsg:4326"
"init=/home/leopolds/MapServer_SoC_2011/msautotest/wxs/data/epsg2:42304"
END
DUMP TRUE
- CLASSITEM "Name_e"
+ CLASSGROUP "inspire_common:DEFAULT"
+ CLASSITEM "NAME_E"
+
CLASS
- NAME "Roads"
- SYMBOL 0
- COLOR 220 0 0
+ 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
+
END # Layer
END # Map File
More information about the mapserver-commits
mailing list