Add changelog entry
This commit is contained in:
parent
5f9ccadd6c
commit
b3957d87b4
@ -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!)
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user