SurfacePatch nextPatch = patches.get(i);
surfaceList.add(new SurfaceImpl(nextPatch.getBoundary()));
}
MultiSurface ms = new MultiSurfaceImpl(getCoordinateReferenceSystem(), surfaceList);
TransfiniteSet unionResultSurface = firstPatchSurface.union(ms);
if (! (unionResultSurface instanceof SurfaceImpl))
throw new IllegalArgumentException("Surface patches are not continuous");
return (SurfaceBoundaryImpl) ((SurfaceImpl)unionResultSurface).getBoundary();
}