Revision 44043
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/layers/vectorial/OutGeometryEvaluator.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import org.cresques.cts.ICoordTrans; |
26 | 26 |
import org.cresques.cts.IProjection; |
27 |
import org.gvsig.fmap.dal.ExpressionBuilder;
|
|
27 |
import org.gvsig.expressionevaluator.ExpressionBuilder;
|
|
28 | 28 |
import org.gvsig.fmap.dal.feature.Feature; |
29 | 29 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
30 | 30 |
import org.gvsig.fmap.dal.feature.FeatureType; |
... | ... | |
42 | 42 |
private final ExpressionBuilder builder; |
43 | 43 |
private final IProjection projection; |
44 | 44 |
private final FeatureAttributeDescriptor fad; |
45 |
|
|
46 |
/** |
|
47 |
* @param geometry |
|
48 |
* @param envelopeProjection |
|
49 |
* @param featureType |
|
50 |
* @param geomName |
|
51 |
* @deprecated use @{link org.gvsig.fmap.mapcontext.layers.vectorial.SpatialEvaluatorsFactory} |
|
52 |
*/ |
|
53 |
public OutGeometryEvaluator( |
|
54 |
Geometry geometry, |
|
55 |
IProjection envelopeProjection, |
|
56 |
FeatureType featureType, |
|
57 |
String geomName |
|
58 |
) { |
|
59 |
this( |
|
60 |
geometry, |
|
61 |
envelopeProjection, |
|
62 |
featureType, |
|
63 |
geomName, |
|
64 |
SpatialEvaluatorsFactory.getInstance().createBuilder() |
|
65 |
); |
|
66 |
} |
|
67 | 45 |
|
68 | 46 |
OutGeometryEvaluator( |
69 | 47 |
Geometry geometry, |
... | ... | |
127 | 105 |
builder.not( |
128 | 106 |
builder.ST_Contains( |
129 | 107 |
builder.geometry(geometry, projection), |
130 |
builder.column(fad) |
|
108 |
builder.column(fad.getName())
|
|
131 | 109 |
) |
132 | 110 |
) |
133 | 111 |
).toString(); |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/layers/vectorial/TouchesGeometryEvaluator.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import org.cresques.cts.ICoordTrans; |
26 | 26 |
import org.cresques.cts.IProjection; |
27 |
import org.gvsig.fmap.dal.ExpressionBuilder;
|
|
27 |
import org.gvsig.expressionevaluator.ExpressionBuilder;
|
|
28 | 28 |
import org.gvsig.fmap.dal.feature.Feature; |
29 | 29 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
30 | 30 |
import org.gvsig.fmap.dal.feature.FeatureType; |
... | ... | |
42 | 42 |
private final ExpressionBuilder builder; |
43 | 43 |
private final IProjection projection; |
44 | 44 |
private final FeatureAttributeDescriptor fad; |
45 |
|
|
46 |
/** |
|
47 |
* @param geometry |
|
48 |
* @param projection |
|
49 |
* @param featureType |
|
50 |
* @param geomName |
|
51 |
* @deprecated use @{link org.gvsig.fmap.mapcontext.layers.vectorial.SpatialEvaluatorsFactory} |
|
52 |
*/ |
|
53 |
public TouchesGeometryEvaluator(Geometry geometry, |
|
54 |
IProjection projection, |
|
55 |
FeatureType featureType, |
|
56 |
String geomName |
|
57 |
) { |
|
58 |
this( |
|
59 |
geometry, |
|
60 |
projection, |
|
61 |
featureType, |
|
62 |
geomName, |
|
63 |
SpatialEvaluatorsFactory.getInstance().createBuilder() |
|
64 |
); |
|
65 |
} |
|
66 | 45 |
|
67 | 46 |
TouchesGeometryEvaluator(Geometry geometry, |
68 | 47 |
IProjection projection, |
... | ... | |
124 | 103 |
return this.builder.set( |
125 | 104 |
builder.ST_Touches( |
126 | 105 |
builder.geometry(geometry, projection), |
127 |
builder.column(fad) |
|
106 |
builder.column(fad.getName())
|
|
128 | 107 |
) |
129 | 108 |
).toString(); |
130 | 109 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/layers/vectorial/CrossEnvelopeEvaluator.java | ||
---|---|---|
23 | 23 |
package org.gvsig.fmap.mapcontext.layers.vectorial; |
24 | 24 |
|
25 | 25 |
import org.cresques.cts.IProjection; |
26 |
import org.gvsig.fmap.dal.ExpressionBuilder;
|
|
26 |
import org.gvsig.expressionevaluator.ExpressionBuilder;
|
|
27 | 27 |
|
28 | 28 |
import org.gvsig.fmap.dal.feature.Feature; |
29 | 29 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
... | ... | |
43 | 43 |
private final ExpressionBuilder builder; |
44 | 44 |
private final IProjection projection; |
45 | 45 |
private final FeatureAttributeDescriptor fad; |
46 |
|
|
47 |
/** |
|
48 |
* @param envelope |
|
49 |
* @param envelopeProjection |
|
50 |
* @param featureType |
|
51 |
* @param geomName |
|
52 |
* @deprecated use @{link org.gvsig.fmap.mapcontext.layers.vectorial.SpatialEvaluatorsFactory} |
|
53 |
*/ |
|
54 |
public CrossEnvelopeEvaluator( |
|
55 |
Envelope envelope, |
|
56 |
IProjection envelopeProjection, |
|
57 |
FeatureType featureType, |
|
58 |
String geomName |
|
59 |
) { |
|
60 |
this( |
|
61 |
envelope, |
|
62 |
envelopeProjection, |
|
63 |
featureType, |
|
64 |
geomName, |
|
65 |
SpatialEvaluatorsFactory.getInstance().createBuilder() |
|
66 |
); |
|
67 |
} |
|
68 | 46 |
|
69 | 47 |
CrossEnvelopeEvaluator( |
70 | 48 |
Envelope envelope, |
... | ... | |
79 | 57 |
this.envelope = envelope; |
80 | 58 |
this.projection = envelopeProjection; |
81 | 59 |
this.builder = builder; |
82 |
// this.srs = envelopeProjection.getAbrev(); |
|
83 |
// this.projection=CRSFactory.getCRS(fad.getSRS()); |
|
84 |
// this.envelopeProjection=envelopeProjection; |
|
85 |
// ICoordTrans ct = null; |
|
86 |
// if (!this.srs.equals(fad.getSRS())) { // FIXME comparaci�n |
|
87 |
// ct = envelopeProjection.getCT(fad.getSRS()); |
|
88 |
// } |
|
89 |
// if (ct != null) { |
|
90 |
// this.envelopeTrans = envelope.convert(ct); |
|
91 |
// } else { |
|
92 | 60 |
this.envelopeTrans = envelope; |
93 |
// } |
|
94 | 61 |
this.geomName = geomName; |
95 | 62 |
|
96 | 63 |
this.getFieldsInfo().addMatchFieldValue(geomName, envelopeTrans); |
97 |
|
|
98 | 64 |
} |
99 | 65 |
|
100 | 66 |
@Override |
... | ... | |
128 | 94 |
return this.builder.set( |
129 | 95 |
builder.ST_Intersects( |
130 | 96 |
builder.envelope(envelope, projection), |
131 |
builder.ST_Envelope(builder.column(fad)) |
|
97 |
builder.ST_Envelope(builder.column(fad.getName()))
|
|
132 | 98 |
) |
133 | 99 |
).toString(); |
134 | 100 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/layers/vectorial/ContainsGeometryEvaluator.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import org.cresques.cts.ICoordTrans; |
26 | 26 |
import org.cresques.cts.IProjection; |
27 |
import org.gvsig.fmap.dal.ExpressionBuilder;
|
|
27 |
import org.gvsig.expressionevaluator.ExpressionBuilder;
|
|
28 | 28 |
import org.gvsig.fmap.dal.feature.Feature; |
29 | 29 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
30 | 30 |
import org.gvsig.fmap.dal.feature.FeatureType; |
... | ... | |
43 | 43 |
private final ExpressionBuilder builder; |
44 | 44 |
private final IProjection projection; |
45 | 45 |
private final FeatureAttributeDescriptor fad; |
46 |
|
|
47 |
/** |
|
48 |
* @param geometry |
|
49 |
* @param projection |
|
50 |
* @param featureType |
|
51 |
* @param geomName |
|
52 |
* @deprecated use @{link org.gvsig.fmap.mapcontext.layers.vectorial.SpatialEvaluatorsFactory} |
|
53 |
*/ |
|
54 |
public ContainsGeometryEvaluator( |
|
55 |
Geometry geometry, |
|
56 |
IProjection projection, |
|
57 |
FeatureType featureType, |
|
58 |
String geomName |
|
59 |
) { |
|
60 |
this( |
|
61 |
geometry, |
|
62 |
projection, |
|
63 |
featureType, |
|
64 |
geomName, |
|
65 |
SpatialEvaluatorsFactory.getInstance().createBuilder() |
|
66 |
); |
|
67 |
} |
|
68 |
|
|
46 |
|
|
69 | 47 |
ContainsGeometryEvaluator( |
70 | 48 |
Geometry geometry, |
71 | 49 |
IProjection projection, |
... | ... | |
127 | 105 |
return this.builder.set( |
128 | 106 |
builder.ST_Contains( |
129 | 107 |
builder.geometry(geometry, projection), |
130 |
builder.column(fad) |
|
108 |
builder.column(fad.getName())
|
|
131 | 109 |
) |
132 | 110 |
).toString(); |
133 | 111 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/layers/vectorial/CrossesGeometryEvaluator.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import org.cresques.cts.ICoordTrans; |
26 | 26 |
import org.cresques.cts.IProjection; |
27 |
import org.gvsig.fmap.dal.ExpressionBuilder;
|
|
27 |
import org.gvsig.expressionevaluator.ExpressionBuilder;
|
|
28 | 28 |
import org.gvsig.fmap.dal.feature.Feature; |
29 | 29 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
30 | 30 |
import org.gvsig.fmap.dal.feature.FeatureType; |
... | ... | |
43 | 43 |
private final IProjection projection; |
44 | 44 |
private final FeatureAttributeDescriptor fad; |
45 | 45 |
|
46 |
/** |
|
47 |
* @param geometry |
|
48 |
* @param projection |
|
49 |
* @param featureType |
|
50 |
* @param geomName |
|
51 |
* @deprecated use @{link org.gvsig.fmap.mapcontext.layers.vectorial.SpatialEvaluatorsFactory} |
|
52 |
*/ |
|
53 |
public CrossesGeometryEvaluator( |
|
54 |
Geometry geometry, |
|
55 |
IProjection projection, |
|
56 |
FeatureType featureType, |
|
57 |
String geomName |
|
58 |
) { |
|
59 |
this( |
|
60 |
geometry, |
|
61 |
projection, |
|
62 |
featureType, |
|
63 |
geomName, |
|
64 |
SpatialEvaluatorsFactory.getInstance().createBuilder() |
|
65 |
); |
|
66 |
} |
|
67 |
|
|
68 | 46 |
CrossesGeometryEvaluator( |
69 | 47 |
Geometry geometry, |
70 | 48 |
IProjection projection, |
... | ... | |
126 | 104 |
return this.builder.set( |
127 | 105 |
builder.ST_Crosses( |
128 | 106 |
builder.geometry(geometry, projection), |
129 |
builder.column(fad) |
|
107 |
builder.column(fad.getName())
|
|
130 | 108 |
) |
131 | 109 |
).toString(); |
132 | 110 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/layers/vectorial/DisjointGeometryEvaluator.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import org.cresques.cts.ICoordTrans; |
26 | 26 |
import org.cresques.cts.IProjection; |
27 |
import org.gvsig.fmap.dal.ExpressionBuilder;
|
|
27 |
import org.gvsig.expressionevaluator.ExpressionBuilder;
|
|
28 | 28 |
import org.gvsig.fmap.dal.feature.Feature; |
29 | 29 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
30 | 30 |
import org.gvsig.fmap.dal.feature.FeatureType; |
... | ... | |
43 | 43 |
private final ExpressionBuilder builder; |
44 | 44 |
private final IProjection projection; |
45 | 45 |
private final FeatureAttributeDescriptor fad; |
46 |
|
|
47 |
/** |
|
48 |
* @param geometry |
|
49 |
* @param projection |
|
50 |
* @param featureType |
|
51 |
* @param geomName |
|
52 |
* @deprecated use @{link org.gvsig.fmap.mapcontext.layers.vectorial.SpatialEvaluatorsFactory} |
|
53 |
*/ |
|
54 |
public DisjointGeometryEvaluator( |
|
55 |
Geometry geometry, |
|
56 |
IProjection projection, |
|
57 |
FeatureType featureType, |
|
58 |
String geomName |
|
59 |
) { |
|
60 |
this( |
|
61 |
geometry, |
|
62 |
projection, |
|
63 |
featureType, |
|
64 |
geomName, |
|
65 |
SpatialEvaluatorsFactory.getInstance().createBuilder() |
|
66 |
); |
|
67 |
} |
|
68 |
|
|
46 |
|
|
69 | 47 |
DisjointGeometryEvaluator( |
70 | 48 |
Geometry geometry, |
71 | 49 |
IProjection projection, |
... | ... | |
127 | 105 |
return this.builder.set( |
128 | 106 |
builder.ST_Disjoint( |
129 | 107 |
builder.geometry(geometry, projection), |
130 |
builder.column(fad) |
|
108 |
builder.column(fad.getName())
|
|
131 | 109 |
) |
132 | 110 |
).toString(); |
133 | 111 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/layers/vectorial/IntersectsGeometryEvaluator.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import org.cresques.cts.ICoordTrans; |
26 | 26 |
import org.cresques.cts.IProjection; |
27 |
import org.gvsig.fmap.dal.ExpressionBuilder;
|
|
27 |
import org.gvsig.expressionevaluator.ExpressionBuilder;
|
|
28 | 28 |
import org.gvsig.fmap.dal.feature.Feature; |
29 | 29 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
30 | 30 |
import org.gvsig.fmap.dal.feature.FeatureType; |
... | ... | |
42 | 42 |
private final ExpressionBuilder builder; |
43 | 43 |
private final IProjection projection; |
44 | 44 |
private final FeatureAttributeDescriptor fad; |
45 |
|
|
46 |
/** |
|
47 |
* @param geometry |
|
48 |
* @param projection |
|
49 |
* @param featureType |
|
50 |
* @param geomName |
|
51 |
* @deprecated use @{link org.gvsig.fmap.mapcontext.layers.vectorial.SpatialEvaluatorsFactory} |
|
52 |
*/ |
|
53 |
public IntersectsGeometryEvaluator( |
|
54 |
Geometry geometry, |
|
55 |
IProjection projection, |
|
56 |
FeatureType featureType, |
|
57 |
String geomName |
|
58 |
) { |
|
59 |
this( |
|
60 |
geometry, |
|
61 |
projection, |
|
62 |
featureType, |
|
63 |
geomName, |
|
64 |
SpatialEvaluatorsFactory.getInstance().createBuilder() |
|
65 |
); |
|
66 |
} |
|
67 |
|
|
45 |
|
|
68 | 46 |
IntersectsGeometryEvaluator( |
69 | 47 |
Geometry geometry, |
70 | 48 |
IProjection projection, |
... | ... | |
123 | 101 |
public String getSQL() { |
124 | 102 |
return builder.set( |
125 | 103 |
builder.ST_Intersects( |
126 |
builder.geometry(geometry, this.projection),
|
|
127 |
builder.column(this.fad)
|
|
104 |
builder.column(this.fad.getName()),
|
|
105 |
builder.geometry(geometry, this.projection)
|
|
128 | 106 |
) |
129 | 107 |
).toString(); |
130 | 108 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/layers/vectorial/EqualsGeometryEvaluator.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import org.cresques.cts.ICoordTrans; |
26 | 26 |
import org.cresques.cts.IProjection; |
27 |
import org.gvsig.fmap.dal.ExpressionBuilder;
|
|
27 |
import org.gvsig.expressionevaluator.ExpressionBuilder;
|
|
28 | 28 |
import org.gvsig.fmap.dal.feature.Feature; |
29 | 29 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
30 | 30 |
import org.gvsig.fmap.dal.feature.FeatureType; |
... | ... | |
43 | 43 |
private final IProjection projection; |
44 | 44 |
private final FeatureAttributeDescriptor fad; |
45 | 45 |
|
46 |
/** |
|
47 |
* @param geometry |
|
48 |
* @param projection |
|
49 |
* @param featureType |
|
50 |
* @param geomName |
|
51 |
* @deprecated use @{link org.gvsig.fmap.mapcontext.layers.vectorial.SpatialEvaluatorsFactory} |
|
52 |
*/ |
|
53 |
public EqualsGeometryEvaluator( |
|
54 |
Geometry geometry, |
|
55 |
IProjection projection, |
|
56 |
FeatureType featureType, |
|
57 |
String geomName |
|
58 |
) { |
|
59 |
this( |
|
60 |
geometry, |
|
61 |
projection, |
|
62 |
featureType, |
|
63 |
geomName, |
|
64 |
SpatialEvaluatorsFactory.getInstance().createBuilder() |
|
65 |
); |
|
66 |
} |
|
67 |
|
|
68 | 46 |
EqualsGeometryEvaluator( |
69 | 47 |
Geometry geometry, |
70 | 48 |
IProjection projection, |
... | ... | |
126 | 104 |
return this.builder.set( |
127 | 105 |
builder.ST_Equals( |
128 | 106 |
builder.geometry(geometry, projection), |
129 |
builder.column(fad) |
|
107 |
builder.column(fad.getName())
|
|
130 | 108 |
) |
131 | 109 |
).toString(); |
132 | 110 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/layers/vectorial/OverlapsGeometryEvaluator.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import org.cresques.cts.ICoordTrans; |
26 | 26 |
import org.cresques.cts.IProjection; |
27 |
import org.gvsig.fmap.dal.ExpressionBuilder;
|
|
27 |
import org.gvsig.expressionevaluator.ExpressionBuilder;
|
|
28 | 28 |
import org.gvsig.fmap.dal.feature.Feature; |
29 | 29 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
30 | 30 |
import org.gvsig.fmap.dal.feature.FeatureType; |
... | ... | |
48 | 48 |
private final IProjection projection; |
49 | 49 |
private final FeatureAttributeDescriptor fad; |
50 | 50 |
|
51 |
/** |
|
52 |
* @param geometry |
|
53 |
* @param projection |
|
54 |
* @param featureType |
|
55 |
* @param geomName |
|
56 |
* @deprecated use @{link org.gvsig.fmap.mapcontext.layers.vectorial.SpatialEvaluatorsFactory} |
|
57 |
*/ |
|
58 |
public OverlapsGeometryEvaluator( |
|
59 |
Geometry geometry, |
|
60 |
IProjection projection, |
|
61 |
FeatureType featureType, |
|
62 |
String geomName |
|
63 |
) { |
|
64 |
this( |
|
65 |
geometry, |
|
66 |
projection, |
|
67 |
featureType, |
|
68 |
geomName, |
|
69 |
SpatialEvaluatorsFactory.getInstance().createBuilder() |
|
70 |
); |
|
71 |
} |
|
72 |
|
|
73 | 51 |
OverlapsGeometryEvaluator( |
74 | 52 |
Geometry geometry, |
75 | 53 |
IProjection projection, |
... | ... | |
132 | 110 |
return this.builder.set( |
133 | 111 |
builder.ST_Overlaps( |
134 | 112 |
builder.geometry(geometry, projection), |
135 |
builder.column(fad) |
|
113 |
builder.column(fad.getName())
|
|
136 | 114 |
) |
137 | 115 |
).toString(); |
138 | 116 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/layers/vectorial/SpatialEvaluatorsFactory.java | ||
---|---|---|
1 | 1 |
package org.gvsig.fmap.mapcontext.layers.vectorial; |
2 | 2 |
|
3 | 3 |
import org.cresques.cts.IProjection; |
4 |
import org.gvsig.fmap.dal.DALLocator; |
|
5 |
import org.gvsig.fmap.dal.DataManager; |
|
4 |
import org.gvsig.expressionevaluator.ExpressionBuilder; |
|
6 | 5 |
import org.gvsig.fmap.dal.exception.DataException; |
7 | 6 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
8 | 7 |
import org.gvsig.fmap.dal.feature.FeatureType; |
9 |
import org.gvsig.fmap.dal.ExpressionBuilder; |
|
10 | 8 |
import org.gvsig.fmap.geom.Geometry; |
11 | 9 |
import org.gvsig.fmap.geom.primitive.Envelope; |
12 | 10 |
import org.gvsig.tools.evaluator.Evaluator; |
... | ... | |
23 | 21 |
|
24 | 22 |
} |
25 | 23 |
|
26 |
public ExpressionBuilder createBuilder() { |
|
27 |
DataManager manager = DALLocator.getDataManager(); |
|
28 |
ExpressionBuilder builder = manager.createExpressionBuilder();
|
|
29 |
return builder; |
|
30 |
} |
|
24 |
// public ExpressionBuilder createBuilder() {
|
|
25 |
// DataManager manager = DALLocator.getDataManager();
|
|
26 |
// ExpressionBuilder builder = manager.createSQLBuilder();
|
|
27 |
// return builder;
|
|
28 |
// }
|
|
31 | 29 |
|
32 |
public Evaluator intersects(
|
|
30 |
private Evaluator intersects(
|
|
33 | 31 |
Geometry geometry, |
34 | 32 |
IProjection projection, |
35 | 33 |
FeatureType featureType, |
... | ... | |
39 | 37 |
return new IntersectsGeometryEvaluator(geometry, projection, featureType, geomName, builder); |
40 | 38 |
} |
41 | 39 |
|
42 |
public Evaluator intersects(
|
|
40 |
private Evaluator intersects(
|
|
43 | 41 |
Envelope envelope, |
44 | 42 |
IProjection projection, |
45 | 43 |
FeatureType featureType, |
... | ... | |
57 | 55 |
try { |
58 | 56 |
FeatureType featureType = store.getDefaultFeatureType(); |
59 | 57 |
String geomName = featureType.getDefaultGeometryAttributeName(); |
60 |
ExpressionBuilder builder = store.createExpressionBuilder(); |
|
58 |
ExpressionBuilder builder = (ExpressionBuilder) store.createExpressionBuilder();
|
|
61 | 59 |
return intersects(geometry, projection, featureType, geomName,builder); |
62 | 60 |
} catch (DataException ex) { |
63 | 61 |
throw new RuntimeException("Can't create intersects evaluator.",ex); |
... | ... | |
79 | 77 |
} |
80 | 78 |
} |
81 | 79 |
|
82 |
public Evaluator contains(
|
|
80 |
private Evaluator contains(
|
|
83 | 81 |
Envelope envelope, |
84 | 82 |
IProjection projection, |
85 | 83 |
FeatureType featureType, |
... | ... | |
89 | 87 |
return new ContainsEnvelopeEvaluator(envelope, projection, featureType, geomName, builder); |
90 | 88 |
} |
91 | 89 |
|
92 |
public Evaluator contains(
|
|
90 |
private Evaluator contains(
|
|
93 | 91 |
Geometry geometry, |
94 | 92 |
IProjection projection, |
95 | 93 |
FeatureType featureType, |
... | ... | |
129 | 127 |
} |
130 | 128 |
} |
131 | 129 |
|
132 |
public Evaluator not_contains(
|
|
130 |
private Evaluator not_contains(
|
|
133 | 131 |
Geometry geometry, |
134 | 132 |
IProjection projection, |
135 | 133 |
FeatureType featureType, |
... | ... | |
164 | 162 |
return new CrossesGeometryEvaluator(geometry, projection, featureType, geomName, builder); |
165 | 163 |
} |
166 | 164 |
|
167 |
public Evaluator crosses(
|
|
165 |
private Evaluator crosses(
|
|
168 | 166 |
Envelope envelope, |
169 | 167 |
IProjection projection, |
170 | 168 |
FeatureType featureType, |
... | ... | |
204 | 202 |
} |
205 | 203 |
} |
206 | 204 |
|
207 |
public Evaluator disjoint(
|
|
205 |
private Evaluator disjoint(
|
|
208 | 206 |
Geometry geometry, |
209 | 207 |
IProjection projection, |
210 | 208 |
FeatureType featureType, |
... | ... | |
229 | 227 |
} |
230 | 228 |
} |
231 | 229 |
|
232 |
public Evaluator overlaps(
|
|
230 |
private Evaluator overlaps(
|
|
233 | 231 |
Geometry geometry, |
234 | 232 |
IProjection projection, |
235 | 233 |
FeatureType featureType, |
... | ... | |
254 | 252 |
} |
255 | 253 |
} |
256 | 254 |
|
257 |
public Evaluator touches(
|
|
255 |
private Evaluator touches(
|
|
258 | 256 |
Geometry geometry, |
259 | 257 |
IProjection projection, |
260 | 258 |
FeatureType featureType, |
... | ... | |
279 | 277 |
} |
280 | 278 |
} |
281 | 279 |
|
282 |
public Evaluator within(
|
|
280 |
private Evaluator within(
|
|
283 | 281 |
Geometry geometry, |
284 | 282 |
IProjection projection, |
285 | 283 |
FeatureType featureType, |
... | ... | |
304 | 302 |
} |
305 | 303 |
} |
306 | 304 |
|
307 |
public Evaluator equals(
|
|
305 |
private Evaluator equals(
|
|
308 | 306 |
Geometry geometry, |
309 | 307 |
IProjection projection, |
310 | 308 |
FeatureType featureType, |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/layers/vectorial/ContainsEnvelopeEvaluator.java | ||
---|---|---|
23 | 23 |
package org.gvsig.fmap.mapcontext.layers.vectorial; |
24 | 24 |
|
25 | 25 |
import org.cresques.cts.IProjection; |
26 |
import org.gvsig.fmap.dal.ExpressionBuilder;
|
|
26 |
import org.gvsig.expressionevaluator.ExpressionBuilder;
|
|
27 | 27 |
|
28 | 28 |
import org.gvsig.fmap.dal.feature.Feature; |
29 | 29 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
... | ... | |
43 | 43 |
private final ExpressionBuilder builder; |
44 | 44 |
private final IProjection projection; |
45 | 45 |
private final FeatureAttributeDescriptor fad; |
46 |
|
|
47 |
/** |
|
48 |
* @deprecated use @{link org.gvsig.fmap.mapcontext.layers.vectorial.SpatialEvaluatorsFactory} |
|
49 |
* @param envelope |
|
50 |
* @param envelopeProjection |
|
51 |
* @param featureType |
|
52 |
* @param geomName |
|
53 |
*/ |
|
54 |
public ContainsEnvelopeEvaluator( |
|
55 |
Envelope envelope, |
|
56 |
IProjection envelopeProjection, |
|
57 |
FeatureType featureType, |
|
58 |
String geomName |
|
59 |
) { |
|
60 |
this( |
|
61 |
envelope, |
|
62 |
envelopeProjection, |
|
63 |
featureType, |
|
64 |
geomName, |
|
65 |
SpatialEvaluatorsFactory.getInstance().createBuilder() |
|
66 |
); |
|
67 |
} |
|
68 |
|
|
46 |
|
|
69 | 47 |
ContainsEnvelopeEvaluator( |
70 | 48 |
Envelope envelope, |
71 | 49 |
IProjection envelopeProjection, |
... | ... | |
78 | 56 |
this.projection = envelopeProjection; |
79 | 57 |
this.builder = builder; |
80 | 58 |
this.envelope = envelope; |
81 |
// this.srs = envelopeProjection.getAbrev(); |
|
82 |
// this.projection=CRSFactory.getCRS(fad.getSRS()); |
|
83 |
// this.envelopeProjection=envelopeProjection; |
|
84 |
// ICoordTrans ct = null; |
|
85 |
// if (!this.srs.equals(fad.getSRS())) { // FIXME comparaci�n |
|
86 |
// ct = envelopeProjection.getCT(fad.getSRS()); |
|
87 |
// } |
|
88 |
// if (ct != null) { |
|
89 |
// this.envelopeTrans = envelope.convert(ct); |
|
90 |
// } else { |
|
91 | 59 |
this.envelopeTrans = envelope; |
92 |
// } |
|
93 | 60 |
this.geomName = geomName; |
94 | 61 |
this.getFieldsInfo().addMatchFieldValue(geomName, envelopeTrans); |
95 |
|
|
96 | 62 |
} |
97 | 63 |
|
98 | 64 |
@Override |
... | ... | |
122 | 88 |
return this.builder.set( |
123 | 89 |
builder.ST_Contains( |
124 | 90 |
builder.envelope(envelope, projection), |
125 |
builder.column(fad) |
|
91 |
builder.column(fad.getName())
|
|
126 | 92 |
) |
127 | 93 |
).toString(); |
128 | 94 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/layers/vectorial/WithinGeometryEvaluator.java | ||
---|---|---|
24 | 24 |
|
25 | 25 |
import org.cresques.cts.ICoordTrans; |
26 | 26 |
import org.cresques.cts.IProjection; |
27 |
import org.gvsig.fmap.dal.ExpressionBuilder;
|
|
27 |
import org.gvsig.expressionevaluator.ExpressionBuilder;
|
|
28 | 28 |
import org.gvsig.fmap.dal.feature.Feature; |
29 | 29 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
30 | 30 |
import org.gvsig.fmap.dal.feature.FeatureType; |
... | ... | |
42 | 42 |
private final ExpressionBuilder builder; |
43 | 43 |
private final IProjection projection; |
44 | 44 |
private final FeatureAttributeDescriptor fad; |
45 |
|
|
46 |
/** |
|
47 |
* @param geometry |
|
48 |
* @param projection |
|
49 |
* @param featureType |
|
50 |
* @param geomName |
|
51 |
* @deprecated use @{link org.gvsig.fmap.mapcontext.layers.vectorial.SpatialEvaluatorsFactory} |
|
52 |
*/ |
|
53 |
public WithinGeometryEvaluator( |
|
54 |
Geometry geometry, |
|
55 |
IProjection projection, |
|
56 |
FeatureType featureType, |
|
57 |
String geomName |
|
58 |
) { |
|
59 |
this( |
|
60 |
geometry, |
|
61 |
projection, |
|
62 |
featureType, |
|
63 |
geomName, |
|
64 |
SpatialEvaluatorsFactory.getInstance().createBuilder() |
|
65 |
); |
|
66 |
} |
|
67 | 45 |
|
68 | 46 |
WithinGeometryEvaluator( |
69 | 47 |
Geometry geometry, |
... | ... | |
126 | 104 |
return this.builder.set( |
127 | 105 |
builder.ST_Within( |
128 | 106 |
builder.geometry(geometry, projection), |
129 |
builder.column(fad) |
|
107 |
builder.column(fad.getName())
|
|
130 | 108 |
) |
131 | 109 |
).toString(); |
132 | 110 |
} |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.mapcontext/org.gvsig.fmap.mapcontext.api/src/main/java/org/gvsig/fmap/mapcontext/layers/vectorial/IntersectsEnvelopeEvaluator.java | ||
---|---|---|
23 | 23 |
package org.gvsig.fmap.mapcontext.layers.vectorial; |
24 | 24 |
|
25 | 25 |
import org.cresques.cts.IProjection; |
26 |
import org.gvsig.fmap.dal.ExpressionBuilder;
|
|
26 |
import org.gvsig.expressionevaluator.ExpressionBuilder;
|
|
27 | 27 |
|
28 | 28 |
import org.gvsig.fmap.dal.feature.Feature; |
29 | 29 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
... | ... | |
43 | 43 |
private final IProjection projection; |
44 | 44 |
private final ExpressionBuilder builder; |
45 | 45 |
FeatureAttributeDescriptor fad; |
46 |
|
|
47 |
/** |
|
48 |
* @param envelope |
|
49 |
* @param envelopeProjection |
|
50 |
* @param featureType |
|
51 |
* @param geomName |
|
52 |
* @deprecated use @{link org.gvsig.fmap.mapcontext.layers.vectorial.SpatialEvaluatorsFactory} |
|
53 |
*/ |
|
54 |
public IntersectsEnvelopeEvaluator( |
|
55 |
Envelope envelope, |
|
56 |
IProjection envelopeProjection, |
|
57 |
FeatureType featureType, |
|
58 |
String geomName |
|
59 |
) { |
|
60 |
this( |
|
61 |
envelope, |
|
62 |
envelopeProjection, |
|
63 |
featureType, |
|
64 |
geomName, |
|
65 |
SpatialEvaluatorsFactory.getInstance().createBuilder() |
|
66 |
); |
|
67 |
} |
|
68 |
|
|
46 |
|
|
69 | 47 |
IntersectsEnvelopeEvaluator( |
70 | 48 |
Envelope envelope, |
71 | 49 |
IProjection envelopeProjection, |
... | ... | |
110 | 88 |
|
111 | 89 |
@Override |
112 | 90 |
public String getSQL() { |
113 |
// Los gestores de BBDD no usan indices si se envuelve la columna |
|
114 |
// geometria con la funcion ST_envelope. |
|
115 |
|
|
116 | 91 |
return builder.set( |
117 | 92 |
builder.ST_Intersects( |
118 |
builder.geometry(envelope.getGeometry(), this.projection), |
|
119 |
// builder.ST_Envelope(builder.column(geomName)) |
|
120 |
builder.column(fad) |
|
93 |
builder.ST_Envelope(builder.column(fad.getName())), |
|
94 |
builder.geometry(envelope.getGeometry(), this.projection) |
|
121 | 95 |
) |
122 | 96 |
).toString(); |
123 | 97 |
} |
Also available in: Unified diff