Examples of Lmx


Examples of slash.navigation.lmx.binding.Lmx

        return new NokiaLandmarkExchangeRoute(name, asDescription(description), positions, lmx);
    }

    private Lmx createLmx(NokiaLandmarkExchangeRoute route, int startIndex, int endIndex) {
        ObjectFactory objectFactory = new ObjectFactory();
        Lmx lmx = route.getLmx();
        if (lmx != null) {
            if (lmx.getLandmark() != null)
                lmx.setLandmark(null);
        } else
            lmx = objectFactory.createLmx();

        LandmarkCollectionType landmarkCollectionType = lmx.getLandmarkCollection();
        if (landmarkCollectionType == null)
            landmarkCollectionType = objectFactory.createLandmarkCollectionType();
        landmarkCollectionType.setName(asRouteName(route.getName()));
        landmarkCollectionType.setDescription(asDescription(route.getDescription()));

        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);
        }

        lmx.setLandmarkCollection(landmarkCollectionType);
        return lmx;
    }
View Full Code Here

Examples of slash.navigation.lmx.binding.Lmx

        lmx.setLandmarkCollection(landmarkCollectionType);
        return lmx;
    }

    public void read(InputStream source, CompactCalendar startDate, ParserContext<NokiaLandmarkExchangeRoute> context) throws Exception {
        Lmx lmx = unmarshal(source);
        context.appendRoute(process(lmx));
    }
View Full Code Here

Examples of slash.navigation.lmx.binding.Lmx

        );
    }


    public static Lmx unmarshal(InputStream in) throws JAXBException {
        Lmx result = null;
        try {
            result = (Lmx) newUnmarshaller().unmarshal(in);
        } catch (ClassCastException e) {
            throw new JAXBException("Parse error: " + e, e);
        }
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.