[mapserver-commits] r7413 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Wed Feb 27 15:09:34 EST 2008
Author: tomkralidis
Date: 2008-02-27 15:09:34 -0500 (Wed, 27 Feb 2008)
New Revision: 7413
Modified:
trunk/mapserver/mapogcsos.c
Log:
fix various SOS CITE issues (#2467)
Modified: trunk/mapserver/mapogcsos.c
===================================================================
--- trunk/mapserver/mapogcsos.c 2008-02-27 18:37:08 UTC (rev 7412)
+++ trunk/mapserver/mapogcsos.c 2008-02-27 20:09:34 UTC (rev 7413)
@@ -1827,6 +1827,11 @@
return msSOSException(map, "responseformat", "InvalidParameterValue");
}
+ if (sosparams->pszResponseMode && strcasecmp(sosparams->pszResponseMode, "inline") != 0) {
+ msSetError(MS_SOSERR, "Invalid RESPONSEMODE parameter %s. Allowable values are: \"inline\"", "msSOSGetObservation()", sosparams->pszResponseMode);
+ return msSOSException(map, "responsemode", "InvalidParameterValue");
+ }
+
/*validate if offering exists*/
for (i=0; i<map->numlayers; i++) {
pszTmp = msOWSLookupMetadata(&(GET_LAYER(map, i)->metadata), "S", "offering_id");
@@ -2426,11 +2431,6 @@
int status;
char *tmpstr = NULL, *pszTmp = NULL;
- if (!sosparams->pszSensorId) {
- msSetError(MS_SOSERR, "Missing mandatory parameter sensorid", "msSOSDescribeSensor()");
- return msSOSException(map, "sensorid", "MissingParameterValue");
- }
-
if (!sosparams->pszOutputFormat) {
msSetError(MS_SOSERR, "Missing mandatory parameter outputFormat.", "msSOSDescribeSensor()");
return msSOSException(map, "outputformat", "MissingParameterValue");
@@ -2440,7 +2440,12 @@
msSetError(MS_SOSERR, "Invalid outputformat parameter %s. Allowable values are: %s", "msSOSDescribeSensor()", sosparams->pszOutputFormat, pszSOSDescribeSensorMimeType);
return msSOSException(map, "outputformat", "InvalidParameterValue");
}
-
+
+ if (!sosparams->pszSensorId) {
+ msSetError(MS_SOSERR, "Missing mandatory parameter sensorid", "msSOSDescribeSensor()");
+ return msSOSException(map, "sensorid", "MissingParameterValue");
+ }
+
for (i=0; i<map->numlayers; i++) {
lp = GET_LAYER(map, i);
pszId = msOWSLookupMetadata(&(lp->metadata), "S", "procedure");
@@ -2808,6 +2813,16 @@
xmlXPathFreeObject(psXPathTmp);
+ /* check for responseMode */
+ psXPathTmp = msLibXml2GetXPath(doc, context, (xmlChar *)"/sos:GetObservation/sos:responseMode");
+
+ if (psXPathTmp) {
+ nodeset = psXPathTmp->nodesetval;
+ sosparams->pszResponseMode = (char *)xmlNodeListGetString(doc, nodeset->nodeTab[0]->xmlChildrenNode, 1);
+ }
+
+ xmlXPathFreeObject(psXPathTmp);
+
/* check for srsName */
psXPathTmp = msLibXml2GetXPath(doc, context, (xmlChar *)"/sos:GetObservation/@srsName");
More information about the mapserver-commits
mailing list