/** We need to create a large surface with 7000 points */
public void testLargeSurface(){
int NUMBER = 100000;
double delta = 360.0 / (double) NUMBER;
PointArray points = postitionFactory.createPointArray();
for( double angle = 0.0; angle < 360.0; angle += delta ){
double ordinates[] = new double[]{
Math.sin( Math.toRadians(angle) ),
Math.cos( Math.toRadians(angle) )
};
DirectPosition point = postitionFactory.createDirectPosition( ordinates );
points.add( point );
}
List<OrientableCurve> curves = new ArrayList<OrientableCurve>();
// A curve will be created
// - The curve will be set as parent curves for the Curve segments
// - Start and end params for the CurveSegments will be set
List<CurveSegment> segmentList = new ArrayList<CurveSegment>();
for( int i=0; i<points.size();i++){
int start = i;
int end = (i+1)%points.size();
DirectPosition point1 = points.getDirectPosition( start, null );
DirectPosition point2 = points.getDirectPosition( end, null );
LineSegment segment = geometryFactory.createLineSegment( point1, point2 );
segmentList.add( segment );
}
Curve curve = primitiveFactory.createCurve( segmentList );
curves.add( curve);