forked from Project-OSRM/osrm-backend
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: in table.response using osrmtype.waypoint instead of route.waypoint
issue: #137
- Loading branch information
1 parent
8fa5111
commit e75e0b1
Showing
2 changed files
with
18 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package osrmtype | ||
|
||
// Waypoint object used to describe waypoint used in route or table. | ||
type Waypoint struct { | ||
Name string `json:"name"` | ||
Location [2]float64 `json:"location,omitempty"` // [longitude, latitude] | ||
Distance float64 `json:"distance"` | ||
Hint string `json:"hint"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
package table | ||
|
||
import "github.com/Telenav/osrm-backend/integration/pkg/api/osrm/route" | ||
import ( | ||
"github.com/Telenav/osrm-backend/integration/pkg/api/osrm/osrmtype" | ||
) | ||
|
||
// Response represents OSRM api v1 table response. | ||
type Response struct { | ||
Code string `json:"code"` | ||
Message string `json:"message,omitempty"` | ||
Sources []*route.Waypoint `json:"sources"` | ||
Destinations []*route.Waypoint `json:"destinations"` | ||
Durations [][]*float64 `json:"durations"` | ||
Distances [][]*float64 `json:"distances"` | ||
Code string `json:"code"` | ||
Message string `json:"message,omitempty"` | ||
Sources []*osrmtype.Waypoint `json:"sources"` | ||
Destinations []*osrmtype.Waypoint `json:"destinations"` | ||
Durations [][]*float64 `json:"durations"` | ||
Distances [][]*float64 `json:"distances"` | ||
} |