use of org.geotoolkit.gml.xml.v321.DirectPositionType in project geotoolkit by Geomatys.
the class GeometrytoJTSTest method gmlEnvelopeToJTSTest2D.
@Test
public void gmlEnvelopeToJTSTest2D() throws Exception {
final EnvelopeType env = new EnvelopeType(new DirectPositionType(2.0, 2.0), new DirectPositionType(4.0, 4.0), "EPSG:4326");
final Geometry geom = GeometrytoJTS.toJTS(env);
Coordinate[] expectedPoints = { new Coordinate(2.0, 2.0), new Coordinate(2.0, 4.0), new Coordinate(4.0, 4.0), new Coordinate(4.0, 2.0), new Coordinate(2.0, 2.0) };
Assert.assertTrue(GF.createPolygon(expectedPoints).equalsTopo(geom));
}
use of org.geotoolkit.gml.xml.v321.DirectPositionType in project tiamat by entur.
the class SimplePointVersionStructureConverterTest method importUtmGML.
@Test
public void importUtmGML() {
SimplePoint_VersionStructure simplePointversionStructure = new SimplePoint_VersionStructure().withLocation(new LocationStructure().withPos(new DirectPositionType().withValue(6583758.0, 514477.0).withSrsName("EPSG:32632")));
Point point = simplePointVersionStructureConverter.convertFrom(simplePointversionStructure, pointType, mappingContext);
assertNotNull(point);
assertThat(point.getX()).isCloseTo(9.25, Percentage.withPercentage(2));
assertThat(point.getY()).isCloseTo(59.39, Percentage.withPercentage(2));
}
Aggregations