tinyows 1.2.2
fe_filter_capabilities.c
Go to the documentation of this file.
1/*
2 Copyright (c) <2007-2012> <Barbara Philippot - Olivier Courtin>
3
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10
11 The above copyright notice and this permission notice shall be included in
12 all copies or substantial portions of the Software.
13
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 IN THE SOFTWARE.
21*/
22
23
24#include <stdlib.h>
25#include <stdio.h>
26#include <assert.h>
27
28#include "../ows/ows.h"
29
30
31/*
32 * Describe functions supported by the wfs
33 */
34static void fe_functions_capabilities(const ows * o)
35{
36 int version;
37 buffer *fct_name;
38
39 assert(o);
40
41 version = ows_version_get(o->request->version);
42 fct_name = buffer_init();
43
44 if (version == 100) buffer_add_str(fct_name, "Function_Name");
45 else buffer_add_str(fct_name, "FunctionName");
46
47 fprintf(o->output, " <ogc:Functions>\n");
48 fprintf(o->output, " <ogc:%ss>\n", fct_name->buf);
49 fprintf(o->output, " <ogc:%s nArgs='1'>abs</ogc:%s>\n", fct_name->buf, fct_name->buf);
50 fprintf(o->output, " <ogc:%s nArgs='1'>acos</ogc:%s>\n", fct_name->buf, fct_name->buf);
51 fprintf(o->output, " <ogc:%s nArgs='1'>asin</ogc:%s>\n", fct_name->buf, fct_name->buf);
52 fprintf(o->output, " <ogc:%s nArgs='1'>atan</ogc:%s>\n", fct_name->buf, fct_name->buf);
53 fprintf(o->output, " <ogc:%s nArgs='1'>avg</ogc:%s>\n", fct_name->buf, fct_name->buf);
54 fprintf(o->output, " <ogc:%s nArgs='1'>cbrt</ogc:%s>\n", fct_name->buf, fct_name->buf);
55 fprintf(o->output, " <ogc:%s nArgs='1'>ceil</ogc:%s>\n", fct_name->buf, fct_name->buf);
56 fprintf(o->output, " <ogc:%s nArgs='1'>ceiling</ogc:%s>\n", fct_name->buf, fct_name->buf);
57 fprintf(o->output, " <ogc:%s nArgs='1'>cos</ogc:%s>\n", fct_name->buf, fct_name->buf);
58 fprintf(o->output, " <ogc:%s nArgs='1'>cot</ogc:%s>\n", fct_name->buf, fct_name->buf);
59 fprintf(o->output, " <ogc:%s nArgs='1'>count</ogc:%s>\n", fct_name->buf, fct_name->buf);
60 fprintf(o->output, " <ogc:%s nArgs='1'>degrees</ogc:%s>\n", fct_name->buf, fct_name->buf);
61 fprintf(o->output, " <ogc:%s nArgs='1'>exp</ogc:%s>\n", fct_name->buf, fct_name->buf);
62 fprintf(o->output, " <ogc:%s nArgs='1'>floor</ogc:%s>\n", fct_name->buf, fct_name->buf);
63 fprintf(o->output, " <ogc:%s nArgs='1'>length</ogc:%s>\n", fct_name->buf, fct_name->buf);
64 fprintf(o->output, " <ogc:%s nArgs='1'>ln</ogc:%s>\n", fct_name->buf, fct_name->buf);
65 fprintf(o->output, " <ogc:%s nArgs='1'>log</ogc:%s>\n", fct_name->buf, fct_name->buf);
66 fprintf(o->output, " <ogc:%s nArgs='1'>min</ogc:%s>\n", fct_name->buf, fct_name->buf);
67 fprintf(o->output, " <ogc:%s nArgs='1'>max</ogc:%s>\n", fct_name->buf, fct_name->buf);
68 fprintf(o->output, " <ogc:%s nArgs='1'>radians</ogc:%s>\n", fct_name->buf, fct_name->buf);
69 fprintf(o->output, " <ogc:%s nArgs='1'>round</ogc:%s>\n", fct_name->buf, fct_name->buf);
70 fprintf(o->output, " <ogc:%s nArgs='1'>sin</ogc:%s>\n", fct_name->buf, fct_name->buf);
71 fprintf(o->output, " <ogc:%s nArgs='1'>sqrt</ogc:%s>\n", fct_name->buf, fct_name->buf);
72 fprintf(o->output, " <ogc:%s nArgs='1'>tan</ogc:%s>\n", fct_name->buf, fct_name->buf);
73 fprintf(o->output, " <ogc:%s nArgs='1'>trunc</ogc:%s>\n", fct_name->buf, fct_name->buf);
74 fprintf(o->output, " </ogc:%ss>\n", fct_name->buf);
75 fprintf(o->output, " </ogc:Functions>\n");
76
77 buffer_free(fct_name);
78}
79
80
81/*
82 * Describe what specific filter capabilties are supported by the wfs server
83 * Version 1.0.0 Filter Encoding
84 */
86{
87 assert(o);
88
89 fprintf(o->output, "<ogc:Filter_Capabilities>\n");
90
91 /* Spatial Capabilities */
92 fprintf(o->output, " <ogc:Spatial_Capabilities>\n");
93 fprintf(o->output, " <ogc:Spatial_Operators>\n");
94 fprintf(o->output, " <ogc:Disjoint/>\n");
95 fprintf(o->output, " <ogc:Equals/>\n");
96 fprintf(o->output, " <ogc:DWithin/>\n");
97 fprintf(o->output, " <ogc:Beyond/>\n");
98 fprintf(o->output, " <ogc:Intersect/>\n");
99 fprintf(o->output, " <ogc:Touches/>\n");
100 fprintf(o->output, " <ogc:Crosses/>\n");
101 fprintf(o->output, " <ogc:Within/>\n");
102 fprintf(o->output, " <ogc:Contains/>\n");
103 fprintf(o->output, " <ogc:Overlaps/>\n");
104 fprintf(o->output, " <ogc:BBOX/>\n");
105 fprintf(o->output, " </ogc:Spatial_Operators>\n");
106 fprintf(o->output, " </ogc:Spatial_Capabilities>\n");
107
108 /* Scalar Capabilities */
109 fprintf(o->output, " <ogc:Scalar_Capabilities>\n");
110 fprintf(o->output, " <ogc:Logical_Operators/>\n");
111 fprintf(o->output, " <ogc:Comparison_Operators>\n");
112 fprintf(o->output, " <ogc:Simple_Comparisons/>\n");
113 fprintf(o->output, " <ogc:Between/>\n");
114 fprintf(o->output, " <ogc:Like/>\n");
115 fprintf(o->output, " <ogc:NullCheck/>\n");
116 fprintf(o->output, " </ogc:Comparison_Operators>\n");
117 fprintf(o->output, " <ogc:Arithmetic_Operators>\n");
118 fprintf(o->output, " <ogc:Simple_Arithmetic/>\n");
120 fprintf(o->output, " </ogc:Arithmetic_Operators>\n");
121 fprintf(o->output, " </ogc:Scalar_Capabilities>\n");
122
123 fprintf(o->output, "</ogc:Filter_Capabilities>\n");
124}
125
126
127/*
128 * Describe what specific filter capabilties are supported by the wfs server
129 * Version 1.1.0 Filter Encoding
130 */
132{
133 assert(o);
134
135 fprintf(o->output, "<ogc:Filter_Capabilities>\n");
136
137 /* Spatial Capabililties */
138 fprintf(o->output, " <ogc:Spatial_Capabilities>\n");
139
140 fprintf(o->output, " <ogc:GeometryOperands>\n");
141 fprintf(o->output, " <ogc:GeometryOperand>gml:Envelope</ogc:GeometryOperand>\n");
142 fprintf(o->output, " <ogc:GeometryOperand>gml:Point</ogc:GeometryOperand>\n");
143 fprintf(o->output, " <ogc:GeometryOperand>gml:LineString</ogc:GeometryOperand>\n");
144 fprintf(o->output, " <ogc:GeometryOperand>gml:Polygon</ogc:GeometryOperand>\n");
145 if (ows_version_get(o->postgis_version) >= 200) {
146 fprintf(o->output, " <ogc:GeometryOperand>gml:Triangle</ogc:GeometryOperand>\n");
147 fprintf(o->output, " <ogc:GeometryOperand>gml:PolyhedralSurface</ogc:GeometryOperand>\n");
148 fprintf(o->output, " <ogc:GeometryOperand>gml:Tin</ogc:GeometryOperand>\n");
149 }
150 fprintf(o->output, " </ogc:GeometryOperands>\n");
151
152 fprintf(o->output, " <ogc:SpatialOperators>\n");
153 fprintf(o->output, " <ogc:SpatialOperator name='Disjoint'/>\n");
154 fprintf(o->output, " <ogc:SpatialOperator name='Equals'/>\n");
155 fprintf(o->output, " <ogc:SpatialOperator name='DWithin'/>\n");
156 fprintf(o->output, " <ogc:SpatialOperator name='Beyond'/>\n");
157 fprintf(o->output, " <ogc:SpatialOperator name='Intersects'/>\n");
158 fprintf(o->output, " <ogc:SpatialOperator name='Touches'/>\n");
159 fprintf(o->output, " <ogc:SpatialOperator name='Crosses'/>\n");
160 fprintf(o->output, " <ogc:SpatialOperator name='Within'/>\n");
161 fprintf(o->output, " <ogc:SpatialOperator name='Contains'/>\n");
162 fprintf(o->output, " <ogc:SpatialOperator name='Overlaps'/>\n");
163 fprintf(o->output, " <ogc:SpatialOperator name='BBOX'/>\n");
164 fprintf(o->output, " </ogc:SpatialOperators>\n");
165 fprintf(o->output, " </ogc:Spatial_Capabilities>\n");
166
167 /* Scalar Capabililties */
168 fprintf(o->output, " <ogc:Scalar_Capabilities>\n");
169 fprintf(o->output, " <ogc:LogicalOperators/>\n");
170
171 fprintf(o->output, " <ogc:ComparisonOperators>\n");
172 fprintf(o->output, " <ogc:ComparisonOperator>EqualTo</ogc:ComparisonOperator>\n");
173 fprintf(o->output, " <ogc:ComparisonOperator>NotEqualTo</ogc:ComparisonOperator>\n");
174 fprintf(o->output, " <ogc:ComparisonOperator>LessThan</ogc:ComparisonOperator>\n");
175 fprintf(o->output, " <ogc:ComparisonOperator>GreaterThan</ogc:ComparisonOperator>\n");
176 fprintf(o->output, " <ogc:ComparisonOperator>LessThanEqualTo</ogc:ComparisonOperator>\n");
177 fprintf(o->output, " <ogc:ComparisonOperator>GreaterThanEqualTo</ogc:ComparisonOperator>\n");
178 fprintf(o->output, " <ogc:ComparisonOperator>Between</ogc:ComparisonOperator>\n");
179 fprintf(o->output, " <ogc:ComparisonOperator>Like</ogc:ComparisonOperator>\n");
180 fprintf(o->output, " <ogc:ComparisonOperator>NullCheck</ogc:ComparisonOperator>\n");
181 fprintf(o->output, " </ogc:ComparisonOperators>\n");
182
183 fprintf(o->output, " <ogc:ArithmeticOperators>\n");
184 fprintf(o->output, " <ogc:SimpleArithmetic/>\n");
186 fprintf(o->output, " </ogc:ArithmeticOperators>\n");
187
188 fprintf(o->output, " </ogc:Scalar_Capabilities>\n");
189
190 /* Id Capabilities */
191 fprintf(o->output, " <ogc:Id_Capabilities>\n");
192 fprintf(o->output, " <ogc:EID/>\n");
193 fprintf(o->output, " <ogc:FID/>\n");
194 fprintf(o->output, " </ogc:Id_Capabilities>\n");
195
196 fprintf(o->output, "</ogc:Filter_Capabilities>\n");
197}
198
199
200/*
201 * vim: expandtab sw=4 ts=4
202 */
void fe_filter_capabilities_110(const ows *o)
void fe_filter_capabilities_100(const ows *o)
static void fe_functions_capabilities(const ows *o)
int ows_version_get(ows_version *v)
void buffer_add_str(buffer *buf, const char *str)
Definition buffer.c:254
void buffer_free(buffer *buf)
Definition buffer.c:83
buffer * buffer_init()
Definition buffer.c:61
char * buf
size to next realloc
Definition ows_struct.h:39
ows_version * version
Definition ows_struct.h:353
ows_request * request
Definition ows_struct.h:403
ows_version * postgis_version
Definition ows_struct.h:405
FILE * output
Definition ows_struct.h:382

Generated for tinyows by doxygen 1.9.7