Make PolylineCompresser's encode and decode free standing functions

This commit is contained in:
Daniel J. Hofmann
2016-01-08 13:00:24 +01:00
committed by Patrick Niklaus
parent c590596dbe
commit c65dd16460
5 changed files with 41 additions and 45 deletions
+7 -14
View File
@@ -2,6 +2,7 @@
#define POLYLINECOMPRESSOR_H_
#include "osrm/coordinate.hpp"
#include "engine/segment_information.hpp"
#include <string>
#include <vector>
@@ -10,21 +11,13 @@ namespace osrm
{
namespace engine
{
// Encodes geometry into polyline format.
// See: https://developers.google.com/maps/documentation/utilities/polylinealgorithm
std::string polylineEncode(const std::vector<SegmentInformation> &geometry);
struct SegmentInformation;
class PolylineCompressor
{
private:
std::string encode_vector(std::vector<int> &numbers) const;
std::string encode_number(const int number_to_encode) const;
public:
std::string get_encoded_string(const std::vector<SegmentInformation> &polyline) const;
std::vector<util::FixedPointCoordinate> decode_string(const std::string &geometry_string) const;
};
// Decodes geometry from polyline format
// See: https://developers.google.com/maps/documentation/utilities/polylinealgorithm
std::vector<util::FixedPointCoordinate> polylineDecode(const std::string &polyline);
}
}