Search in sources :

Example 51 with SimplePoint_VersionStructure

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);
}
Also used : SimplePoint_VersionStructure(org.rutebanken.netex.model.SimplePoint_VersionStructure) Point(org.locationtech.jts.geom.Point) LocationStructure(org.rutebanken.netex.model.LocationStructure) Test(org.junit.Test)

Example 52 with SimplePoint_VersionStructure

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));
}
Also used : DirectPositionType(net.opengis.gml._3.DirectPositionType) SimplePoint_VersionStructure(org.rutebanken.netex.model.SimplePoint_VersionStructure) Point(org.locationtech.jts.geom.Point) LocationStructure(org.rutebanken.netex.model.LocationStructure) Test(org.junit.Test)

Aggregations

SimplePoint_VersionStructure (org.rutebanken.netex.model.SimplePoint_VersionStructure)52 Test (org.junit.Test)49 LocationStructure (org.rutebanken.netex.model.LocationStructure)47 BigDecimal (java.math.BigDecimal)37 PublicationDeliveryStructure (org.rutebanken.netex.model.PublicationDeliveryStructure)36 StopPlace (org.rutebanken.netex.model.StopPlace)36 TiamatIntegrationTest (org.rutebanken.tiamat.TiamatIntegrationTest)35 MultilingualString (org.rutebanken.netex.model.MultilingualString)31 ImportParams (org.rutebanken.tiamat.importer.ImportParams)21 Quay (org.rutebanken.netex.model.Quay)16 Quays_RelStructure (org.rutebanken.netex.model.Quays_RelStructure)16 ArrayList (java.util.ArrayList)11 LocalDateTime (java.time.LocalDateTime)9 ValidBetween (org.rutebanken.netex.model.ValidBetween)8 Response (javax.ws.rs.core.Response)7 KeyValueStructure (org.rutebanken.netex.model.KeyValueStructure)7 Sets (com.google.common.collect.Sets)6 ByteArrayInputStream (java.io.ByteArrayInputStream)6 ByteArrayOutputStream (java.io.ByteArrayOutputStream)6 IOException (java.io.IOException)6