~ihabunek/triglav

7e76fd2aa776a609cd08b66a1e7da7a584b5f0a1 — Ivan Habunek 7 months ago bbf65a1
Fix router bug when relation contains a single way
1 files changed, 3 insertions(+), 0 deletions(-)

M lib/triglav/osm/router.ex
M lib/triglav/osm/router.ex => lib/triglav/osm/router.ex +3 -0
@@ 50,6 50,9 @@ defmodule Triglav.Osm.Router do
    end
  end

  # If the relation contains only one way, this is not routable
  defp annotate_ways([_]), do: {:error, :cannot_route_single_way}

  defp annotate_ways(ways), do: annotate_ways(ways, [])

  defp annotate_ways([], annotated_ways), do: {:ok, Enum.reverse(annotated_ways)}