use of org.geotoolkit.gml.GeometryTransformer in project geotoolkit by Geomatys.
the class ReadGeometry321Test method testCurve.
@Test
public void testCurve() throws Exception {
final AbstractGeometry geom = read(ReadGeometry321Test.class.getResource("curve.gml"));
final GeometryTransformer tr = new GeometryTransformer(geom);
final Geometry result = tr.get();
Assert.assertNotNull("Read geometry is null", result);
Assert.assertTrue(String.format("Bad geometry type.%nExpected: %s%nBut was: %s", LineString.class, result.getClass()), LineString.class.isAssignableFrom(result.getClass()));
final LineString col = (LineString) result;
Envelope expectedEnvelope = new Envelope(12.98241111111111, 13.462391666666665, -87.81824444444445, -87.25221944444445);
final Envelope actual = col.getEnvelopeInternal();
Assert.assertEquals(expectedEnvelope.getMinX(), actual.getMinX(), 0.01);
Assert.assertEquals(expectedEnvelope.getMinY(), actual.getMinY(), 0.01);
Assert.assertEquals(expectedEnvelope.getMaxX(), actual.getMaxX(), 0.01);
Assert.assertEquals(expectedEnvelope.getMaxY(), actual.getMaxY(), 0.01);
}
Aggregations