/** * @return An expanded {@link PolyLine} */ public PolyLine asPolyLine() { boolean lat = true; int latitude = 0; int longitude = 0; final List<Location> locations = new ArrayList<>(); for (int index = 0; index < this.positions.length; index++) { final byte[] result = this.positions[index]; if (lat) { latitude += expand(result, index); lat = false; } else { longitude += expand(result, index); locations.add(new Location(Latitude.dm7(latitude), Longitude.dm7(longitude))); lat = true; } } return new PolyLine(locations); }