Skip to content

Commit

Permalink
Backporting some WCS 2.0 GetCapbilities response adjustments (#4003).
Browse files Browse the repository at this point in the history
  • Loading branch information
Schpidi committed May 3, 2012
1 parent 9bc4a8e commit 85cee26
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 17 deletions.
2 changes: 2 additions & 0 deletions HISTORY.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ For a complete change history, please see the Git log comments.
Current Version (future 6.0.3, SVN branch-6-0):
-----------------------------------------------

- Adjusted WCS 2.0 GetCapbilities response (#4003)

- Ignore unknown requets parameteres in WCS 2.0 (#4307).

- Fixed mapscript is unusable in a web application due to memory leaks (#4262)
Expand Down
2 changes: 1 addition & 1 deletion mapowscommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ xmlNodePtr msOWSCommonOperationsMetadataDomainType(int version, xmlNsPtr psNsOws
if (version == OWS_1_0_0) {
msLibXml2GenerateList(psRootNode, psNsOws, "Value", values, ',');
}
if (version == OWS_1_1_0) {
if (version == OWS_1_1_0 || version == OWS_2_0_0) {
psNode = xmlNewChild(psRootNode, psNsOws, BAD_CAST "AllowedValues", NULL);
msLibXml2GenerateList(psNode, psNsOws, "Value", values, ',');
}
Expand Down
13 changes: 6 additions & 7 deletions mapwcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,15 +229,14 @@ typedef struct
typedef wcs20coverageMetadataObj * wcs20coverageMetadataObjPtr;

#define MS_WCS_20_PROFILE_CORE "http://www.opengis.net/spec/WCS/2.0/conf/core"
#define MS_WCS_20_PROFILE_KVP "http://www.opengis.net/spec/WCS_protocol-binding_get-kvp/1.0"
#define MS_WCS_20_PROFILE_POST "http://www.opengis.net/spec/WCS_protocol-binding_post-xml/1.0"
#define MS_WCS_20_PROFILE_GEOTIFF "http://www.opengis.net/spec/WCS_coverage-encoding_geotiff/1.0/"
#define MS_WCS_20_PROFILE_KVP "http://www.opengis.net/spec/WCS_protocol-binding_get-kvp/1.0/conf/get-kvp"
#define MS_WCS_20_PROFILE_POST "http://www.opengis.net/spec/WCS_protocol-binding_post-xml/1.0/conf/post-xml"
#define MS_WCS_20_PROFILE_GEOTIFF "http://www.opengis.net/spec/WCS_encoding_geotiff/1.0/conf/geotiff"
#define MS_WCS_20_PROFILE_GML_GEOTIFF "http://www.placeholder.com/GML_and_GeoTIFF"
#define MS_WCS_20_PROFILE_EPSG "http://www.placeholder.com/EPSG"
#define MS_WCS_20_PROFILE_CRS "http://www.opengis.net/spec/WCS_service-model_crs-predefined/1.0/conf/crs-predefined"
#define MS_WCS_20_PROFILE_IMAGECRS "http://www.placeholder.com/IMAGECRS"
#define MS_WCS_20_PROFILE_SCALING "http://www.placeholder.com/SCALING"
#define MS_WCS_20_PROFILE_INTERPOLATION "http://www.placeholder.com/INTERPOLATION"
#define MS_WCS_20_PROFILE_RANGESUBSET "http://www.placeholder.com/RANGESUBSET"
#define MS_WCS_20_PROFILE_SCALING "http://www.opengis.net/spec/WCS_service-model_scaling+interpolation/1.0/conf/scaling+interpolation"
#define MS_WCS_20_PROFILE_RANGESUBSET "http://www.opengis.net/spec/WCS_service-model_band-subsetting/1.0/conf/band-subsetting"

int msWCSDispatch20(mapObj *map, cgiRequestObj *request, owsRequestObj *ows_request);

Expand Down
26 changes: 17 additions & 9 deletions mapwcs20.c
Original file line number Diff line number Diff line change
Expand Up @@ -2863,12 +2863,11 @@ static int msWCSGetCapabilities20_CreateProfiles(
MS_WCS_20_PROFILE_CORE, NULL,
MS_WCS_20_PROFILE_KVP, NULL,
MS_WCS_20_PROFILE_POST, NULL,
MS_WCS_20_PROFILE_EPSG, NULL,
MS_WCS_20_PROFILE_CRS, NULL,
MS_WCS_20_PROFILE_IMAGECRS, NULL,
MS_WCS_20_PROFILE_GEOTIFF, "image/tiff",
MS_WCS_20_PROFILE_GML_GEOTIFF, NULL,
MS_WCS_20_PROFILE_SCALING, NULL,
MS_WCS_20_PROFILE_INTERPOLATION, NULL,
MS_WCS_20_PROFILE_RANGESUBSET, NULL,
NULL, NULL /* guardian */
};
Expand Down Expand Up @@ -2971,7 +2970,9 @@ int msWCSGetCapabilities20(mapObj *map, cgiRequestObj *req,
wcs20ParamsObjPtr params, owsRequestObj *ows_request)
{
xmlDocPtr psDoc = NULL; /* document pointer */
xmlNodePtr psRootNode, psOperationsNode, psServiceMetadataNode, psNode;
xmlNodePtr psRootNode,
psOperationsNode,
psNode;
const char *updatesequence = NULL;
xmlNsPtr psOwsNs = NULL,
psXLinkNs = NULL,
Expand Down Expand Up @@ -3005,8 +3006,6 @@ int msWCSGetCapabilities20(mapObj *map, cgiRequestObj *req,

xmlNewProp(psRootNode, BAD_CAST "version", BAD_CAST params->version );

/* TODO: remove updatesequence? */

updatesequence = msOWSLookupMetadata(&(map->web.metadata), "CO", "updatesequence");
if (params->updatesequence != NULL)
{
Expand Down Expand Up @@ -3069,6 +3068,10 @@ int msWCSGetCapabilities20(mapObj *map, cgiRequestObj *req,
psNode = msOWSCommonOperationsMetadataOperation(
psOwsNs, psXLinkNs,
"GetCapabilities", OWS_METHOD_GETPOST, script_url_encoded);

xmlAddChild(psNode->last->last->last,
msOWSCommonOperationsMetadataDomainType(OWS_2_0_0, psOwsNs, "Constraint",
"PostEncoding", "XML"));
xmlAddChild(psOperationsNode, psNode);

/* -------------------------------------------------------------------- */
Expand All @@ -3079,6 +3082,9 @@ int msWCSGetCapabilities20(mapObj *map, cgiRequestObj *req,
psNode = msOWSCommonOperationsMetadataOperation(
psOwsNs, psXLinkNs,
"DescribeCoverage", OWS_METHOD_GETPOST, script_url_encoded);
xmlAddChild(psNode->last->last->last,
msOWSCommonOperationsMetadataDomainType(OWS_2_0_0, psOwsNs, "Constraint",
"PostEncoding", "XML"));
xmlAddChild(psOperationsNode, psNode);
}

Expand All @@ -3090,18 +3096,20 @@ int msWCSGetCapabilities20(mapObj *map, cgiRequestObj *req,
psNode = msOWSCommonOperationsMetadataOperation(
psOwsNs, psXLinkNs,
"GetCoverage", OWS_METHOD_GETPOST, script_url_encoded);
xmlAddChild(psOperationsNode, psNode);

msFree(script_url_encoded);
xmlAddChild(psNode->last->last->last,
msOWSCommonOperationsMetadataDomainType(OWS_2_0_0, psOwsNs, "Constraint",
"PostEncoding", "XML"));
xmlAddChild(psOperationsNode, psNode);
}
msFree(script_url_encoded);
}

/* -------------------------------------------------------------------- */
/* Service metadata. */
/* -------------------------------------------------------------------- */
/* it is mandatory, but unused for now */
psServiceMetadataNode = xmlAddChild(psRootNode, xmlNewNode(psWcsNs, BAD_CAST "ServiceMetadata"));
xmlNewProp(psServiceMetadataNode, BAD_CAST "version", BAD_CAST "1.0.0");
xmlAddChild(psRootNode, xmlNewNode(psWcsNs, BAD_CAST "ServiceMetadata"));

/* -------------------------------------------------------------------- */
/* Contents section. */
Expand Down

0 comments on commit 85cee26

Please sign in to comment.