Examples of LongitudeAndLatitude


Examples of slash.navigation.common.LongitudeAndLatitude

                for (BaseNavigationPosition position : route.getPositions()) {
                    if (!position.hasCoordinates())
                        continue;

                    if (position.getDescription() != null) {
                        LongitudeAndLatitude lal = new LongitudeAndLatitude(position.getLongitude(), position.getLatitude());
                        if (comments.get(lal) == null) {
                            comments.put(lal, position.getDescription());
                        }
                    }

                    if (position.getElevation() != null) {
                        LongitudeAndLatitude lal = new LongitudeAndLatitude(position.getLongitude(), position.getLatitude());
                        if (elevations.get(lal) == null) {
                            elevations.put(lal, position.getElevation());
                        }
                    }

                    if (position.getSpeed() != null) {
                        LongitudeAndLatitude lal = new LongitudeAndLatitude(position.getLongitude(), position.getLatitude());
                        if (speeds.get(lal) == null) {
                            speeds.put(lal, position.getSpeed());
                        }
                    }

                    if (position.hasTime()) {
                        LongitudeAndLatitude lal = new LongitudeAndLatitude(position.getLongitude(), position.getLatitude());
                        if (times.get(lal) == null) {
                            times.put(lal, position.getTime());
                        }
                    }
                }
            }

            for (BaseRoute<BaseNavigationPosition, BaseNavigationFormat> route : routes) {
                for (BaseNavigationPosition position : route.getPositions()) {
                    if (!position.hasCoordinates())
                        continue;

                    if (position.getDescription() == null) {
                        LongitudeAndLatitude lal = new LongitudeAndLatitude(position.getLongitude(), position.getLatitude());
                        String comment = comments.get(lal);
                        if (comment != null) {
                            position.setDescription(comment);
                        }
                    }

                    if (position.getElevation() == null) {
                        LongitudeAndLatitude lal = new LongitudeAndLatitude(position.getLongitude(), position.getLatitude());
                        Double elevation = elevations.get(lal);
                        if (elevation != null) {
                            position.setElevation(elevation);
                        }
                    }

                    if (position.getSpeed() == null) {
                        LongitudeAndLatitude lal = new LongitudeAndLatitude(position.getLongitude(), position.getLatitude());
                        Double speed = speeds.get(lal);
                        if (speed != null) {
                            position.setSpeed(speed);
                        }
                    }

                    if (!position.hasTime()) {
                        LongitudeAndLatitude lal = new LongitudeAndLatitude(position.getLongitude(), position.getLatitude());
                        CompactCalendar time = times.get(lal);
                        if (time != null) {
                            position.setTime(time);
                        }
                    }
View Full Code Here

Examples of slash.navigation.common.LongitudeAndLatitude

    @Test
    public void testElevationFor() throws IOException {
        HgtFiles files = new HgtFiles(createDataSource("test id", "test plain", "http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/", "test"),
                new DownloadManager(createTempFile("queueFile", ".xml")));
        files.downloadElevationDataFor(asList(new LongitudeAndLatitude(11.2, 59.0), new LongitudeAndLatitude(12.0, 60.2)));

        Double elevation1 = files.getElevationFor(11.2, 59.0);
        assertNotNull(elevation1);
        assertEquals(40, elevation1.intValue());
        Double elevation2 = files.getElevationFor(12.0, 60.2);
View Full Code Here

Examples of slash.navigation.common.LongitudeAndLatitude

    @Test
    public void testDownloadElevationDataInZipFile() throws IOException {
        HgtFiles files = new HgtFiles(createDataSource("test id", "test zip", "http://www.viewfinderpanoramas.org/dem3/", "test"),
                new DownloadManager(createTempFile("queueFile", ".xml")));
        files.downloadElevationDataFor(asList(new LongitudeAndLatitude(35.71, 32.51)));

        Double elevation1 = files.getElevationFor(35.71, 32.51);
        assertNotNull(elevation1);
        assertEquals(274, elevation1.intValue());
    }
View Full Code Here

Examples of slash.navigation.common.LongitudeAndLatitude

            }
        }
    }

    private LongitudeAndLatitude asLongitudeAndLatitude(NavigationPosition position) {
        return new LongitudeAndLatitude(position.getLongitude(), position.getLatitude());
    }
View Full Code Here

Examples of slash.navigation.common.LongitudeAndLatitude

            return;
        List<LongitudeAndLatitude> longitudeAndLatitudes = new ArrayList<>();
        for (int row : rows) {
            NavigationPosition position = positionsModel.getPosition(row);
            if (position.hasCoordinates())
                longitudeAndLatitudes.add(new LongitudeAndLatitude(position.getLongitude(), position.getLatitude()));
        }
        elevationServiceFacade.downloadElevationDataFor(longitudeAndLatitudes);
    }
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.