Examples of Wgs84Position


Examples of slash.navigation.base.Wgs84Position

        assertTrue(format.isPosition("1,T,,,36.87722,N,111.51194,W,1289.0m,0.0,0.0km/h"));       
    }

    @Test
    public void testParsePosition() {
        Wgs84Position position = format.parsePosition("1,T,08/12/02,05:40:15,47.91561,N,106.90109,E,1308.4m,97.78,1km/h", null);
        assertDoubleEquals(47.91561, position.getLatitude());
        assertDoubleEquals(106.90109, position.getLongitude());
        assertDoubleEquals(1308.4, position.getElevation());
        String actual = DateFormat.getDateTimeInstance().format(position.getTime().getTime());
        CompactCalendar expectedCal = calendar(2008, 12, 2, 5, 40, 15);
        String expected = DateFormat.getDateTimeInstance().format(expectedCal.getTime());
        assertEquals(expected, actual);
        assertEquals(expectedCal, position.getTime());
        assertNull(position.getDescription());
    }
View Full Code Here

Examples of slash.navigation.base.Wgs84Position

        assertNull(position2.getDescription());
    }

    @Test
    public void testParsePOIonDeviceFormat() {
        Wgs84Position position = format.parsePosition("[||][0][10]|B42|56112|7.62424|50.29042[7]|OBERLAHNSTEIN|[6]|LAHNSTEIN|56112|7.60183|50.31752[3]|RHEIN-LAHN-KREIS|[2]|Rheinland-Pfalz||4363[0]|Deutschland||17[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.62424, position.getLongitude());
        assertDoubleEquals(50.29042, position.getLatitude());
        assertNull(position.getDescription());
    }
View Full Code Here

Examples of slash.navigation.base.Wgs84Position

        assertNull(position.getDescription());
    }

    @Test
    public void testParseSouthWestPosition() {
        Wgs84Position position = format.parsePosition("1,T,08/12/02,05:40:15,47.91561,S,106.90109,W,1308.4m,97.78,1km/h", null);
        assertDoubleEquals(-47.91561, position.getLatitude());
        assertDoubleEquals(-106.90109, position.getLongitude());
    }
View Full Code Here

Examples of slash.navigation.base.Wgs84Position

        assertFalse(format.isPosition("8.6180900,50.2175100,\"[61352] AH Kreissl GmbH; Benzstraße 7 [Bad Homburg]\""));
        assertFalse(format.isPosition(" 9.3900000 , 51.5037800 , \"[34369] Donig; Max-Eyth-Str. [Hofgeismar]\" "));
    }

    public void testParsePosition() {
        Wgs84Position position = format.parsePosition("11.107167,49.375783,\"HOLSTEINBRUCH BEI WORZELDORF B - GC13VV5\"", null);
        assertEquals(11.107167, position.getLongitude());
        assertEquals(49.375783, position.getLatitude());
        assertEquals("Holsteinbruch Bei Worzeldorf B - Gc13vv5", position.getDescription());
    }
View Full Code Here

Examples of slash.navigation.base.Wgs84Position

        assertEquals(49.375783, position.getLatitude());
        assertEquals("Holsteinbruch Bei Worzeldorf B - Gc13vv5", position.getDescription());
    }

    public void testParseNegativePosition() {
        Wgs84Position position = format.parsePosition("-8.6180900,-50.2175100,\"ABC\"", null);
        assertEquals(-8.618090, position.getLongitude());
        assertEquals(-50.217510, position.getLatitude());
        assertEquals("Abc", position.getDescription());
    }
View Full Code Here

Examples of slash.navigation.base.Wgs84Position

    public void testParsePosition() {
        Map<String,String> map = new HashMap<String,String>();
            map.put("Longitude", "11753270");
        map.put("Latitude", "47688350");

        Wgs84Position position1 = format.parsePosition(map);
        assertNotNull(position1);
        assertDoubleEquals(11.75327, position1.getLongitude());
        assertDoubleEquals(47.68835, position1.getLatitude());
        assertNull(position1.getElevation());
        assertNull(position1.getTime());
        assertNull(position1.getDescription());

        map.put("City", "Innsbruck");
        map.put("County","Tirol");

        Wgs84Position position2 = format.parsePosition(map);
        assertNotNull(position2);
        assertEquals("Innsbruck, Tirol", position2.getDescription());

        map.put("State","A");

        Wgs84Position position3 = format.parsePosition(map);
        assertNotNull(position3);
        assertEquals("A Innsbruck, Tirol", position3.getDescription());

        map.put("Address","39 Gumppstrasse");
        map.put("Zip","6020");

        Wgs84Position position4 = format.parsePosition(map);
        assertNotNull(position4);
        assertEquals("A-6020 Innsbruck, Tirol, 39 Gumppstrasse", position4.getDescription());
    }
View Full Code Here

Examples of slash.navigation.base.Wgs84Position

        String height = lineMatcher.group(10);
        String speed = lineMatcher.group(11);
        String hdop = lineMatcher.group(12);
        String satellites = lineMatcher.group(13);

        Wgs84Position position = new Wgs84Position(longitude, latitude, parseDouble(height), parseDouble(speed),
                parseDateAndTime(date, time), null);
        position.setHdop(parseDouble(hdop));
        position.setSatellites(parseInt(satellites));
        return position;
    }
View Full Code Here

Examples of slash.navigation.base.Wgs84Position

        Double latitude = parseDouble(lineMatcher.group(2));
        Double longitude = parseDouble(lineMatcher.group(3));
        Double elevation = parseDouble(lineMatcher.group(4));
        CompactCalendar time = parseTime(trim(lineMatcher.group(5)), trim(lineMatcher.group(6)));

        Wgs84Position position = new Wgs84Position(longitude, latitude, elevation, null, time, description);
        position.setStartDate(startDate);
        return position;
    }
View Full Code Here

Examples of slash.navigation.base.Wgs84Position

    public TomTomPosition asTomTomRoutePosition() {
        return this;
    }

    public Wgs84Position asWgs84Position() {
        Wgs84Position position = super.asWgs84Position();
        position.setHeading(getHeading());
        return position;
    }
View Full Code Here

Examples of slash.navigation.base.Wgs84Position

        if (!lineMatcher.matches())
            throw new IllegalArgumentException("'" + line + "' does not match");
        String latitude = lineMatcher.group(1);
        String longitude = lineMatcher.group(2);
        String elevation = lineMatcher.group(3);
        return new Wgs84Position(parseDouble(longitude), parseDouble(latitude), parseDouble(elevation), null, null, null);
    }
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.