@Override
	public void endElement(String uri, String localName, String qName) throws SAXException
	{
            switch (qName) {
                case "node":
                    if (convertRoadTypeToInt(roadType) != -1)
                    {
                        edges.add(new Edge(placeNameNode, placeNameNode, convertRoadTypeToInt(roadType), placeName, 0, convertRoadTypeToSpeedLimit(roadType)));
                    }
                    roadType = "";
                    placeName = "";
                    createNode = false;
                    placeNameNode = null;
                    break;
                case "way":
                    Node fromNode = null;
                    if (convertRoadTypeToInt(roadType) != -1 || convertRoadTypeToInt(roadType) == 99)
                    {
                        for (Node node : nodesOnWay)
                        {
                            if (fromNode != null)
                            {
                                edges.add(new Edge(fromNode, node, convertRoadTypeToInt(roadType), roadName, 0, convertRoadTypeToSpeedLimit(roadType)));
                                nodesDownloadedPct += (double) 1 / 6500000;
                                fromNode = node;
                            } else
                            {
                                fromNode = node;
                            }
                        }
                    }
                    // reset
                    roadName = "";
                    roadType = "";
                    fromNode = null;
                    nodesOnWay = new ArrayList<>();
                    createWay = false;
                    break;
            }
	}