svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.expressionevaluator / org.gvsig.expressionevaluator.geometry / org.gvsig.expressionevaluator.geometry.lib / org.gvsig.expressionevaluator.geometry.lib.impl / src / main / java / org / gvsig / expressionevaluator / impl / DefaultGeometryExpressionBuilderHelper.java @ 44644
History | View | Annotate | Download (25.2 KB)
1 |
package org.gvsig.expressionevaluator.impl; |
---|---|
2 |
|
3 |
import java.text.MessageFormat; |
4 |
import java.util.Objects; |
5 |
import org.cresques.cts.IProjection; |
6 |
import org.gvsig.expressionevaluator.ExpressionBuilder; |
7 |
import org.gvsig.fmap.geom.Geometry; |
8 |
import org.gvsig.fmap.geom.primitive.Envelope; |
9 |
|
10 |
import static org.gvsig.expressionevaluator.ExpressionBuilder.PARAMETER_TYPE_VARIABLE; |
11 |
import org.gvsig.expressionevaluator.ExpressionBuilder.AbstractValue; |
12 |
import org.gvsig.expressionevaluator.ExpressionBuilder.Constant; |
13 |
import org.gvsig.expressionevaluator.ExpressionBuilder.Function; |
14 |
import static org.gvsig.expressionevaluator.ExpressionBuilder.PARAMETER_TYPE_CONSTANT; |
15 |
import org.gvsig.expressionevaluator.ExpressionBuilder.Value; |
16 |
import org.gvsig.expressionevaluator.ExpressionBuilder.Visitor; |
17 |
import org.gvsig.expressionevaluator.ExpressionBuilder.VisitorFilter; |
18 |
import org.gvsig.expressionevaluator.Formatter; |
19 |
import org.gvsig.expressionevaluator.impl.DefaultExpressionBuilder.FunctionBase; |
20 |
import org.gvsig.expressionevaluator.impl.DefaultExpressionBuilder.ParameterBase; |
21 |
import org.gvsig.fmap.geom.GeometryUtils; |
22 |
import org.gvsig.expressionevaluator.GeometryExpressionBuilderHelper; |
23 |
import static org.gvsig.expressionevaluator.GeometryExpressionBuilderHelper.PARAMETER_TYPE_GEOMETRY; |
24 |
|
25 |
public class DefaultGeometryExpressionBuilderHelper |
26 |
implements GeometryExpressionBuilderHelper {
|
27 |
|
28 |
private static final String FORMAT_ST_SRID = "ST_SRID({0})"; |
29 |
private static final String FORMAT_ST_ASTEXT = "ST_AsText({0})"; |
30 |
private static final String FORMAT_ST_ASBINARY = "ST_AsBinary({0})"; |
31 |
private static final String FORMAT_ST_ASEWKB = "ST_AsEWKB({0})"; |
32 |
private static final String FORMAT_ST_CONTAINS = "ST_Contains(({0}), ({1}))"; |
33 |
private static final String FORMAT_ST_CROSSES = "ST_Crosses(({0}), ({1}))"; |
34 |
private static final String FORMAT_ST_DISJOINT = "ST_Disjoint(({0}), ({1}))"; |
35 |
private static final String FORMAT_ST_EQUALS = "ST_Equals(({0}), ({1}))"; |
36 |
private static final String FORMAT_ST_ISCLOSED = "ST_IsClosed({0})"; |
37 |
private static final String FORMAT_ST_OVERLAPS = "ST_Overlaps(({0}), ({1}))"; |
38 |
private static final String FORMAT_ST_TOUCHES = "ST_Touches(({0}), ({1}))"; |
39 |
private static final String FORMAT_ST_WITHIN = "ST_Within(({0}), ({1}))"; |
40 |
private static final String FORMAT_ST_ENVELOPE = "ST_Envelope({0})"; |
41 |
private static final String FORMAT_ST_FORCE2D = "ST_Force2D({0})"; |
42 |
private static final String FORMAT_ST_INTERSECTS = "ST_Intersects(({0}), ({1}))"; |
43 |
private static final String FORMAT_ST_GEOMFROMTEXT = "ST_GeomFromText(({0}), ({1}))"; |
44 |
private static final String FORMAT_ST_GEOMFROMWKB = "ST_GeomFromWKB(({0}), ({1}))"; |
45 |
private static final String FORMAT_ST_GEOMFROMEWKB = "ST_GeomFromEWKB(({0}), ({1}))"; |
46 |
private static final String FORMAT_ST_SIMPLIFY = "ST_Simplify(({0}), ({1}))"; |
47 |
|
48 |
public static class GeometryParameterBase |
49 |
extends ParameterBase
|
50 |
implements GeometryParameter {
|
51 |
|
52 |
protected Value srs;
|
53 |
protected GeometryExpressionBuilderHelper builder;
|
54 |
|
55 |
/*
|
56 |
Para un parametro de tipo Geometria, el srs sera siempre un Constant
|
57 |
excepto cuando se le asigne una geometria contante al parametro y esta
|
58 |
tenga un SRS asignado. En este caso, tanto la geometria como el SRS
|
59 |
se trataran como parametros.
|
60 |
|
61 |
Si se quiere que el SRS sea un Parameter, se construira como tal.
|
62 |
*/
|
63 |
public GeometryParameterBase(GeometryExpressionBuilderHelper builder) {
|
64 |
super();
|
65 |
this.builder = builder;
|
66 |
} |
67 |
|
68 |
@Override
|
69 |
public void accept(Visitor visitor, VisitorFilter filter) { |
70 |
super.accept(visitor, filter);
|
71 |
if (this.srs != null) { |
72 |
this.srs.accept(visitor, filter);
|
73 |
} |
74 |
} |
75 |
|
76 |
@Override
|
77 |
public void replace(Value target, Value replacement) { |
78 |
if( this.srs == target ) { |
79 |
this.srs = replacement;
|
80 |
} else {
|
81 |
this.srs.replace(target, replacement);
|
82 |
} |
83 |
} |
84 |
|
85 |
@Override
|
86 |
public GeometryParameter value(Object value) { |
87 |
if( value instanceof Geometry ) { |
88 |
if( this.srs == null ) { |
89 |
IProjection proj = ((Geometry)value).getProjection(); |
90 |
this.srs(this.builder.parameter().value(proj)); |
91 |
} |
92 |
} |
93 |
this.value = value;
|
94 |
return this; |
95 |
} |
96 |
|
97 |
@Override
|
98 |
public GeometryParameter srs(IProjection srs) {
|
99 |
this.srs = new ProjectionConstant(this.builder, srs); |
100 |
if( this.type == PARAMETER_TYPE_VARIABLE ) { |
101 |
this.type = PARAMETER_TYPE_GEOMETRY;
|
102 |
} |
103 |
return this; |
104 |
} |
105 |
|
106 |
@Override
|
107 |
public GeometryParameter srs(Value srs) {
|
108 |
this.srs = srs;
|
109 |
if( this.type == PARAMETER_TYPE_VARIABLE ) { |
110 |
this.type = PARAMETER_TYPE_GEOMETRY;
|
111 |
} |
112 |
return this; |
113 |
} |
114 |
|
115 |
@Override
|
116 |
public Value srs() {
|
117 |
return this.srs; |
118 |
} |
119 |
|
120 |
@Override
|
121 |
public Geometry geometry() {
|
122 |
return (Geometry) this.value; |
123 |
} |
124 |
|
125 |
@Override
|
126 |
public GeometryParameter name(String value) { |
127 |
return (GeometryParameter) super.name(value); |
128 |
} |
129 |
|
130 |
@Override
|
131 |
public GeometryParameter as_variable() {
|
132 |
return (GeometryParameter) super.as_variable(); |
133 |
} |
134 |
|
135 |
@Override
|
136 |
public GeometryParameter as_geometry_variable() {
|
137 |
this.type = PARAMETER_TYPE_GEOMETRY;
|
138 |
if (this.value == null && this.name != null) { |
139 |
this.value = this.name; |
140 |
} |
141 |
return this; |
142 |
} |
143 |
|
144 |
@Override
|
145 |
public boolean is_geometry_variable() { |
146 |
return this.type == PARAMETER_TYPE_GEOMETRY; |
147 |
} |
148 |
|
149 |
@Override
|
150 |
public GeometryParameter as_constant() {
|
151 |
return (GeometryParameter) super.as_constant(); |
152 |
} |
153 |
|
154 |
@Override
|
155 |
public String name() { |
156 |
if( this.type == PARAMETER_TYPE_VARIABLE ) { |
157 |
return this.name; |
158 |
} |
159 |
return super.name(); |
160 |
} |
161 |
|
162 |
@Override
|
163 |
public Object value() { |
164 |
try {
|
165 |
switch (this.type) { |
166 |
case PARAMETER_TYPE_CONSTANT:
|
167 |
if( this.value instanceof Geometry ) { |
168 |
switch (this.builder.geometry_support_type()) { |
169 |
case EWKB:
|
170 |
return GeometryUtils.toEWKB(this.geometry()); |
171 |
case WKB:
|
172 |
return GeometryUtils.toWKB(this.geometry()); |
173 |
case WKT:
|
174 |
default:
|
175 |
return GeometryUtils.toWKT(this.geometry()); |
176 |
} |
177 |
} |
178 |
if( this.value instanceof IProjection ) { |
179 |
return this.builder.srs_id((IProjection) this.value); |
180 |
} |
181 |
return this.value; |
182 |
case PARAMETER_TYPE_VARIABLE:
|
183 |
case PARAMETER_TYPE_GEOMETRY:
|
184 |
default:
|
185 |
return this.name; |
186 |
} |
187 |
} catch (Exception ex) { |
188 |
throw new RuntimeException("Can't get value from parameter.", ex); |
189 |
} |
190 |
} |
191 |
|
192 |
@Override
|
193 |
public String toString(Formatter<Value> formatter) { |
194 |
if( formatter!=null && formatter.canApply(this) ) { |
195 |
return formatter.format(this); |
196 |
} |
197 |
switch (this.type) { |
198 |
case PARAMETER_TYPE_CONSTANT:
|
199 |
if( this.value instanceof Geometry ) { |
200 |
switch (this.builder.geometry_support_type()) { |
201 |
case EWKB:
|
202 |
return MessageFormat.format( |
203 |
FORMAT_ST_GEOMFROMEWKB, |
204 |
"?",
|
205 |
this.getSRS(formatter)
|
206 |
); |
207 |
case WKB:
|
208 |
return MessageFormat.format( |
209 |
FORMAT_ST_GEOMFROMWKB, |
210 |
"?",
|
211 |
this.getSRS(formatter)
|
212 |
); |
213 |
case WKT:
|
214 |
default:
|
215 |
return MessageFormat.format( |
216 |
FORMAT_ST_GEOMFROMTEXT, |
217 |
"?",
|
218 |
this.getSRS(formatter)
|
219 |
); |
220 |
} |
221 |
} |
222 |
case PARAMETER_TYPE_VARIABLE:
|
223 |
default:
|
224 |
return "?"; |
225 |
case PARAMETER_TYPE_GEOMETRY:
|
226 |
switch (this.builder.geometry_support_type()) { |
227 |
case EWKB:
|
228 |
return MessageFormat.format( |
229 |
FORMAT_ST_GEOMFROMEWKB, |
230 |
"?",
|
231 |
getSRS(formatter) |
232 |
); |
233 |
case WKB:
|
234 |
return MessageFormat.format( |
235 |
FORMAT_ST_GEOMFROMWKB, |
236 |
"?",
|
237 |
getSRS(formatter) |
238 |
); |
239 |
case WKT:
|
240 |
default:
|
241 |
return MessageFormat.format( |
242 |
FORMAT_ST_GEOMFROMTEXT, |
243 |
"?",
|
244 |
getSRS(formatter) |
245 |
); |
246 |
} |
247 |
} |
248 |
} |
249 |
|
250 |
private String getSRS(Formatter formatter) { |
251 |
if( this.srs!=null ) { |
252 |
return this.srs.toString(formatter); |
253 |
} |
254 |
if( this.value instanceof Geometry ) { |
255 |
IProjection proj = ((Geometry)this.value).getProjection();
|
256 |
Object s = this.builder.srs_id(proj); |
257 |
if( s == null ) { |
258 |
throw new IllegalArgumentException("A parameter of type Geometry with an invalid SRS."); |
259 |
} |
260 |
return s.toString();
|
261 |
} |
262 |
throw new IllegalArgumentException("The parameter of type Geometry need a SRS."); |
263 |
} |
264 |
|
265 |
} |
266 |
|
267 |
//
|
268 |
// public static class ProjectionParameterBase
|
269 |
// extends ParameterBase
|
270 |
// implements Parameter {
|
271 |
//
|
272 |
// protected GeometryExpressionBuilderHelper builder;
|
273 |
//
|
274 |
// public ProjectionParameterBase(GeometryExpressionBuilderHelper builder) {
|
275 |
// this.builder = builder;
|
276 |
// }
|
277 |
//
|
278 |
// @Override
|
279 |
// public Parameter value(Object value) {
|
280 |
// if( !(value instanceof IProjection) ) {
|
281 |
// throw new IllegalArgumentException("Only IProjection are allowed.");
|
282 |
// }
|
283 |
// return super.value(value);
|
284 |
// }
|
285 |
//
|
286 |
// @Override
|
287 |
// public Object value() {
|
288 |
// try {
|
289 |
// switch (this.type) {
|
290 |
// case PARAMETER_TYPE_CONSTANT:
|
291 |
// return this.builder.srs_id((IProjection) this.value);
|
292 |
// case PARAMETER_TYPE_VARIABLE:
|
293 |
// default:
|
294 |
// return this.value;
|
295 |
// }
|
296 |
// } catch (Exception ex) {
|
297 |
// throw new RuntimeException("Can't get value from parameter.", ex);
|
298 |
// }
|
299 |
// }
|
300 |
// }
|
301 |
|
302 |
public static class GeometryConstant extends AbstractValue implements Constant { |
303 |
|
304 |
protected Geometry geometry;
|
305 |
protected GeometryExpressionBuilderHelper builder;
|
306 |
|
307 |
public GeometryConstant(GeometryExpressionBuilderHelper builder, Geometry geometry) {
|
308 |
this.builder = builder;
|
309 |
this.geometry = geometry;
|
310 |
} |
311 |
|
312 |
@Override
|
313 |
public String toString(Formatter<Value> formatter) { |
314 |
if( formatter!=null && formatter.canApply(this) ) { |
315 |
return formatter.format(this); |
316 |
} |
317 |
try {
|
318 |
switch (this.builder.geometry_support_type()) { |
319 |
case EWKB:
|
320 |
return MessageFormat.format( |
321 |
FORMAT_ST_GEOMFROMEWKB, |
322 |
"DECODE('"+this.builder.builder().bytearray_hex(GeometryUtils.toEWKB(geometry))+"','hex')", |
323 |
this.getSRS()
|
324 |
); |
325 |
case WKB:
|
326 |
return MessageFormat.format( |
327 |
FORMAT_ST_GEOMFROMWKB, |
328 |
"DECODE('"+this.builder.builder().bytearray_hex(GeometryUtils.toWKB(geometry))+"','hex')", |
329 |
this.getSRS()
|
330 |
); |
331 |
case WKT:
|
332 |
default:
|
333 |
return MessageFormat.format( |
334 |
FORMAT_ST_GEOMFROMTEXT, |
335 |
this.builder.builder().string(GeometryUtils.toWKT(geometry)),
|
336 |
this.getSRS()
|
337 |
); |
338 |
} |
339 |
} catch(Throwable th) { |
340 |
throw th;
|
341 |
} |
342 |
} |
343 |
|
344 |
@Override
|
345 |
public Object value() { |
346 |
return this.geometry; |
347 |
} |
348 |
|
349 |
private String getSRS() { |
350 |
IProjection proj = this.geometry.getProjection();
|
351 |
Object s = this.builder.srs_id(proj); |
352 |
if( s == null ) { |
353 |
throw new IllegalArgumentException("A parameter of type Geometry with an invalid SRS."); |
354 |
} |
355 |
return s.toString();
|
356 |
} |
357 |
|
358 |
} |
359 |
|
360 |
public static class ProjectionConstant extends AbstractValue implements Constant { |
361 |
|
362 |
protected IProjection projection;
|
363 |
protected GeometryExpressionBuilderHelper builder;
|
364 |
|
365 |
public ProjectionConstant(GeometryExpressionBuilderHelper builder, IProjection projection) {
|
366 |
this.projection = projection;
|
367 |
this.builder = builder;
|
368 |
} |
369 |
|
370 |
@Override
|
371 |
public String toString(Formatter<Value> formatter) { |
372 |
if( formatter!=null && formatter.canApply(this) ) { |
373 |
return formatter.format(this); |
374 |
} |
375 |
return Objects.toString(this.builder.srs_id(this.projection)); |
376 |
} |
377 |
|
378 |
@Override
|
379 |
public Object value() { |
380 |
return this.projection; |
381 |
} |
382 |
|
383 |
} |
384 |
|
385 |
protected GeometrySupportType geometrySupportType;
|
386 |
protected ExpressionBuilder builder;
|
387 |
|
388 |
public DefaultGeometryExpressionBuilderHelper(ExpressionBuilder builder) {
|
389 |
this.builder = builder;
|
390 |
this.geometrySupportType = GeometrySupportType.WKB;
|
391 |
} |
392 |
|
393 |
public DefaultGeometryExpressionBuilderHelper() {
|
394 |
this.geometrySupportType = GeometrySupportType.WKB;
|
395 |
} |
396 |
|
397 |
@Override
|
398 |
public ExpressionBuilder builder() {
|
399 |
return this.builder; |
400 |
} |
401 |
|
402 |
@Override
|
403 |
public GeometrySupportType geometry_support_type() {
|
404 |
return this.geometrySupportType; |
405 |
} |
406 |
|
407 |
@Override
|
408 |
public GeometryExpressionBuilderHelper geometry_support_type(GeometrySupportType geometrySupportType) {
|
409 |
this.geometrySupportType = geometrySupportType;
|
410 |
return this; |
411 |
} |
412 |
|
413 |
@Override
|
414 |
public Object srs_id(IProjection projection) { |
415 |
if( projection==null ) { |
416 |
return 0; |
417 |
} |
418 |
return ProjectionUtils.getCode(projection);
|
419 |
} |
420 |
|
421 |
@Override
|
422 |
public Constant srs(IProjection projection) {
|
423 |
return new ProjectionConstant(this, projection); |
424 |
} |
425 |
|
426 |
@Override
|
427 |
public Constant geometry(Geometry geom, IProjection projection) {
|
428 |
geom.setProjection(projection); |
429 |
return new GeometryConstant(this, geom); |
430 |
} |
431 |
|
432 |
@Override
|
433 |
public Constant geometry(Geometry geom) {
|
434 |
if( geom.getProjection()==null ) { |
435 |
throw new IllegalArgumentException("The geometry does not have an associated projection. Use 'geometry(Geometry, IProjection)'."); |
436 |
} |
437 |
return new GeometryConstant(this, geom); |
438 |
} |
439 |
|
440 |
@Override
|
441 |
public Constant envelope(Envelope envelope, IProjection projection) {
|
442 |
Geometry geom = envelope.getGeometry(); |
443 |
geom.setProjection(projection); |
444 |
return new GeometryConstant(this, geom); |
445 |
} |
446 |
|
447 |
@Override
|
448 |
public Constant envelope(Envelope envelope) {
|
449 |
if( envelope.getProjection()==null ) { |
450 |
throw new IllegalArgumentException("The envelope does not have an associated projection. Use 'envelope(Geometry, IProjection)'."); |
451 |
} |
452 |
Geometry geom = envelope.getGeometry(); |
453 |
return new GeometryConstant(this, geom); |
454 |
} |
455 |
|
456 |
@Override
|
457 |
public GeometryParameter parameter() {
|
458 |
GeometryParameterBase p = new GeometryParameterBase(this); |
459 |
return p;
|
460 |
} |
461 |
|
462 |
@Override
|
463 |
public GeometryParameter parameter(String name) { |
464 |
GeometryParameterBase p = new GeometryParameterBase(this); |
465 |
p.name(name); |
466 |
return p;
|
467 |
} |
468 |
|
469 |
@Override
|
470 |
public GeometryParameter parameter(Object value) { |
471 |
GeometryParameterBase p = new GeometryParameterBase(this); |
472 |
p.value(value); |
473 |
return p;
|
474 |
} |
475 |
|
476 |
public Function builtin_function(String name, String format, Value... values) { |
477 |
FunctionBase func = new FunctionBase(name, format);
|
478 |
for (Value theValue : values) {
|
479 |
func.parameter(theValue); |
480 |
} |
481 |
return func;
|
482 |
} |
483 |
|
484 |
public Function function(String name, Value... values) { |
485 |
FunctionBase func = new FunctionBase(name);
|
486 |
for (Value theValue : values) {
|
487 |
func.parameter(theValue); |
488 |
} |
489 |
return func;
|
490 |
} |
491 |
|
492 |
@Override
|
493 |
public Function as_geometry(Value value) {
|
494 |
return builtin_function(FUNCTION_ST_ASBINARY, FORMAT_ST_ASBINARY, value);
|
495 |
} |
496 |
|
497 |
@Override
|
498 |
public Function ST_Intersects(Value geom1, Value geom2) {
|
499 |
return builtin_function(FUNCTION_ST_INTERSECTS, FORMAT_ST_INTERSECTS, geom1, geom2);
|
500 |
} |
501 |
|
502 |
@Override
|
503 |
public Function ST_SRID(Value geom) {
|
504 |
return builtin_function(FUNCTION_ST_SRID, FORMAT_ST_SRID, geom);
|
505 |
} |
506 |
|
507 |
@Override
|
508 |
public Function ST_Envelope(Value geom) {
|
509 |
return builtin_function(FUNCTION_ST_ENVELOPE, FORMAT_ST_ENVELOPE, geom);
|
510 |
} |
511 |
|
512 |
@Override
|
513 |
public Function ST_Force2D(Value geom) {
|
514 |
return builtin_function(FUNCTION_ST_FORCE2D, FORMAT_ST_FORCE2D, geom);
|
515 |
} |
516 |
|
517 |
@Override
|
518 |
public Function ST_AsText(Value geom) {
|
519 |
return builtin_function(FUNCTION_ST_ASTEXT, FORMAT_ST_ASTEXT, geom);
|
520 |
} |
521 |
|
522 |
@Override
|
523 |
public Function ST_AsBinary(Value geom) {
|
524 |
return builtin_function(FUNCTION_ST_ASBINARY, FORMAT_ST_ASBINARY, geom);
|
525 |
} |
526 |
|
527 |
@Override
|
528 |
public Function ST_AsEWKB(Value geom) {
|
529 |
return builtin_function(FUNCTION_ST_ASEWKB, FORMAT_ST_ASEWKB, geom);
|
530 |
} |
531 |
|
532 |
@Override
|
533 |
public Function ST_GeomFromText(Value geom, Value crs) {
|
534 |
return builtin_function(FUNCTION_ST_GEOMFROMTEXT, FORMAT_ST_GEOMFROMTEXT, geom, crs);
|
535 |
} |
536 |
|
537 |
@Override
|
538 |
public Function ST_GeomFromWKB(Value geom, Value crs) {
|
539 |
return builtin_function(FUNCTION_ST_GEOMFROMWKB, FORMAT_ST_GEOMFROMWKB, geom, crs);
|
540 |
} |
541 |
|
542 |
@Override
|
543 |
public Function ST_GeomFromEWKB(Value geom, Value crs) {
|
544 |
return builtin_function(FUNCTION_ST_GEOMFROMEWKB, FORMAT_ST_GEOMFROMEWKB, geom, crs);
|
545 |
} |
546 |
|
547 |
@Override
|
548 |
public Function ST_Simplify(Value geom, Value tolerance) {
|
549 |
return builtin_function(FUNCTION_ST_SIMPLIFY, FORMAT_ST_SIMPLIFY, tolerance);
|
550 |
} |
551 |
|
552 |
@Override
|
553 |
public Function ST_Disjoint(Value geom1, Value geom2) {
|
554 |
return builtin_function(FUNCTION_ST_DISJOINT, FORMAT_ST_DISJOINT, geom1, geom2);
|
555 |
} |
556 |
|
557 |
@Override
|
558 |
public Function ST_Contains(Value geom1, Value geom2) {
|
559 |
return builtin_function(FUNCTION_ST_CONTAINS, FORMAT_ST_CONTAINS, geom1, geom2);
|
560 |
} |
561 |
|
562 |
@Override
|
563 |
public Function ST_Equals(Value geom1, Value geom2) {
|
564 |
return builtin_function(FUNCTION_ST_EQUALS, FORMAT_ST_EQUALS, geom1, geom2);
|
565 |
} |
566 |
|
567 |
@Override
|
568 |
public Function ST_Crosses(Value geom1, Value geom2) {
|
569 |
return builtin_function(FUNCTION_ST_CROSSES, FORMAT_ST_CROSSES, geom1, geom2);
|
570 |
} |
571 |
|
572 |
@Override
|
573 |
public Function ST_IsClosed(Value geom) {
|
574 |
return builtin_function(FUNCTION_ST_ISCLOSED, FORMAT_ST_ISCLOSED, geom);
|
575 |
} |
576 |
|
577 |
@Override
|
578 |
public Function ST_Overlaps(Value geom1, Value geom2) {
|
579 |
return builtin_function(FUNCTION_ST_OVERLAPS, FORMAT_ST_OVERLAPS, geom1, geom2);
|
580 |
} |
581 |
|
582 |
@Override
|
583 |
public Function ST_Touches(Value geom1, Value geom2) {
|
584 |
return builtin_function(FUNCTION_ST_TOUCHES, FORMAT_ST_TOUCHES, geom1, geom2);
|
585 |
} |
586 |
|
587 |
@Override
|
588 |
public Function ST_Within(Value geom1, Value geom2) {
|
589 |
return builtin_function("ST_Within", FORMAT_ST_WITHIN, geom1, geom2); |
590 |
} |
591 |
|
592 |
@Override
|
593 |
public Function ST_Area(Value geom) {
|
594 |
return function("ST_Area", geom); |
595 |
} |
596 |
|
597 |
@Override
|
598 |
public Function ST_Buffer(Value geom) {
|
599 |
return function("ST_Buffer", geom); |
600 |
} |
601 |
|
602 |
@Override
|
603 |
public Function ST_Buffer(Value geom, Value dist) {
|
604 |
return function("ST_Buffer", geom, dist); |
605 |
} |
606 |
|
607 |
@Override
|
608 |
public Function ST_Centroid(Value geom) {
|
609 |
return function("ST_Centroid", geom); |
610 |
} |
611 |
|
612 |
@Override
|
613 |
public Function ST_CoveredBy(Value geom1, Value geom2) {
|
614 |
return function("ST_CoveredBy", geom1, geom2); |
615 |
} |
616 |
|
617 |
@Override
|
618 |
public Function ST_Covers(Value geom1, Value geom2) {
|
619 |
return function("ST_Covers", geom1, geom2); |
620 |
} |
621 |
|
622 |
@Override
|
623 |
public Function ST_Diference(Value geom1, Value geom2) {
|
624 |
return function("ST_Diference", geom1, geom2); |
625 |
} |
626 |
|
627 |
@Override
|
628 |
public Function ST_Dimension(Value geom) {
|
629 |
return function("ST_Dimension", geom); |
630 |
} |
631 |
|
632 |
@Override
|
633 |
public Function ST_Distance(Value geom1, Value geom2) {
|
634 |
return function("ST_Distance", geom1, geom2); |
635 |
} |
636 |
|
637 |
@Override
|
638 |
public Function ST_EndPoint(Value geom) {
|
639 |
return function("ST_EndPoint", geom); |
640 |
} |
641 |
|
642 |
@Override
|
643 |
public Function ST_Intersection(Value geom1, Value geom2) {
|
644 |
return function("ST_Intersection", geom1, geom2); |
645 |
} |
646 |
|
647 |
@Override
|
648 |
public Function ST_IsSimple(Value geom) {
|
649 |
return function("ST_IsSimple", geom); |
650 |
} |
651 |
|
652 |
@Override
|
653 |
public Function ST_IsValid(Value geom) {
|
654 |
return function("ST_IsValid", geom); |
655 |
} |
656 |
|
657 |
@Override
|
658 |
public Function ST_NumGeometries(Value geom) {
|
659 |
return function("ST_NumGeometries", geom); |
660 |
} |
661 |
|
662 |
@Override
|
663 |
public Function ST_NumPoints(Value geom) {
|
664 |
return function("ST_NumPoints", geom); |
665 |
} |
666 |
|
667 |
@Override
|
668 |
public Function ST_Perimeter(Value geom) {
|
669 |
return function("ST_Perimeter", geom); |
670 |
} |
671 |
|
672 |
@Override
|
673 |
public Function ST_PointN(Value geom, Value n) {
|
674 |
return function("ST_PointN", geom, n); |
675 |
} |
676 |
|
677 |
@Override
|
678 |
public Function ST_StartPoint(Value geom) {
|
679 |
return function("ST_StartPoint", geom); |
680 |
} |
681 |
|
682 |
@Override
|
683 |
public Function ST_Union(Value geom1, Value geom2) {
|
684 |
return function("ST_Union", geom1, geom2); |
685 |
} |
686 |
|
687 |
@Override
|
688 |
public Function ST_X(Value geom) {
|
689 |
return function("ST_X", geom); |
690 |
} |
691 |
|
692 |
@Override
|
693 |
public Function ST_Y(Value geom) {
|
694 |
return function("ST_Y", geom); |
695 |
} |
696 |
|
697 |
@Override
|
698 |
public Function ST_Z(Value geom) {
|
699 |
return function("ST_Z", geom); |
700 |
} |
701 |
|
702 |
@Override
|
703 |
public Function ST_ExtentAggregate(Value geom) {
|
704 |
return function(FUNCTION_ST_EXTENTAGGREGATE, geom);
|
705 |
} |
706 |
|
707 |
@Override
|
708 |
public Function ST_UnionAggregate(Value geom) {
|
709 |
return function(FUNCTION_ST_UNIONAGGREGATE, geom);
|
710 |
} |
711 |
|
712 |
@Override
|
713 |
public Function ST_Point(Value x, Value y) {
|
714 |
return function(FUNCTION_ST_POINT, x, y);
|
715 |
} |
716 |
|
717 |
@Override
|
718 |
public Function ST_MakePoint(Value x, Value y) {
|
719 |
return function(FUNCTION_ST_MAKEPOINT, x, y);
|
720 |
} |
721 |
|
722 |
@Override
|
723 |
public Function ST_MakePoint(Value x, Value y, Value z) {
|
724 |
return function(FUNCTION_ST_MAKEPOINT, x, y, z);
|
725 |
} |
726 |
|
727 |
@Override
|
728 |
public Function ST_MakePoint(Value x, Value y, Value z, Value m) {
|
729 |
return function(FUNCTION_ST_MAKEPOINT, x, y, z, m);
|
730 |
} |
731 |
|
732 |
@Override
|
733 |
public Function ST_SetSRID(Value geom, Value srid) {
|
734 |
return function(FUNCTION_ST_POINT, geom, srid);
|
735 |
} |
736 |
|
737 |
} |