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
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; |
Also available in: Unified diff