svn-gvsig-desktop / branches / v02_desarrollo / libraries / sld / temp / org.gvsig.sldsupport.lib.api / src / main / java / org / gvsig / sldsupport / sld / filter / operator / spatial / SLDBinarySpatialOperator.java @ 40790
History | View | Annotate | Download (1.92 KB)
1 |
package org.gvsig.sldsupport.sld.filter.operator.spatial; |
---|---|
2 |
|
3 |
import org.gvsig.sldsupport.sld.filter.operator.SLDSpatialOperator; |
4 |
|
5 |
public class SLDBinarySpatialOperator extends SLDSpatialOperator { |
6 |
|
7 |
public static String BINARY_OPERATOR_EQUALS = "Equals"; |
8 |
public static String BINARY_OPERATOR_DISJOINT = "Disjoint"; |
9 |
public static String BINARY_OPERATOR_TOUCHES = "Touches"; |
10 |
public static String BINARY_OPERATOR_WITHIN = "Within"; |
11 |
public static String BINARY_OPERATOR_OVERLAPS = "Overlaps"; |
12 |
public static String BINARY_OPERATOR_CROSSES = "Crosses"; |
13 |
public static String BINARY_OPERATOR_INTERSECTS = "Intersects"; |
14 |
public static String BINARY_OPERATOR_CONTAINS = "Contains"; |
15 |
|
16 |
protected String operatorName = null; |
17 |
protected String literalGeometryOrEnvelope = null; |
18 |
|
19 |
/*
|
20 |
* Utility boolean to determine if string is literal
|
21 |
* geometry or literal envelope, so one of the two
|
22 |
* methods getEnvelope/getGeometry will return null
|
23 |
*/
|
24 |
protected boolean isGeometry = false; |
25 |
|
26 |
public SLDBinarySpatialOperator() {
|
27 |
} |
28 |
|
29 |
public void setIsGeometry(boolean isGeo) { |
30 |
isGeometry = isGeo; |
31 |
} |
32 |
|
33 |
public void setLiteral(String lit) { |
34 |
literalGeometryOrEnvelope = lit; |
35 |
} |
36 |
|
37 |
public void setOperatorName(String oname) { |
38 |
operatorName = oname; |
39 |
} |
40 |
|
41 |
|
42 |
public String getOperatorName() { |
43 |
return operatorName;
|
44 |
} |
45 |
|
46 |
|
47 |
|
48 |
|
49 |
/**
|
50 |
* The literal geometry to use in the Operator (WKT format).
|
51 |
* One of the two will be null. getGeometry() is checked first.
|
52 |
*
|
53 |
* @return
|
54 |
*/
|
55 |
public String getGeometry() { |
56 |
if (isGeometry) {
|
57 |
return literalGeometryOrEnvelope;
|
58 |
} else {
|
59 |
return null; |
60 |
} |
61 |
} |
62 |
|
63 |
/**
|
64 |
* The literal envelope to use in the Operator (WKT format).
|
65 |
* One of the two will be null. getGeometry() is checked first.
|
66 |
* @return
|
67 |
*/
|
68 |
public String getEnvelope() { |
69 |
if (isGeometry) {
|
70 |
return null; |
71 |
} else {
|
72 |
return literalGeometryOrEnvelope;
|
73 |
} |
74 |
} |
75 |
|
76 |
|
77 |
|
78 |
} |