Examples of Wgs84Position


Examples of slash.navigation.base.Wgs84Position

    private Wgs84Position process(LandmarkType landmark) {
        CoordinatesType coordinates = landmark.getCoordinates();
        Double altitude = coordinates != null && coordinates.getAltitude() != null ?
                (double) coordinates.getAltitude() : null;
        return new Wgs84Position(coordinates != null ? coordinates.getLongitude() : null,
                coordinates != null ? coordinates.getLatitude() : null,
                altitude,
                null,
                coordinates != null ? parseTime(coordinates.getTimeStamp()) : null,
                landmark.getName(),
View Full Code Here

Examples of slash.navigation.base.Wgs84Position

        List<LandmarkType> landmarkTypeList = landmarkCollectionType.getLandmark();
        landmarkTypeList.clear();

        List<Wgs84Position> positions = route.getPositions();
        for (int i = startIndex; i < endIndex; i++) {
            Wgs84Position position = positions.get(i);

            LandmarkType landmarkType = position.getOrigin(LandmarkType.class);
            if (landmarkType == null)
                landmarkType = objectFactory.createLandmarkType();
            landmarkType.setName(position.getDescription());

            CoordinatesType coordinatesType = landmarkType.getCoordinates();
            if (coordinatesType == null)
                coordinatesType = objectFactory.createCoordinatesType();
            coordinatesType.setAltitude(formatFloat(position.getElevation()));
            coordinatesType.setLatitude(formatDouble(position.getLatitude(), 7));
            coordinatesType.setLongitude(formatDouble(position.getLongitude(), 7));
            coordinatesType.setTimeStamp(formatTime(position.getTime()));
            landmarkType.setCoordinates(coordinatesType);

            landmarkTypeList.add(landmarkType);
        }
View Full Code Here

Examples of slash.navigation.base.Wgs84Position

    public void add(int index, Wgs84Position position) {
        positions.add(index, position);
    }

    public Wgs84Position createPosition(Double longitude, Double latitude, Double elevation, Double speed, CompactCalendar time, String description) {
        return new Wgs84Position(longitude, latitude, elevation, speed, time, description);
    }
View Full Code Here

Examples of slash.navigation.base.Wgs84Position

                NokiaLandmarkExchangeRoute sourceWaypoints = (NokiaLandmarkExchangeRoute) source.getAllRoutes().get(0);
                assertEquals(Waypoints, sourceWaypoints.getCharacteristics());
                assertNotNull(sourceWaypoints.getLmx());
                assertEquals(Lmx.class, sourceWaypoints.getLmx().getClass());
                checkUnprocessed(sourceWaypoints.getLmx());
                Wgs84Position sourceWaypoint = sourceWaypoints.getPosition(0);
                assertNotNull(sourceWaypoint.getOrigin());
                checkUnprocessed(sourceWaypoint.getOrigin(LandmarkType.class));

                NokiaLandmarkExchangeRoute targetWaypoints = (NokiaLandmarkExchangeRoute) source.getAllRoutes().get(0);
                assertEquals(Waypoints, targetWaypoints.getCharacteristics());
                assertNotNull(targetWaypoints.getLmx());
                assertEquals(Lmx.class, targetWaypoints.getLmx().getClass());
                checkUnprocessed(targetWaypoints.getLmx());
                Wgs84Position targetWaypoint = targetWaypoints.getPosition(0);
                assertNotNull(targetWaypoint.getOrigin());
                checkUnprocessed(targetWaypoint.getOrigin(LandmarkType.class));
            }
        });
    }
View Full Code Here

Examples of slash.navigation.base.Wgs84Position

        assertFalse(format.isValidLine("[]"));
    }

    @Test
    public void testParsePosition() {
        Wgs84Position position = format.parsePosition("[|][0][10]|||8.8128300|49.0006140[0]||", null);
        assertDoubleEquals(8.8128300, position.getLongitude());
        assertDoubleEquals(49.0006140, position.getLatitude());
        assertNull(position.getDescription());
    }
View Full Code Here

Examples of slash.navigation.base.Wgs84Position

        assertNull(position.getDescription());
    }

    @Test
    public void testParseNegativePosition() {
        Wgs84Position position = format.parsePosition("[|][0][10]|||-8.8128300|-49.0006140[0]||", null);
        assertDoubleEquals(-8.8128300, position.getLongitude());
        assertDoubleEquals(-49.0006140, position.getLatitude());
        assertNull(position.getDescription());
    }
View Full Code Here

Examples of slash.navigation.base.Wgs84Position

        readWriteRoundtrip(TEST_PATH + "from-columbusv900-standard.csv", new ReadWriteTestCallback() {
            public void test(ParserResult source, ParserResult target) {
                SimpleRoute sourceRoute = (SimpleRoute) source.getAllRoutes().get(0);
                SimpleRoute targetRoute = (SimpleRoute) target.getAllRoutes().get(0);
                for (int i = 0; i < sourceRoute.getPositionCount(); i++) {
                    Wgs84Position sourcePosition = (Wgs84Position) sourceRoute.getPosition(i);
                    Wgs84Position targetPosition = (Wgs84Position) targetRoute.getPosition(i);
                    assertEquals(targetPosition.getHeading(), sourcePosition.getHeading());
                    assertNull(sourcePosition.getHdop());
                    assertNull(targetPosition.getHdop());
                }
            }
        });
    }
View Full Code Here

Examples of slash.navigation.base.Wgs84Position

        assertNull(position.getDescription());
    }

    @Test
    public void testParseITNConvPosition() {
        Wgs84Position position = format.parsePosition("[D 22081,Hamburg/Uhlenhorst,Finkenau,0,|][0][10]|||10.03200|53.56949", null);
        assertDoubleEquals(10.03200, position.getLongitude());
        assertDoubleEquals(53.56949, position.getLatitude());
        assertEquals("D 22081,Hamburg/Uhlenhorst,Finkenau,0,", position.getDescription());
    }
View Full Code Here

Examples of slash.navigation.base.Wgs84Position

        assertEquals("D 22081,Hamburg/Uhlenhorst,Finkenau,0,", position.getDescription());
    }

    @Test
    public void testParseWrittenFormat() {
        Wgs84Position position = format.parsePosition("[Rheinuferstr. bei Kaub|][0][10]|||7.74957|50.09721", null);
        assertDoubleEquals(7.74957, position.getLongitude());
        assertDoubleEquals(50.09721, position.getLatitude());
        assertEquals("Rheinuferstr. bei Kaub", position.getDescription());
    }
View Full Code Here

Examples of slash.navigation.base.Wgs84Position

        assertEquals("Rheinuferstr. bei Kaub", position.getDescription());
    }

    @Test
    public void testParseNavigonFormat() {
        Wgs84Position position = format.parsePosition("[Rheinuferstr. bei Kaub||][0][10]|7.74957,50.09721||7.74957|50.09721[6]|KAUB|56349|7.76240|50.08817[3]|RHEIN-LAHN-KREIS|[2]|Rheinland-Pfalz||4363[0]|Deutschland||17", null);
        assertDoubleEquals(7.74957, position.getLongitude());
        assertDoubleEquals(50.09721, position.getLatitude());
        assertEquals("Rheinuferstr. bei Kaub", position.getDescription());

        Wgs84Position position2 = format.parsePosition("[||][0][10]|B42|56348|7.65285|50.17757[6]|KESTERT|56348|7.64715|50.18503[3]|RHEIN-LAHN-KREIS|[2]|Rheinland-Pfalz||4363[0]|Deutschland||17", null);
        assertDoubleEquals(7.65285, position2.getLongitude());
        assertDoubleEquals(50.17757, position2.getLatitude());
        assertNull(position2.getDescription());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.