@Override
		public void endElement(String uri, String localName, String qName)
				throws SAXException {
		    if (qName.equals("LineString")) {
				inLineString = false;
			}
			if (inCoordinate && inLineString && qName.equals("coordinates")) {

				String[] data = coordinates.toString().trim().split("\\s+");

				double lastAlt = 0;
				double distance = 0;
				LatLngExtra lastPoint = null;

				for (String p : data) {
					
					//System.err.println("{{" + p + "}}");
					String[] set = p.split(",");

					double alt = Double.parseDouble(set[2]);

					// Smoothing the altitude
					double smoothAlt = lastAlt == 0 ? alt : SMOOTH_COEF
							* lastAlt + (1 - SMOOTH_COEF) * alt;

					lastAlt = smoothAlt;

					LatLngExtra point = new LatLngExtra(
							Double.parseDouble(set[1]),
							Double.parseDouble(set[0]), smoothAlt);

					if (lastPoint != null) {
						distance += LatLngTool.distance(lastPoint, point,
								LengthUnit.METER);
						point.setDistance(Math.round(distance));

						int bearing = (int) Math.round(LatLngTool
								.initialBearing(lastPoint, point));
						points.get(points.size() - 1).setBearing(bearing);
					}
					lastPoint = point;

					points.add(point);
				}

			}
			
			if (qName.equals("coordinates"))
			{
				inCoordinate = false;
			}
		}