assertTrue( "object equals", surface.equals( (Object) surface2 ));
assertTrue( "geometry equals", surface.equals( surface2 ));
}
public void testSurface() throws Exception {
PositionFactory positionFactory = new PositionFactoryImpl(crs1, new PrecisionModel());
PrimitiveFactory primitiveFactory = new PrimitiveFactoryImpl(crs1, positionFactory);
GeometryFactory geometryFactory = new GeometryFactoryImpl(crs1, positionFactory);
List<Position> points1 = new ArrayList<Position>();
points1.add(primitiveFactory.createPoint( new double[]{-123.47009555832284,48.543261561072285} ));
points1.add(primitiveFactory.createPoint( new double[]{-123.46972894676578,48.55009592117936} ));
points1.add(primitiveFactory.createPoint( new double[]{-123.45463828850829,48.54973520267305} ));
points1.add(primitiveFactory.createPoint( new double[]{-123.4550070827961,48.54290089070186} ));
points1.add(primitiveFactory.createPoint( new double[]{-123.47009555832284,48.543261561072285} ));
LineString lineString1 = geometryFactory.createLineString(points1);
List curveSegmentList1 = Collections.singletonList(lineString1);
CurveImpl curve1 = (CurveImpl) primitiveFactory.createCurve(curveSegmentList1);
/* Build Ring from Curve */
ArrayList<OrientableCurve> curveList = new ArrayList<OrientableCurve>();
curveList.add(curve1);
// Build Ring then SurfaceBoundary then Surface
RingImpl exteriors = (RingImpl) primitiveFactory.createRing(curveList);
List<Ring> interiors = new ArrayList<Ring>();
SurfaceBoundary sboundary = primitiveFactory.createSurfaceBoundary(exteriors, interiors);
Surface surface1 = primitiveFactory.createSurface(sboundary);
Surface surface2 = (SurfaceImpl) surface1.transform(crs2);
// create expected result
PositionFactory expectedPosF2 = new PositionFactoryImpl(crs2, new PrecisionModel());
PrimitiveFactory expectedPrimF2 = new PrimitiveFactoryImpl(crs2, expectedPosF2);
GeometryFactory ExpectedGeomF2 = new GeometryFactoryImpl(crs2, expectedPosF2);
List<Position> expectedPoints = new ArrayList<Position>();
expectedPoints.add(expectedPrimF2.createPoint( new double[]{1187128.000000001, 395268.0000000004} ));