Package slash.navigation.base

Examples of slash.navigation.base.Wgs84Position


        assertFalse(format.isPosition("STREET=\"Tjardaweg\""));
    }

    @Test
    public void testParsePosition() {
        Wgs84Position position = format.parsePosition("STREET=\"Tjardaweg\" PT=\"6.53616 53.24917\"", null);
        assertDoubleEquals(6.53616, position.getLongitude());
        assertDoubleEquals(53.24917, position.getLatitude());
        assertEquals("Tjardaweg", position.getDescription());
        assertNull(position.getElevation());
    }
View Full Code Here


    @Test
    public void testParsePositionsFromNoMapUrl() {
        List<Wgs84Position> positions = parsePositions(NO_MAP_URL);
        assertNotNull(positions);
        assertEquals(2, positions.size());
        Wgs84Position position2 = positions.get(1);
        assertDoubleEquals(7.40361, position2.getLongitude());
        assertDoubleEquals(51.49144, position2.getLatitude());
        assertEquals("44227 Dortmund, Martin-Schmeisser-Weg 8", position2.getDescription());
    }
View Full Code Here

    }

    @Test
    public void testCreateDeURL() {
        List<Wgs84Position> positions = new ArrayList<Wgs84Position>();
        positions.add(new Wgs84Position(10.02571156, 53.57497745, null, 5.5, null, "Hamburg, Germany"));
        positions.add(new Wgs84Position(10.20026067, 53.57662034, null, 4.5, null, "Stemwarde, Germany"));
        positions.add(new Wgs84Position(10.35735078, 53.59171021, null, 3.5, null, "Groöensee, Germany"));
        positions.add(new Wgs84Position(10.45696089, 53.64781001, null, 2.5, null, "Linau, Germany"));
        String expected = "navigon://route/?target=coordinate//10.025711/53.574977&target=coordinate//10.200260/53.576620&target=coordinate//10.357350/53.591710&target=coordinate//10.456960/53.647810";
        String actual = format.createURL(positions, 0, positions.size());
        assertEquals(expected, actual);
    }
View Full Code Here

    }

    @Test
    public void testCreateUsaURL() {
        List<Wgs84Position> positions = new ArrayList<Wgs84Position>();
        positions.add(new Wgs84Position(-113.240014, 36.114526, 1134.0, null, null, "Grand Canyon, Arizona, USA"));
        positions.add(new Wgs84Position(-115.139973, 53.574977, 648.0, null, null, "Las Vegas, Nevada, USA"));
        String expected = "navigon://route/?target=coordinate//-113.240014/36.114526&target=coordinate//-115.139973/53.574977";
        String actual = format.createURL(positions, 0, positions.size());
        assertEquals(expected, actual);
    }
View Full Code Here

        assertFalse(format.isPosition("5     ,T,090421,061057,47.797281N,013.049743E,504  ,0   ,206,         "));
        assertFalse(format.isPosition("INDEX,TAG,DATE,TIME,LATITUDE N/S,LONGITUDE E/W,HEIGHT,SPEED,HEADING,FIX MODE,VALID,PDOP,HDOP,VDOP,VOX"));
    }

    public void testParsePosition() {
        Wgs84Position position = format.parsePosition("2971  ,V,090508,084815,48.132451N,016.321871E,319  ,12  ,207,3D,SPS ,1.6  ,1.3  ,0.9  ,VOX02971", null);
        assertEquals(16.321871, position.getLongitude());
        assertEquals(48.132451, position.getLatitude());
        assertEquals(319.0, position.getElevation());
        assertEquals(12.0, position.getSpeed());
        assertEquals(207.0, position.getHeading());
        assertEquals(1.6, position.getPdop());
        assertEquals(1.3, position.getHdop());
        assertEquals(0.9, position.getVdop());
        String actual = DateFormat.getDateTimeInstance().format(position.getTime().getTime());
        CompactCalendar expectedCal = calendar(2009, 5, 8, 8, 48, 15);
        String expected = DateFormat.getDateTimeInstance().format(expectedCal.getTime());
        assertEquals(expected, actual);
        assertEquals(expectedCal, position.getTime());
        assertEquals("VOX02971", position.getDescription());
    }
View Full Code Here

        if (extra != null)
            description += ";" + extra;
        if (phone != null)
            description += ";" + phone;

        Wgs84Position position = asWgs84Position(longitude, latitude, description);
        position.setStartDate(startDate);
        return position;
    }
View Full Code Here

    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

        if (description == null && POI_POSITION.equals(lineType)) {
            String lineNumber = lineMatcher.group(1);
            description = "POI " + trim(removeZeros(lineNumber));
        }

        Wgs84Position position = new Wgs84Position(longitude, latitude, parseDouble(height), parseDouble(speed),
                parseDateAndTime(date, time), description);
        position.setHeading(parseDouble(heading));
        position.setPdop(parseDouble(pdop));
        position.setHdop(parseDouble(hdop));
        position.setVdop(parseDouble(vdop));
        return position;
    }
View Full Code Here

        String mapName = trim(preferences.get("navigonUrlMapName", null));
        if (mapName != null)
            buffer.append(mapName);
        buffer.append("://route/?");
        for (int i = startIndex; i < endIndex; i++) {
            Wgs84Position position = positions.get(i);
            String longitude = formatDoubleAsString(position.getLongitude(), 6);
            String latitude = formatDoubleAsString(position.getLatitude(), 6);
            if (i > startIndex)
                buffer.append("&");
            buffer.append("target=coordinate//").append(longitude).append("/").append(latitude);
        }
        return buffer.toString();
View Full Code Here

    }

    private List<Wgs84Position> processTrack(TrackT trackT) {
        List<Wgs84Position> result = new ArrayList<Wgs84Position>();
        for (TrackpointT trackpointT : trackT.getTrackpoint()) {
            result.add(new Wgs84Position(convertLongitude(trackpointT.getPosition()),
                    convertLatitude(trackpointT.getPosition()),
                    trackpointT.getAltitudeMeters(),
                    null,
                    parseTime(trackpointT.getTime()),
                    null,
View Full Code Here

TOP

Related Classes of slash.navigation.base.Wgs84Position

Copyright © 2018 www.massapicom. 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.