@Override
    public void startElement(String uri, String localName, String qName,
            Attributes attributes) throws SAXException {

        if (localName.equalsIgnoreCase("node")) {
            inNode = true;
            CoastlineNode node = getNodeInformation(attributes);
            if (node != null) {
                processNode(node);
            }

        } else if (localName.equalsIgnoreCase("way")) {
            inWay = true;

            String id = attributes.getValue("id");
            if (id != null) {
                edgeID = Integer.parseInt(id);
            }
        }

        if (inWay) {
            if (localName.equalsIgnoreCase("nd")) {
                String ref = attributes.getValue("ref");
                if (ref != null) {
                    try {
                        int parseInt = Integer.parseInt(ref);
                        nodeRefQueue.add(parseInt);
                    } catch (NumberFormatException ex) {
                        Logger.getLogger(CoastlineXMLHandler.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            }
        }
    }