Revision 44612 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.geometry/org.gvsig.fmap.geometry.jts/src/main/java/org/gvsig/fmap/geom/jts/primitive/curve/spline/AbstractSpline.java
AbstractSpline.java | ||
---|---|---|
32 | 32 |
|
33 | 33 |
import org.apache.commons.lang3.StringUtils; |
34 | 34 |
import org.cresques.cts.ICoordTrans; |
35 |
import org.gvsig.fmap.geom.Geometry; |
|
35 | 36 |
import org.slf4j.Logger; |
36 | 37 |
import org.slf4j.LoggerFactory; |
37 | 38 |
|
... | ... | |
554 | 555 |
return cloned; |
555 | 556 |
} |
556 | 557 |
|
558 |
@Override |
|
559 |
public Geometry force2D() throws GeometryOperationNotSupportedException, GeometryOperationException { |
|
560 |
ArrayListCoordinateSequence coordinates2D = new ArrayListCoordinateSequence(); |
|
561 |
coordinates2D.ensureCapacity(coordinates.size()); |
|
562 |
for (Iterator iterator = coordinates.iterator(); iterator.hasNext();) { |
|
563 |
Coordinate coordinate = (Coordinate) iterator.next(); |
|
564 |
coordinates2D.add(new Coordinate(coordinate.x, coordinate.y)); |
|
565 |
} |
|
566 |
Spline2D s = new Spline2D(coordinates2D); |
|
567 |
s.setProjection(this.getProjection()); |
|
568 |
return s; |
|
569 |
} |
|
557 | 570 |
|
558 | 571 |
protected boolean isClosed(){ |
559 | 572 |
return coordinates.get(0).equals(coordinates.get(coordinates.size()-1)); |
Also available in: Unified diff