// Add control points of exterior ring
positions = new ArrayList<DirectPositionImpl>();
positions = ((RingImplUnsafe)((SurfaceBoundaryImpl)geom).getExterior()).asDirectPositions();
}
UniqueCoordinateArrayFilter filter = new UniqueCoordinateArrayFilter();
// Filter all coordinates to eleminate redudant coordinates
Iterator posIter = positions.iterator();
while (posIter.hasNext()) {
Object pos = posIter.next();
if (pos instanceof DirectPositionImpl) {
filter.filter(new Coordinate(((DirectPositionImpl)pos).getCoordinate()));
} else if (pos instanceof PointImpl) {
filter.filter(new Coordinate(((PointImpl)pos).getPosition().getCoordinate()));
} else
Assert.isTrue(false, "Invalid coordinate type");
}
return filter.getCoordinates();
}