Revision 41348
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.file/org.gvsig.fmap.dal.file.csv/src/main/java/org/gvsig/fmap/dal/store/csv/CSVStoreProvider.java | ||
---|---|---|
476 | 476 |
public void visit(Object obj) throws VisitCanceledException, BaseException { |
477 | 477 |
Feature f = (Feature) obj; |
478 | 478 |
Geometry geom = f.getDefaultGeometry(); |
479 |
envelope.add(geom.getEnvelope()); |
|
479 |
if( geom!=null ) { |
|
480 |
envelope.add(geom.getEnvelope()); |
|
481 |
} |
|
480 | 482 |
} |
481 | 483 |
}); |
482 | 484 |
} catch (BaseException e) { |
... | ... | |
776 | 778 |
|
777 | 779 |
public Object get(Feature feature) { |
778 | 780 |
try { |
779 |
Object value = feature.get(this.fieldNames[XNAME]); |
|
780 |
double x = ((Double) toDouble.coerce(value)).doubleValue(); |
|
781 |
double y = ((Double) toDouble.coerce(feature.get(this.fieldNames[YNAME]))).doubleValue(); |
|
781 |
Object valueX = feature.get(this.fieldNames[XNAME]); |
|
782 |
valueX = toDouble.coerce(valueX); |
|
783 |
if( valueX == null ) { |
|
784 |
return null; |
|
785 |
} |
|
786 |
Object valueY = feature.get(this.fieldNames[YNAME]); |
|
787 |
valueY = toDouble.coerce(valueY); |
|
788 |
if( valueY == null ) { |
|
789 |
return null; |
|
790 |
} |
|
791 |
Object valueZ = null; |
|
792 |
if( this.fieldNames.length>2 ) { |
|
793 |
valueZ = toDouble.coerce(feature.get(this.fieldNames[ZNAME])); |
|
794 |
if( valueZ == null ) { |
|
795 |
return null; |
|
796 |
} |
|
797 |
} |
|
798 |
|
|
799 |
double x = ((Double)valueX).doubleValue(); |
|
800 |
double y = ((Double)valueY).doubleValue(); |
|
782 | 801 |
Point point = geommgr.createPoint(x, y, Geometry.SUBTYPES.GEOM3D); |
783 | 802 |
if( this.fieldNames.length>2 ) { |
784 |
double z = ((Double) toDouble.coerce(feature.get(this.fieldNames[ZNAME]))).doubleValue();
|
|
803 |
double z = ((Double)valueZ).doubleValue();
|
|
785 | 804 |
point.setCoordinateAt(2, z); |
786 | 805 |
} |
787 | 806 |
return point; |
trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.impl/src/main/java/org/gvsig/fmap/dal/feature/impl/DefaultFeature.java | ||
---|---|---|
293 | 293 |
Envelope envelope = this.data.getDefaultEnvelope(); |
294 | 294 |
if( envelope == null ) { |
295 | 295 |
Geometry geom = this.getDefaultGeometry(); |
296 |
envelope = geom.getEnvelope(); |
|
296 |
if( geom!=null ) { |
|
297 |
envelope = geom.getEnvelope(); |
|
298 |
} |
|
297 | 299 |
} |
298 | 300 |
return envelope; |
299 | 301 |
} |
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 | ||
---|---|---|
86 | 86 |
} else { |
87 | 87 |
geom = (Geometry) data.getDataValue(geomName); |
88 | 88 |
} |
89 |
if ( geom == null ) { |
|
90 |
return Boolean.FALSE; |
|
91 |
} |
|
89 | 92 |
return new Boolean(geometryTrans.crosses(geom)); |
90 | 93 |
|
91 | 94 |
} catch (Exception e) { |
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 | ||
---|---|---|
87 | 87 |
} else { |
88 | 88 |
geom = (Geometry) data.getDataValue(geomName); |
89 | 89 |
} |
90 |
if ( geom == null ) { |
|
91 |
return Boolean.FALSE; |
|
92 |
} |
|
90 | 93 |
return new Boolean(geometryTrans.disjoint(geom)); |
91 | 94 |
|
92 | 95 |
} catch (Exception e) { |
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 | ||
---|---|---|
81 | 81 |
} else { |
82 | 82 |
geom = (Geometry) data.getDataValue(geomName); |
83 | 83 |
} |
84 |
if( geom==null ) { |
|
85 |
return Boolean.FALSE; |
|
86 |
} |
|
84 | 87 |
return new Boolean(geometryTrans.intersects(geom)); |
85 | 88 |
|
86 | 89 |
} catch (Exception e) { |
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/IntersectsTimeEvaluator.java | ||
---|---|---|
48 | 48 |
|
49 | 49 |
public Object evaluate(EvaluatorData data) throws EvaluatorException { |
50 | 50 |
Feature feature = ((Feature) data.getContextValue("feature")); |
51 |
return new Boolean(time.intersects((Time)feature.get(timeAttributeName))); |
|
51 |
Time featureTime = (Time)feature.get(timeAttributeName); |
|
52 |
if( featureTime==null ) { |
|
53 |
return Boolean.FALSE; |
|
54 |
} |
|
55 |
return new Boolean(time.intersects(featureTime)); |
|
52 | 56 |
} |
53 | 57 |
|
54 | 58 |
public String getName() { |
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 | ||
---|---|---|
86 | 86 |
} else { |
87 | 87 |
geom = (Geometry) data.getDataValue(geomName); |
88 | 88 |
} |
89 |
if ( geom == null ) { |
|
90 |
return Boolean.FALSE; |
|
91 |
} |
|
89 | 92 |
return new Boolean(geometryTrans.equals(geom)); |
90 | 93 |
|
91 | 94 |
} catch (Exception e) { |
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 | ||
---|---|---|
83 | 83 |
} else { |
84 | 84 |
geom = (Geometry) data.getDataValue(geomName); |
85 | 85 |
} |
86 |
if ( geom == null ) { |
|
87 |
return Boolean.FALSE; |
|
88 |
} |
|
86 | 89 |
return new Boolean(geometryTrans.overlaps(geom)); |
87 | 90 |
|
88 | 91 |
} catch (Exception e) { |
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 | ||
---|---|---|
80 | 80 |
.getDefaultEnvelope(); |
81 | 81 |
|
82 | 82 |
} else { |
83 |
featureEnvelope = ((Geometry) data.getDataValue(geomName)) |
|
84 |
.getEnvelope(); |
|
83 |
Geometry geom = (Geometry) data.getDataValue(geomName); |
|
84 |
if( geom == null ) { |
|
85 |
return Boolean.FALSE; |
|
86 |
} |
|
87 |
featureEnvelope = geom.getEnvelope(); |
|
85 | 88 |
} |
86 | 89 |
return new Boolean(envelopeTrans.contains(featureEnvelope)); |
87 | 90 |
} |
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 | ||
---|---|---|
82 | 82 |
} else { |
83 | 83 |
geom = (Geometry) data.getDataValue(geomName); |
84 | 84 |
} |
85 |
if ( geom == null ) { |
|
86 |
return Boolean.FALSE; |
|
87 |
} |
|
85 | 88 |
return new Boolean(geometryTrans.within(geom)); |
86 | 89 |
|
87 | 90 |
} catch (Exception e) { |
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 | ||
---|---|---|
80 | 80 |
featureEnvelope = ((Feature) data.getContextValue("feature")) |
81 | 81 |
.getDefaultEnvelope(); |
82 | 82 |
} else { |
83 |
featureEnvelope = ((Geometry) data.getDataValue(geomName)).getEnvelope(); |
|
83 |
Geometry geom = (Geometry) data.getDataValue(geomName); |
|
84 |
if( geom == null ) { |
|
85 |
return Boolean.FALSE; |
|
86 |
} |
|
87 |
featureEnvelope = geom.getEnvelope(); |
|
84 | 88 |
} |
85 | 89 |
return new Boolean(envelopeTrans.intersects(featureEnvelope)); |
86 | 90 |
|
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 | ||
---|---|---|
82 | 82 |
} else { |
83 | 83 |
geom = (Geometry) data.getDataValue(geomName); |
84 | 84 |
} |
85 |
if ( geom == null ) { |
|
86 |
return Boolean.FALSE; |
|
87 |
} |
|
85 | 88 |
return new Boolean(!geometryTrans.contains(geom) && !geometryTrans.intersects(geom)); |
86 | 89 |
|
87 | 90 |
} catch (Exception e) { |
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 | ||
---|---|---|
82 | 82 |
} else { |
83 | 83 |
geom = (Geometry) data.getDataValue(geomName); |
84 | 84 |
} |
85 |
if ( geom == null ) { |
|
86 |
return Boolean.FALSE; |
|
87 |
} |
|
85 | 88 |
return new Boolean(geometryTrans.touches(geom)); |
86 | 89 |
|
87 | 90 |
} catch (Exception e) { |
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 | ||
---|---|---|
77 | 77 |
public Object evaluate(EvaluatorData data) throws EvaluatorException { |
78 | 78 |
if (isDefault) { |
79 | 79 |
Feature feature = (Feature) data.getContextValue("feature"); |
80 |
// return new Boolean(envelopeTrans.contains(feature |
|
81 |
// .getDefaultEnvelope()) |
|
82 |
// || envelopeTrans.intersects(feature.getDefaultEnvelope())); |
|
83 |
// System.out.println("== Filter[" + envelopeTrans.getLowerCorner()[0] |
|
84 |
// + "," + envelopeTrans.getLowerCorner()[1] + "] [" |
|
85 |
// + envelopeTrans.getUpperCorner()[0] + "," |
|
86 |
// + envelopeTrans.getUpperCorner()[1] + "]"); |
|
87 |
|
|
88 | 80 |
Envelope featureEnvelope = feature.getDefaultEnvelope(); |
89 |
// System.out.println("== Geom [" |
|
90 |
// + featureEnvelope.getLowerCorner()[0] |
|
91 |
// + "," + featureEnvelope.getLowerCorner()[1] + "] [" |
|
92 |
// + featureEnvelope.getUpperCorner()[0] + "," |
|
93 |
// + featureEnvelope.getUpperCorner()[1] + "]"); |
|
81 |
if( featureEnvelope == null ) { |
|
82 |
return Boolean.FALSE; |
|
83 |
} |
|
94 | 84 |
Boolean r = new Boolean(envelopeTrans.intersects(featureEnvelope)); |
95 |
// System.out.println("==3 "+r); |
|
96 | 85 |
return r; |
97 | 86 |
|
98 | 87 |
} else { |
99 | 88 |
Geometry geom = (Geometry) data.getDataValue(geomName); |
100 |
// return new Boolean(envelopeTrans.contains(geom.getEnvelope())
|
|
101 |
// || envelopeTrans.intersects(geom.getEnvelope()));
|
|
102 |
|
|
89 |
if( geom == null ) {
|
|
90 |
return Boolean.FALSE;
|
|
91 |
} |
|
103 | 92 |
return new Boolean(envelopeTrans.intersects(geom.getEnvelope())); |
104 | 93 |
|
105 | 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/ContainsGeometryEvaluator.java | ||
---|---|---|
77 | 77 |
|
78 | 78 |
public Object evaluate(EvaluatorData data) throws EvaluatorException { |
79 | 79 |
try { |
80 |
Geometry geom = null;
|
|
81 |
if (isDefault) {
|
|
82 |
Feature feature = (Feature) data.getContextValue("feature");
|
|
83 |
geom = feature.getDefaultGeometry();
|
|
80 |
Geometry geom = null;
|
|
81 |
if ( isDefault ) {
|
|
82 |
Feature feature = (Feature) data.getContextValue("feature");
|
|
83 |
geom = feature.getDefaultGeometry();
|
|
84 | 84 |
|
85 |
} else { |
|
86 |
geom = (Geometry) data.getDataValue(geomName); |
|
87 |
} |
|
88 |
return new Boolean(geometryTrans.contains(geom)); |
|
85 |
} else { |
|
86 |
geom = (Geometry) data.getDataValue(geomName); |
|
87 |
} |
|
88 |
if ( geom == null ) { |
|
89 |
return Boolean.FALSE; |
|
90 |
} |
|
91 |
return new Boolean(geometryTrans.contains(geom)); |
|
89 | 92 |
|
90 | 93 |
} catch (Exception e) { |
91 | 94 |
throw new EvaluatorException(e); |
trunk/org.gvsig.desktop/org.gvsig.desktop.library/org.gvsig.symbology/org.gvsig.symbology.lib/org.gvsig.symbology.lib.impl/src/main/java/org/gvsig/symbology/fmap/mapcontext/rendering/legend/impl/AbstractVectorialLegend.java | ||
---|---|---|
695 | 695 |
boolean bSymbolLevelError = false; |
696 | 696 |
long drawingTime = time; |
697 | 697 |
|
698 |
if (geom.getType() == Geometry.TYPES.NULL) { |
|
698 |
if (geom==null && geom.getType() == Geometry.TYPES.NULL) {
|
|
699 | 699 |
return false; |
700 | 700 |
} |
701 | 701 |
|
Also available in: Unified diff