Add changelog entry

This commit is contained in:
Patrick Niklaus 2016-04-20 20:51:45 +02:00
parent 5f9ccadd6c
commit b3957d87b4
No known key found for this signature in database
GPG Key ID: E426891B5F978B1B
2 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,8 @@
# 5.0.0
- API:
- if `geometry=geojson` is passed the resulting geometry can be a LineString or Point
depending on how many coordinates are present.
# 5.0.0 RC2
- Profiles:
- `properties.allow_uturns_at_via` -> `properties.continue_straight_at_waypoint` (value is inverted!)

View File

@ -50,16 +50,17 @@ template <typename ForwardIter> util::json::String makePolyline(ForwardIter begi
template <typename ForwardIter>
util::json::Object makeGeoJSONGeometry(ForwardIter begin, ForwardIter end)
{
auto distance = std::distance(begin, end);
auto num_coordinates = std::distance(begin, end);
BOOST_ASSERT(num_coordinates != 0);
util::json::Object geojson;
if (distance > 1)
if (num_coordinates > 1)
{
geojson.values["type"] = "LineString";
util::json::Array coordinates;
std::transform(begin, end, std::back_inserter(coordinates.values), &detail::coordinateToLonLat);
geojson.values["coordinates"] = std::move(coordinates);
}
else if (distance > 0)
else if (num_coordinates > 0)
{
geojson.values["type"] = "Point";
util::json::Array coordinates;