mapows.h 24.2 KB
Newer Older
1
/*****************************************************************************
2
 * $Id$
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
 *
 * Project:  MapServer
 * Purpose:  OGC Web Services (WMS, WFS, WCS) support function definitions
 * Author:   Daniel Morissette, DM Solutions Group (morissette@dmsolutions.ca)
 *
 ******************************************************************************
 * Copyright (c) 1996-2005 Regents of the University of Minnesota.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
18
 * The above copyright notice and this permission notice shall be included in
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
 * all copies of this Software or works derived from this Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 ****************************************************************************/


#ifndef MAPOWS_H
#define MAPOWS_H

34
#include "maphttp.h"
35 36
#include <time.h>

37 38
/* This is the URL to the official OGC Schema Repository. We use it by
 * default for OGC services unless the ows_schemas_lcoation web metadata
39 40 41 42
 * is set in the mapfile.
 */
#define OWS_DEFAULT_SCHEMAS_LOCATION   "http://schemas.opengis.net"

43 44 45 46 47 48 49 50 51
#if defined USE_LIBXML2 && defined USE_WFS_SVR
#include<libxml/tree.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif


52
/*====================================================================
53
 *   mapows.c
54 55
 *====================================================================*/

56
typedef struct {
57 58 59 60 61 62
  char *pszVersion;
  char *pszUpdateSequence;
  char *pszRequest;
  char *pszService;
  char *pszTypeName;
  char *pszFilter;
63
  char *pszFilterLanguage;
64
  char *pszGeometryName;
65 66
  int nMaxFeatures;
  char *pszBbox; /* only used with a Get Request */
67
  char *pszOutputFormat;
68 69 70 71
  char *pszFeatureId;
  char *pszSrs;
  char *pszResultType;
  char *pszPropertyName;
72 73
  int nStartIndex;
  char *pszAcceptVersions;
74 75 76 77 78 79 80
  char *pszSections;
  char *pszSortBy; /* Not implemented yet */
  char *pszLanguage; /* Inspire extension */
  char *pszValueReference; /* For GetValueReference */
  char *pszStoredQueryId; /* For DescribeStoredQueries */
  int   countGetFeatureById; /* Number of urn:ogc:def:query:OGC-WFS::GetFeatureById GetFeature requests */
  int   bHasPostStoredQuery; /* TRUE if a XML GetFeature StoredQuery is present */
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
} wfsParamsObj;

/*
 * sosParamsObj
 * Used to preprocess SOS request parameters
 *
 */

typedef struct {
  char *pszVersion;
  char *pszAcceptVersions;
  char *pszUpdateSequence;
  char *pszRequest;
  char *pszService;
  char *pszOutputFormat;
  char *pszSensorId;
  char *pszProcedure;
98
  char *pszOffering;
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
  char *pszObservedProperty;
  char *pszEventTime;
  char *pszResult;
  char *pszResponseFormat;
  char *pszResultModel;
  char *pszResponseMode;
  char *pszBBox;
  char *pszFeatureOfInterest;
  char *pszSrsName;
} sosParamsObj;

/* wmsParamsObj
 *
 * Used to preprocess WMS request parameters and combine layers that can
 * be comined in a GetMap request.
 */
115
typedef  struct {
116 117 118 119 120 121
  char        *onlineresource;
  hashTableObj *params;
  int          numparams;
  char         *httpcookiedata;
} wmsParamsObj;

122
/* owsRequestObj: Represent a OWS specific request with its enabled layers */
123 124 125 126 127 128 129 130
typedef struct {
  int numlayers;
  int *enabled_layers;

  char *service;
  char *version;
  char *request;
  void *document; /* xmlDocPtr or CPLXMLNode* */
131
} owsRequestObj;
132

133
MS_DLL_EXPORT int msOWSDispatch(mapObj *map, cgiRequestObj *request, int ows_mode);
134

135 136 137 138
MS_DLL_EXPORT const char * msOWSLookupMetadata(hashTableObj *metadata,
    const char *namespaces, const char *name);
MS_DLL_EXPORT const char * msOWSLookupMetadataWithLanguage(hashTableObj *metadata,
    const char *namespaces, const char *name, const char *validated_language);
139
MS_DLL_EXPORT const char * msOWSLookupMetadata2(hashTableObj *pri,
140 141 142 143
    hashTableObj *sec,
    const char *namespaces,
    const char *name);
MS_DLL_EXPORT int msOWSRequestIsEnabled(mapObj *map, layerObj *layer,
144
                                        const char *namespaces, const char *name, int check_all_layers);
145 146 147 148
MS_DLL_EXPORT void msOWSRequestLayersEnabled(mapObj *map, const char *namespaces,
    const char *request, owsRequestObj *request_layers);
MS_DLL_EXPORT int msOWSParseRequestMetadata(const char *metadata, const char *request,
    int *disabled);
149 150 151 152 153 154 155 156 157 158 159 160 161

/* Constants for OWS Service version numbers */
#define OWS_0_1_2   0x000102
#define OWS_0_1_4   0x000104
#define OWS_0_1_6   0x000106
#define OWS_0_1_7   0x000107
#define OWS_1_0_0   0x010000
#define OWS_1_0_1   0x010001
#define OWS_1_0_6   0x010006
#define OWS_1_0_7   0x010007
#define OWS_1_0_8   0x010008
#define OWS_1_1_0   0x010100
#define OWS_1_1_1   0x010101
162
#define OWS_1_1_2   0x010102
163
#define OWS_1_3_0   0x010300
164
#define OWS_2_0_0   0x020000
165
#define OWS_2_0_1   0x020001
166 167 168 169 170 171 172
#define OWS_VERSION_MAXLEN   20  /* Buffer size for msOWSGetVersionString() */
#define OWS_VERSION_NOTSET    -1
#define OWS_VERSION_BADFORMAT -2

MS_DLL_EXPORT int msOWSParseVersionString(const char *pszVersion);
MS_DLL_EXPORT const char *msOWSGetVersionString(int nVersion, char *pszBuffer);

173 174 175
#if defined(USE_WMS_SVR) || defined (USE_WFS_SVR) || defined (USE_WCS_SVR) || defined(USE_SOS_SVR) || defined(USE_WMS_LYR) || defined(USE_WFS_LYR)

MS_DLL_EXPORT int msOWSMakeAllLayersUnique(mapObj *map);
176
MS_DLL_EXPORT int msOWSNegotiateVersion(int requested_version, const int supported_versions[], int num_supported_versions);
177 178
MS_DLL_EXPORT char *msOWSTerminateOnlineResource(const char *src_url);
MS_DLL_EXPORT char *msOWSGetOnlineResource(mapObj *map, const char *namespaces, const char *metadata_name, cgiRequestObj *req);
179
MS_DLL_EXPORT char *msOWSGetOnlineResource2(mapObj *map, const char *namespaces, const char *metadata_name, cgiRequestObj *req, const char *validated_language);
180
MS_DLL_EXPORT const char *msOWSGetSchemasLocation(mapObj *map);
181
MS_DLL_EXPORT const char *msOWSGetInspireSchemasLocation(mapObj *map);
182
MS_DLL_EXPORT const char *msOWSGetLanguage(mapObj *map, const char *context);
183 184
MS_DLL_EXPORT char **msOWSGetLanguageList(mapObj *map, const char *namespaces, int *numitems);
MS_DLL_EXPORT char *msOWSGetLanguageFromList(mapObj *map, const char *namespaces, const char *requested_language);
185

186 187 188 189 190 191 192

/* OWS_NOERR and OWS_WARN passed as action_if_not_found to printMetadata() */
#define OWS_NOERR   0
#define OWS_WARN    1

/* OWS_WMS and OWS_WFS used for functions that differ in behavior between */
/* WMS and WFS services (e.g. msOWSPrintLatLonBoundingBox()) */
193 194 195 196 197
typedef enum
{
    OWS_WMS = 1,
    OWS_WFS = 2
} OWSServiceType;
198

199
MS_DLL_EXPORT int msOWSPrintInspireCommonExtendedCapabilities(FILE *stream, mapObj *map, const char *namespaces,
200 201
    const int action_if_not_found, const char *tag_name, const char* tag_ns,
    const char *validated_language, const OWSServiceType service);
202
int msOWSPrintInspireCommonMetadata(FILE *stream, mapObj *map, const char *namespaces,
203
                                    int action_if_not_found, const OWSServiceType service);
204 205 206 207 208 209 210 211 212 213
int msOWSPrintInspireCommonLanguages(FILE *stream, mapObj *map, const char *namespaces,
                                     int action_if_not_found, const char *validated_language);

MS_DLL_EXPORT int msOWSPrintMetadata(FILE *stream, hashTableObj *metadata,
                                     const char *namespaces, const char *name,
                                     int action_if_not_found, const char *format,
                                     const char *default_value);
int msOWSPrintEncodeMetadata(FILE *stream, hashTableObj *metadata,
                             const char *namespaces, const char *name,
                             int action_if_not_found,
214
                             const char *format, const char *default_value) ;
215 216 217 218 219 220 221
int msOWSPrintEncodeMetadata2(FILE *stream, hashTableObj *metadata,
                              const char *namespaces, const char *name,
                              int action_if_not_found,
                              const char *format, const char *default_value,
                              const char *validated_language);
char *msOWSGetEncodeMetadata(hashTableObj *metadata,
                             const char *namespaces, const char *name,
222 223
                             const char *default_value);

224 225 226
int msOWSPrintValidateMetadata(FILE *stream, hashTableObj *metadata,
                               const char *namespaces, const char *name,
                               int action_if_not_found,
227
                               const char *format, const char *default_value);
228 229 230
int msOWSPrintGroupMetadata(FILE *stream, mapObj *map, char* pszGroupName,
                            const char *namespaces, const char *name,
                            int action_if_not_found,
231
                            const char *format, const char *default_value);
232 233 234 235 236 237 238 239 240 241
int msOWSPrintGroupMetadata2(FILE *stream, mapObj *map, char* pszGroupName,
                             const char *namespaces, const char *name,
                             int action_if_not_found,
                             const char *format, const char *default_value,
                             const char *validated_language);
int msOWSPrintURLType(FILE *stream, hashTableObj *metadata,
                      const char *namespaces, const char *name,
                      int action_if_not_found, const char *tag_format,
                      const char *tag_name, const char *type_format,
                      const char *width_format, const char *height_format,
242
                      const char *urlfrmt_format, const char *href_format,
243 244 245 246 247
                      int type_is_mandatory, int width_is_mandatory,
                      int height_is_mandatory, int format_is_mandatory,
                      int href_is_mandatory, const char *default_type,
                      const char *default_width, const char *default_height,
                      const char *default_urlfrmt, const char *default_href,
248
                      const char *tabspace);
249 250
int msOWSPrintParam(FILE *stream, const char *name, const char *value,
                    int action_if_not_found, const char *format,
251
                    const char *default_value);
252 253
int msOWSPrintEncodeParam(FILE *stream, const char *name, const char *value,
                          int action_if_not_found, const char *format,
254
                          const char *default_value);
255 256 257
int msOWSPrintMetadataList(FILE *stream, hashTableObj *metadata,
                           const char *namespaces, const char *name,
                           const char *startTag,
258 259
                           const char *endTag, const char *itemFormat,
                           const char *default_value);
260 261 262
int msOWSPrintEncodeMetadataList(FILE *stream, hashTableObj *metadata,
                                 const char *namespaces, const char *name,
                                 const char *startTag,
263 264
                                 const char *endTag, const char *itemFormat,
                                 const char *default_value);
265 266 267 268
int msOWSPrintEncodeParamList(FILE *stream, const char *name,
                              const char *value, int action_if_not_found,
                              char delimiter, const char *startTag,
                              const char *endTag, const char *format,
269
                              const char *default_value);
270
void msOWSProjectToWGS84(projectionObj *srcproj, rectObj *ext);
271
void msOWSPrintLatLonBoundingBox(FILE *stream, const char *tabspace,
272
                                 rectObj *extent, projectionObj *srcproj,
273
                                 projectionObj *wfsproj, OWSServiceType nService);
274
void msOWSPrintEX_GeographicBoundingBox(FILE *stream, const char *tabspace,
275 276
                                        rectObj *extent, projectionObj *srcproj);

277 278
void msOWSPrintBoundingBox(FILE *stream, const char *tabspace,
                           rectObj *extent,
279
                           projectionObj *srcproj,
280 281
                           hashTableObj *layer_meta,
                           hashTableObj *map_meta,
282 283
                           const char *namespaces,
                           int wms_version);
284
void msOWSPrintContactInfo( FILE *stream, const char *tabspace,
285 286 287
                            int nVersion, hashTableObj *metadata,
                            const char *namespaces  );
int msOWSGetLayerExtent(mapObj *map, layerObj *lp, const char *namespaces, rectObj *ext);
288

289 290
int msOWSExecuteRequests(httpRequestObj *pasReqInfo, int numRequests,
                         mapObj *map, int bCheckLocalCache);
291

292
void msOWSProcessException(layerObj *lp, const char *pszFname,
293
                           int nErrorCode, const char *pszFuncName);
294
char *msOWSBuildURLFilename(const char *pszPath, const char *pszURL,
295 296 297
                            const char *pszExt);
const char *msOWSGetEPSGProj(projectionObj *proj, hashTableObj *metadata, const char *namespaces, int bReturnOnlyFirstOne);
char *msOWSGetProjURN(projectionObj *proj, hashTableObj *metadata, const char *namespaces, int bReturnOnlyFirstOne);
298
char *msOWSGetProjURI(projectionObj *proj, hashTableObj *metadata, const char *namespaces, int bReturnOnlyFirstOne);
299

300 301 302 303 304 305
void msOWSGetDimensionInfo(layerObj *layer, const char *pszDimension,
                           const char **pszDimUserValue,
                           const char **pszDimUnits,
                           const char **pszDimDefault,
                           const char **pszDimNearValue,
                           const char **pszDimUnitSymbol,
306 307 308 309
                           const char **pszDimMultiValue);

int msOWSNegotiateUpdateSequence(const char *requested_updateSequence, const char *updatesequence);

310 311
outputFormatObj *msOwsIsOutputFormatValid(mapObj *map, const char *format, hashTableObj *metadata,
    const char *namespaces, const char *name);
312
#endif /* #if any wxs service enabled */
313 314 315 316

/*====================================================================
 *   mapgml.c
 *====================================================================*/
317 318 319 320 321 322 323

typedef enum
{
    OWS_GML2, /* 2.1.2 */
    OWS_GML3, /* 3.1.1 */
    OWS_GML32 /* 3.2.1 */
} OWSGMLVersion;
324 325 326 327 328 329 330 331 332 333 334

#define OWS_WFS_FEATURE_COLLECTION_NAME "msFeatureCollection"
#define OWS_GML_DEFAULT_GEOMETRY_NAME "msGeometry"
#define OWS_GML_OCCUR_UNBOUNDED -1

/* TODO, there must be a better way to generalize these lists of objects... */

typedef struct {
  char *name;     /* name of the item */
  char *alias;    /* is the item aliased for presentation? (NULL if not) */
  char *type;     /* raw type for this item (NULL for a "string") (TODO: should this be a lookup table instead?) */
335
#ifndef __cplusplus
336 337 338 339 340
  char *template;  /* presentation string for this item, needs to be a complete XML tag */
#else
  char *_template;  /* presentation string for this item, needs to be a complete XML tag */
#endif
  int encode;     /* should the value be HTML encoded? Default is MS_TRUE */
341
  int visible;    /* should this item be output, default is MS_FALSE */
342 343
  int width;      /* field width, zero if unknown */
  int precision;  /* field precision (decimal places), zero if unknown or N/A */
344 345
  int outputByDefault; /* whether this should be output in a GetFeature without PropertyName. MS_TRUE by default, unless gml_default_items is specified and the item name is not in it */
  int minOccurs;  /* 0 by default. Can be set to 1 by specifying item name in gml_mandatory_items */
346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387
} gmlItemObj;

typedef struct {
  gmlItemObj *items;
  int numitems;
} gmlItemListObj;

typedef struct {
  char *name;     /* name of the constant */
  char *type;     /* raw type for this item (NULL for a "string") */
  char *value;    /* output value for this constant (output will look like: <name>value</name>) */
} gmlConstantObj;

typedef struct {
  gmlConstantObj *constants;
  int numconstants;
} gmlConstantListObj;

typedef struct {
  char *name;     /* name of the geometry (type of GML property) */
  char *type;     /* raw type for these geometries (point|multipoint|line|multiline|polygon|multipolygon */
  int occurmin, occurmax;   /* number of occurances (default 0,1) */
} gmlGeometryObj;

typedef struct {
  gmlGeometryObj *geometries;
  int numgeometries;
} gmlGeometryListObj;

typedef struct {
  char *name;     /* name of the group */
  char **items;   /* list of items in the group */
  int numitems;   /* number of items */
  char *type;     /* name of the complex type */
} gmlGroupObj;

typedef struct {
  gmlGroupObj *groups;
  int numgroups;
} gmlGroupListObj;

typedef struct {
388 389 390
  char *prefix;
  char *uri;
  char *schemalocation;
391 392 393 394 395 396 397
} gmlNamespaceObj;

typedef struct {
  gmlNamespaceObj *namespaces;
  int numnamespaces;
} gmlNamespaceListObj;

398

399 400
#if defined(USE_WMS_SVR) || defined (USE_WFS_SVR)

401
MS_DLL_EXPORT int msItemInGroups(const char *name, gmlGroupListObj *groupList);
402 403 404 405
MS_DLL_EXPORT gmlItemListObj *msGMLGetItems(layerObj *layer, const char *metadata_namespaces);
MS_DLL_EXPORT void msGMLFreeItems(gmlItemListObj *itemList);
MS_DLL_EXPORT gmlConstantListObj *msGMLGetConstants(layerObj *layer, const char *metadata_namespaces);
MS_DLL_EXPORT void msGMLFreeConstants(gmlConstantListObj *constantList);
406
MS_DLL_EXPORT gmlGeometryListObj *msGMLGetGeometries(layerObj *layer, const char *metadata_namespaces, int bWithDefaultGeom);
407 408 409 410 411 412 413 414 415 416 417 418
MS_DLL_EXPORT void msGMLFreeGeometries(gmlGeometryListObj *geometryList);
MS_DLL_EXPORT gmlGroupListObj *msGMLGetGroups(layerObj *layer, const char *metadata_namespaces);
MS_DLL_EXPORT void msGMLFreeGroups(gmlGroupListObj *groupList);
MS_DLL_EXPORT gmlNamespaceListObj *msGMLGetNamespaces(webObj *web, const char *metadata_namespaces);
MS_DLL_EXPORT void msGMLFreeNamespaces(gmlNamespaceListObj *namespaceList);
#endif

/* export to fix bug 851 */
MS_DLL_EXPORT int msGMLWriteQuery(mapObj *map, char *filename, const char *namespaces);


#ifdef USE_WFS_SVR
419 420 421 422 423 424 425

void msGMLWriteWFSBounds(mapObj *map, FILE *stream, const char *tab,
                         OWSGMLVersion outputformat, int nWFSVersion, int bUseURN);

MS_DLL_EXPORT int msGMLWriteWFSQuery(mapObj *map, FILE *stream, const char *wfs_namespace,
                                     OWSGMLVersion outputformat, int nWFSVersion, int bUseURN,
                                     int bGetPropertyValueRequest);
426 427 428 429 430 431
#endif


/*====================================================================
 *   mapwms.c
 *====================================================================*/
432
int msWMSDispatch(mapObj *map, cgiRequestObj *req, owsRequestObj *ows_request, int force_wms_mode);
433
MS_DLL_EXPORT int msWMSLoadGetMapParams(mapObj *map, int nVersion,
434
                                        char **names, char **values, int numentries,
435
                                        char *wms_exception_format, const char *wms_request, owsRequestObj *ows_request);
436 437 438 439 440 441


/*====================================================================
 *   mapwmslayer.c
 *====================================================================*/

442 443 444 445
#define WMS_GETMAP         1
#define WMS_GETFEATUREINFO 2
#define WMS_GETLEGENDGRAPHIC 3

446 447 448 449
int msInitWmsParamsObj(wmsParamsObj *wmsparams);
void msFreeWmsParamsObj(wmsParamsObj *wmsparams);

int msPrepareWMSLayerRequest(int nLayerId, mapObj *map, layerObj *lp,
450
                             int nRequestType, enum MS_CONNECTION_TYPE lastconnectiontype,
451
                             wmsParamsObj *psLastWMSParams,
452
                             int nClickX, int nClickY, int nFeatureCount, const char *pszInfoFormat,
453
                             httpRequestObj *pasReqInfo, int *numRequests);
454 455
int msDrawWMSLayerLow(int nLayerId, httpRequestObj *pasReqInfo,
                      int numRequests, mapObj *map, layerObj *lp,
456 457
                      imageObj *img);
MS_DLL_EXPORT char *msWMSGetFeatureInfoURL(mapObj *map, layerObj *lp,
458 459 460 461
    int nClickX, int nClickY, int nFeatureCount,
    const char *pszInfoFormat);
int msWMSLayerExecuteRequest(mapObj *map, int nOWSLayers, int nClickX, int nClickY,
                             int nFeatureCount, const char *pszInfoFormat, int type);
462 463 464 465 466

/*====================================================================
 *   mapwfs.c
 *====================================================================*/

467
MS_DLL_EXPORT int msWFSDispatch(mapObj *map, cgiRequestObj *requestobj,
468 469 470
                                owsRequestObj *ows_request, int force_wfs_mode);
int msWFSParseRequest(mapObj *map, cgiRequestObj *, owsRequestObj *ows_request,
                      wfsParamsObj *, int force_wfs_mode);
471
wfsParamsObj *msWFSCreateParamsObj(void);
472
int msWFSHandleUpdateSequence(mapObj *map, wfsParamsObj *wfsparams, const char* pszFunction);
473 474
void msWFSFreeParamsObj(wfsParamsObj *wfsparams);
int msWFSIsLayerSupported(layerObj *lp);
475
int msWFSException(mapObj *map, const char *locator, const char *code,
476 477 478 479 480
                   const char *version);

#ifdef USE_WFS_SVR
const char *msWFSGetGeomElementName(mapObj *map, layerObj *lp);

481
int msWFSException11(mapObj *map, const char *locator,
482
                     const char *exceptionCode, const char *version);
483 484
int msWFSGetCapabilities11(mapObj *map, wfsParamsObj *wfsparams,
                           cgiRequestObj *req, owsRequestObj *ows_request);
485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503
#ifdef USE_LIBXML2
xmlNodePtr msWFSDumpLayer11(mapObj *map, layerObj *lp, xmlNsPtr psNsOws,
                          int nWFSVersion, const char* validate_language);
#endif
char *msWFSGetOutputFormatList(mapObj *map, layerObj *layer, int nWFSVersion);

int msWFSException20(mapObj *map, const char *locator,
                     const char *exceptionCode);
int msWFSGetCapabilities20(mapObj *map, wfsParamsObj *params,
                           cgiRequestObj *req, owsRequestObj *ows_request);
int msWFSListStoredQueries20(mapObj *map, wfsParamsObj *params,
                             cgiRequestObj *req, owsRequestObj *ows_request);
int msWFSDescribeStoredQueries20(mapObj *map, wfsParamsObj *params,
                             cgiRequestObj *req, owsRequestObj *ows_request);
char* msWFSGetResolvedStoredQuery20(mapObj *map,
                                    wfsParamsObj *wfsparams,
                                    const char* id,
                                    hashTableObj* hashTable);

504 505 506 507 508 509 510 511 512
#endif

/*====================================================================
 *   mapwfslayer.c
 *====================================================================*/

int msPrepareWFSLayerRequest(int nLayerId, mapObj *map, layerObj *lp,
                             httpRequestObj *pasReqInfo, int *numRequests);
void msWFSUpdateRequestInfo(layerObj *lp, httpRequestObj *pasReqInfo);
513
int msWFSLayerOpen(layerObj *lp,
514
                   const char *pszGMLFilename, rectObj *defaultBBOX);
515
int msWFSLayerIsOpen(layerObj *lp);
516 517
int msWFSLayerInitItemInfo(layerObj *layer);
int msWFSLayerGetItems(layerObj *layer);
518
int msWFSLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery);
519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535
int msWFSLayerClose(layerObj *lp);
MS_DLL_EXPORT char *msWFSExecuteGetFeature(layerObj *lp);

/*====================================================================
 *   mapcontext.c
 *====================================================================*/

MS_DLL_EXPORT int msWriteMapContext(mapObj *map, FILE *stream);
MS_DLL_EXPORT int msSaveMapContext(mapObj *map, char *filename);
MS_DLL_EXPORT int msLoadMapContext(mapObj *map, char *filename, int unique_layer_names);
MS_DLL_EXPORT int msLoadMapContextURL(mapObj *map, char *urlfilename, int unique_layer_names);


/*====================================================================
 *   mapwcs.c
 *====================================================================*/

536
int msWCSDispatch(mapObj *map, cgiRequestObj *requestobj, owsRequestObj *ows_request); /* only 1 public function */
537 538 539 540 541 542 543



/*====================================================================
 *   mapogsos.c
 *====================================================================*/

544
int msSOSDispatch(mapObj *map, cgiRequestObj *requestobj, owsRequestObj *ows_request); /* only 1 public function */
545

546 547 548
#ifdef __cplusplus
} /* extern "C" */
#endif
549 550 551

#endif /* MAPOWS_H */