use of org.rutebanken.netex.model.SimplePoint_VersionStructure in project tiamat by entur.
the class SimplePointVersionStructureConverterTest method convertNetexPositionToPoint.
@Test
public void convertNetexPositionToPoint() {
double longitude = 10.01;
double latitude = 20.24;
SimplePoint_VersionStructure simplePointversionStructure = new SimplePoint_VersionStructure().withLocation(new LocationStructure().withLongitude(BigDecimal.valueOf(longitude)).withLatitude(BigDecimal.valueOf(latitude)));
Point point = simplePointVersionStructureConverter.convertFrom(simplePointversionStructure, pointType, mappingContext);
assertThat(point).isNotNull();
assertThat(point.getX()).isEqualTo(longitude);
assertThat(point.getY()).isEqualTo(latitude);
}
use of org.rutebanken.netex.model.SimplePoint_VersionStructure 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