~ubuntu-branches/ubuntu/saucy/mapserver/saucy-security

« back to all changes in this revision

Viewing changes to mapwcs.h

  • Committer: Package Import Robot
  • Author(s): Francesco Paolo Lovergine
  • Date: 2011-12-23 14:02:06 UTC
  • mfrom: (26.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20111223140206-n3h9t2hsa8hyslmu
Tags: 6.0.1-2
Added missed stuff for libmapscript-perl.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/******************************************************************************
2
 
 * $Id: mapwcs.h 7497 2008-04-05 20:35:53Z warmerdam $
 
2
 * $Id: mapwcs.h 11503 2011-04-07 19:56:16Z dmorissette $
3
3
 *
4
4
 * Project:  MapServer
5
5
 * Purpose:  OpenGIS Web Coverage Server (WCS) Declarations.
32
32
 
33
33
#include "mapserver.h"
34
34
#include "mapowscommon.h"
 
35
#include <limits.h>
 
36
#include <time.h>
 
37
#include <float.h>
 
38
 
 
39
#ifndef _WIN32
 
40
#include <sys/time.h>
 
41
#endif
 
42
 
 
43
/*
 
44
 * Definitions
 
45
 */
 
46
 
 
47
#define MS_WCS_GML_COVERAGETYPE_RECTIFIED_GRID_COVERAGE "RectifiedGridCoverage"
 
48
 
35
49
 
36
50
/*
37
51
** Structure to hold metadata taken from the image or image tile index
45
59
  double xresolution, yresolution;
46
60
  int bandcount; 
47
61
  int imagemode;
 
62
  const char *bandinterpretation[10];
48
63
} coverageMetadataObj;
49
64
 
50
65
typedef struct {
86
101
/*      Some WCS 1.1 specific functions from mapwcs11.c                 */
87
102
/* -------------------------------------------------------------------- */
88
103
int msWCSGetCapabilities11(mapObj *map, wcsParamsObj *params, 
89
 
                           cgiRequestObj *req);
90
 
int msWCSDescribeCoverage11(mapObj *map, wcsParamsObj *params );
 
104
                           cgiRequestObj *req, owsRequestObj *ows_request);
 
105
int msWCSDescribeCoverage11(mapObj *map, wcsParamsObj *params, owsRequestObj *ows_request);
91
106
int msWCSReturnCoverage11( wcsParamsObj *params, mapObj *map, imageObj *image);
92
107
int msWCSGetCoverageBands11( mapObj *map, cgiRequestObj *request, 
93
108
                             wcsParamsObj *params, layerObj *lp,
95
110
int msWCSException11(mapObj *map, const char *locator, 
96
111
                     const char *exceptionCode, const char *version);
97
112
 
 
113
 
 
114
/* -------------------------------------------------------------------- */
 
115
/*      Some WCS 2.0 specific functions and structs from mapwcs20.c     */
 
116
/* -------------------------------------------------------------------- */
 
117
 
 
118
enum
 
119
{
 
120
    MS_WCS20_TRIM = 0,
 
121
    MS_WCS20_SLICE = 1
 
122
};
 
123
 
 
124
enum
 
125
{
 
126
    MS_WCS20_ERROR_VALUE = -1,
 
127
    MS_WCS20_SCALAR_VALUE = 0,
 
128
    MS_WCS20_TIME_VALUE = 1,
 
129
    MS_WCS20_UNDEFINED_VALUE = 2
 
130
};
 
131
 
 
132
#define MS_WCS20_UNBOUNDED DBL_MAX
 
133
#define MS_WCS20_UNBOUNDED_TIME 0xFFFFFFFF
 
134
 
 
135
typedef struct
 
136
{
 
137
    union
 
138
    {
 
139
        double scalar;
 
140
        time_t time;
 
141
    };
 
142
    int unbounded; /* 0 if bounded, 1 if unbounded */
 
143
} timeScalarUnion;
 
144
 
 
145
typedef struct
 
146
{
 
147
    char *axis;         /* the name of the subsetted axis */
 
148
    int operation;      /* Either TRIM or SLICE */
 
149
    char *crs;          /* optional CRS to use */
 
150
    int timeOrScalar;   /* 0 if scalar value, 1 if time value */
 
151
    timeScalarUnion min; /* Minimum and Maximum of the subsetted axis;*/
 
152
    timeScalarUnion max;
 
153
} wcs20SubsetObj;
 
154
typedef wcs20SubsetObj * wcs20SubsetObjPtr;
 
155
 
 
156
typedef struct
 
157
{
 
158
    char *name;         /* name of the axis */
 
159
    int size;           /* pixelsize of the axis */
 
160
    double resolution;  /* resolution of the axis */
 
161
    char *resolutionUOM; /* resolution units of measure */
 
162
    wcs20SubsetObjPtr subset;
 
163
} wcs20AxisObj;
 
164
typedef wcs20AxisObj * wcs20AxisObjPtr;
 
165
 
 
166
typedef struct
 
167
{
 
168
    char *version;      /* 2.0.0 */
 
169
    char *request;      /* GetCapabilities|DescribeCoverage|GetCoverage */
 
170
    char *service;      /* MUST be WCS */
 
171
    char **accept_versions; /* NULL terminated list of Accepted versions */
 
172
    char **sections;    /* NULL terminated list of GetCapabilities sections */
 
173
    char *updatesequence; /* GetCapabilities updatesequence */
 
174
    char **ids;         /* NULL terminated list of coverages (in the case of a GetCoverage there will only be 1) */
 
175
    long width, height; /* image dimensions */
 
176
    double resolutionX; /* image resolution in X axis */
 
177
    double resolutionY; /* image resolution in Y axis */
 
178
    char *resolutionUnits; /* Units of Measure for resolution */
 
179
    char *format;       /* requested output format */
 
180
    int multipart;      /* flag for multipart GML+image */
 
181
    char *interpolation; /* requested interpolation method */
 
182
    char *outputcrs;    /* requested CRS for output */
 
183
    char *subsetcrs;    /* determined CRS of the subsets */
 
184
    rectObj bbox;       /* determined Bounding Box */
 
185
    int numaxes;        /* number of axes */
 
186
    wcs20AxisObjPtr *axes; /* list of axes, NULL if none*/
 
187
    char **range_subset;
 
188
    char **invalid_get_parameters; /* NULL terminated list of invalid GET parameters */
 
189
} wcs20ParamsObj;
 
190
typedef wcs20ParamsObj * wcs20ParamsObjPtr;
 
191
 
 
192
typedef struct
 
193
{
 
194
    union
 
195
    {
 
196
        struct
 
197
        {
 
198
            char *name;
 
199
            char *interpretation;
 
200
            char *uom;
 
201
            char *definition;
 
202
            char *description;
 
203
        };
 
204
        char *values[5];
 
205
    };
 
206
    double interval_min;
 
207
    double interval_max;
 
208
    int significant_figures;
 
209
} wcs20rasterbandMetadataObj;
 
210
typedef wcs20rasterbandMetadataObj * wcs20rasterbandMetadataObjPtr;
 
211
 
 
212
typedef struct
 
213
{
 
214
    char *native_format;    /* mime type of the native format */
 
215
    const char *srs;
 
216
    char srs_uri[200];
 
217
    rectObj extent;
 
218
    double geotransform[6];
 
219
    double xresolution;
 
220
    double yresolution;
 
221
    int xsize;
 
222
    int ysize;
 
223
    int imagemode;
 
224
    size_t numnilvalues;
 
225
    char **nilvalues;
 
226
    char **nilvalues_reasons;
 
227
    size_t numbands;
 
228
    wcs20rasterbandMetadataObjPtr bands;
 
229
} wcs20coverageMetadataObj;
 
230
typedef wcs20coverageMetadataObj * wcs20coverageMetadataObjPtr;
 
231
 
 
232
#define MS_WCS_20_PROFILE_CORE      "http://www.opengis.net/spec/WCS/2.0/conf/core"
 
233
#define MS_WCS_20_PROFILE_KVP       "http://www.opengis.net/spec/WCS_protocol-binding_get-kvp/1.0"
 
234
#define MS_WCS_20_PROFILE_POST      "http://www.opengis.net/spec/WCS_protocol-binding_post-xml/1.0"
 
235
#define MS_WCS_20_PROFILE_GEOTIFF   "http://www.opengis.net/spec/WCS_coverage-encoding_geotiff/1.0/"
 
236
#define MS_WCS_20_PROFILE_GML_GEOTIFF "http://www.placeholder.com/GML_and_GeoTIFF"
 
237
#define MS_WCS_20_PROFILE_EPSG      "http://www.placeholder.com/EPSG"
 
238
#define MS_WCS_20_PROFILE_IMAGECRS  "http://www.placeholder.com/IMAGECRS"
 
239
#define MS_WCS_20_PROFILE_SCALING   "http://www.placeholder.com/SCALING"
 
240
#define MS_WCS_20_PROFILE_INTERPOLATION "http://www.placeholder.com/INTERPOLATION"
 
241
#define MS_WCS_20_PROFILE_RANGESUBSET "http://www.placeholder.com/RANGESUBSET"
 
242
 
 
243
int msWCSDispatch20(mapObj *map, cgiRequestObj *request, owsRequestObj *ows_request);
 
244
 
 
245
int msWCSException20(mapObj *map, const char *locator,
 
246
                     const char *exceptionCode, const char *version);
 
247
 
 
248
#define XML_FOREACH_CHILD(parent_node, child_node)              \
 
249
    for(child_node = parent_node->children; child_node != NULL; child_node = child_node->next)
 
250
 
 
251
/* Makro to continue the iteration over an xml structure    */
 
252
/* when the current node has the type 'text' or 'comment'   */
 
253
#define XML_LOOP_IGNORE_COMMENT_OR_TEXT(node)                   \
 
254
    if(xmlNodeIsText(node) || node->type == XML_COMMENT_NODE)   \
 
255
    {                                                           \
 
256
        continue;                                               \
 
257
    }
 
258
 
 
259
/* Makro to set an XML error that an unknown node type      */
 
260
/* occurred.                                                */
 
261
#define XML_UNKNOWN_NODE_ERROR(node)                            \
 
262
    msSetError(MS_WCSERR, "Unknown XML element '%s'.",          \
 
263
            __FUNCTION__, (char *)node->name);                  \
 
264
    return MS_FAILURE;
 
265
 
 
266
#define XML_ASSERT_NODE_NAME(node,nodename)                     \
 
267
    if(EQUAL((char *)node->name, nodename) == MS_FALSE)         \
 
268
    {                                                           \
 
269
        XML_UNKNOWN_NODE_ERROR(node);                           \
 
270
    }
 
271
 
 
272
#define MS_WCS_20_CAPABILITIES_INCLUDE_SECTION(params,section)  \
 
273
    (params->sections == NULL                                   \
 
274
    || CSLFindString(params->sections, "All") != -1             \
 
275
    || CSLFindString(params->sections, section) != -1)
 
276
 
98
277
#endif /* nef MAPWCS_H */