Skip to content

Commit

Permalink
fix #1181, uncompressed geometries regressed into array of strings
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisOSRM committed Sep 15, 2014
1 parent 392c079 commit 9d4b0ca
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Algorithms/PolylineCompressor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

#include <osrm/Coordinate.h>

void PolylineCompressor::encodeVectorSignedNumber(std::vector<int> &numbers, std::string &output)
const
void PolylineCompressor::encodeVectorSignedNumber(std::vector<int> &numbers,
std::string &output) const
{
const unsigned end = static_cast<unsigned>(numbers.size());
for (unsigned i = 0; i < end; ++i)
Expand Down Expand Up @@ -69,8 +69,8 @@ void PolylineCompressor::encodeNumber(int number_to_encode, std::string &output)
}
}

JSON::String PolylineCompressor::printEncodedString(const std::vector<SegmentInformation> &polyline)
const
JSON::String
PolylineCompressor::printEncodedString(const std::vector<SegmentInformation> &polyline) const
{
std::string output;
std::vector<int> delta_numbers;
Expand Down Expand Up @@ -102,12 +102,10 @@ PolylineCompressor::printUnencodedString(const std::vector<SegmentInformation> &
{
if (segment.necessary)
{
std::string tmp, output;
FixedPointCoordinate::convertInternalLatLonToString(segment.location.lat, tmp);
output += (tmp + ",");
FixedPointCoordinate::convertInternalLatLonToString(segment.location.lon, tmp);
output += tmp;
json_geometry_array.values.push_back(output);
JSON::Array json_coordinate;
json_coordinate.values.push_back(segment.location.lat / COORDINATE_PRECISION);
json_coordinate.values.push_back(segment.location.lon / COORDINATE_PRECISION);
json_geometry_array.values.push_back(json_coordinate);
}
}
return json_geometry_array;
Expand Down

0 comments on commit 9d4b0ca

Please sign in to comment.