Revision 40372 branches/v2_0_0_prep/libraries/libFMap_mapcontext/src/org/gvsig/fmap/mapcontext/layers/vectorial/WithinGeometryEvaluator.java
WithinGeometryEvaluator.java | ||
---|---|---|
6 | 6 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
7 | 7 |
import org.gvsig.fmap.dal.feature.FeatureType; |
8 | 8 |
import org.gvsig.fmap.geom.Geometry; |
9 |
import org.gvsig.fmap.geom.operation.relationship.DefaultRelationshipGeometryOperationContext; |
|
10 |
import org.gvsig.fmap.geom.operation.relationship.Within; |
|
11 | 9 |
import org.gvsig.tools.evaluator.AbstractEvaluator; |
12 | 10 |
import org.gvsig.tools.evaluator.EvaluatorData; |
13 | 11 |
import org.gvsig.tools.evaluator.EvaluatorException; |
... | ... | |
53 | 51 |
|
54 | 52 |
public Object evaluate(EvaluatorData data) throws EvaluatorException { |
55 | 53 |
try { |
56 |
DefaultRelationshipGeometryOperationContext context;
|
|
54 |
Geometry geom = null;
|
|
57 | 55 |
if (isDefault) { |
58 | 56 |
Feature feature = (Feature) data.getContextValue("feature"); |
59 |
context =new DefaultRelationshipGeometryOperationContext(feature |
|
60 |
.getDefaultGeometry()); |
|
57 |
geom =feature.getDefaultGeometry(); |
|
61 | 58 |
|
62 | 59 |
} else { |
63 |
Geometry geom = (Geometry) data.getDataValue(geomName); |
|
64 |
|
|
65 |
context = new DefaultRelationshipGeometryOperationContext(geom); |
|
60 |
geom = (Geometry) data.getDataValue(geomName); |
|
66 | 61 |
} |
67 |
return geometryTrans.invokeOperation(Within.CODE, context);
|
|
62 |
return new Boolean(geometryTrans.within(geom));
|
|
68 | 63 |
|
69 | 64 |
} catch (Exception e) { |
70 | 65 |
throw new EvaluatorException(e); |
Also available in: Unified diff