private void parseAndStoreLandmark() throws IOException {
        /*
         * migrated from jWMMG so old code does not completely follow the code
         * standard.
         */ 

        int lmFlags = m_rdis.readUnsignedShort();
        String lmStreetname =
            getStringFromIndex(m_rdis.readUnsignedShort());
        int id_and_startstop = m_rdis.readUnsignedShort();
        // distance is int32 but we don't expect negative values
        int distance = m_rdis.readInt();
        // have now read entire Landmark
        
        int id = Landmark.id_and_startstop_to_id(id_and_startstop);
        // note that this Waypoint does not yet exist!
        int approachWPTIdx = m_waypoints.size();

        Landmark lm;

        if (Landmark.isPoint(id_and_startstop)
            || Landmark.isStart(id_and_startstop)) {
            // create
            lm = new Landmark(approachWPTIdx,
                              distance,
                              lmFlags,
                              lmStreetname,
                              id);
            if (m_landmarks.size() != id) {
                if(LOG.isError()) {
                    LOG.error("Nav2RouteParser.parseAndStoreLandmark()",
                              "inconsistent landmark id (1) " + id);
                }
                return; // ignore this LM
            }

            m_landmarks.addElement(lm);

        } else {
            try {
                lm = (Landmark) m_landmarks.elementAt(id);
            } catch (ArrayIndexOutOfBoundsException e) {
                if(LOG.isError()) {
                    LOG.error("Nav2RouteParser.parseAndStoreLandmark()",
                              "inconsistent landmark id (2) " + id);
                }

                return; // ignore this LM
            }
        }

        if (Landmark.isPoint(id_and_startstop)
            || Landmark.isEnd(id_and_startstop)) {
            lm.setApproachWPTIdxEnd(approachWPTIdx);
            lm.setApproachDistanceEnd(distance);
        }
        
    }