Input data¶
To be able to perform the routing, we need a minimum set of data. When the input filters are not able to provide all needed data intermediate filters could be used to reconstruct the missing entries if possible. Additional data can be provided to increase the accuracy.
Data overview¶
Track¶
To perform the routing or matching, the filters have to provide at least two coordinate pairs (latitude and longitude; PointList).
If possible, the following data should be provided for each point, too:
heading (does not have to be complete, points without a heading are allowed) (
HeadingList)timestamp (
TimeList)velocity (
VelocityList)
Street Map¶
To built the routable street graph, the filters have to provide the following data *for each street item*:
coordinates (at least two coordinate pairs) (
SegmentList)identifiers for the two endpoints (junctions) (
NodePairList)allowed travel direction (forwards, backwards, both) (
TravelDirectionList)
Input filter¶
The data must be provided by one or more filters.
See also
See filter to learn how to implement and plug in a filter.
Track¶
Fig. 2 Track data¶
In Fig. 2 Track data you see an example track and the representing data lists which have to be filled by the filters.
For a track to be complete, the following requirements have to be fulfilled by one or more filters:
PointListData type:
PointList
HeadingListorPartialHeadingList(both optional)Use the latter if the listing may contain NaN items. Using
PartialHeadingList, a filter that can reconstruct the missing heading data (fulfillingHeadingList) could easily be plugged in.Data type:
HeadingList
Note
For NaN items, use:
std::numeric_limits<AppComponents::Common::Types::Track::Heading>::quiet_NaN()
TimeList(optional)Data type:
TimeList
VelocityList(optional)Data type:
VelocityList
Example skeleton:
1class MyTrackReader : public AppComponents::Common::Filter::Filter
2{
3public:
4 MyTrackReader( std::istream & input );
5 bool operator()(
6 AppComponents::Common::Types::Track::TimeList &,
7 AppComponents::Common::Types::Track::PointList &,
8 AppComponents::Common::Types::Track::HeadingList &,
9 AppComponents::Common::Types::Track::VelocityList & );
10
11private:
12 std::istream & input_;
13};
14
15
16MyTrackReader::MyTrackReader( std::istream & input )
17: Filter( "MyTrackReader" ), input_( input )
18{
19 setRequirements( {} );
20 setOptionals( {} );
21 setFulfillments( { "TimeList", "PointList", "HeadingList", "VelocityList" } );
22}
23
24bool MyTrackReader::operator()(
25 Common::Types::Track::TimeList & timeList,
26 Common::Types::Track::PointList & pointList,
27 Common::Types::Track::HeadingList & headingList,
28 Common::Types::Track::VelocityList & velocityList )
29{
30 APP_LOG_TAG( noise, "I/O" ) << "Reading track";
31
32 // read `input_` filling `timeList`, `pointList`, `headingList` and `velocityList`
33
34 return true;
35}
Street Map¶
Fig. 3 Street map data¶
In Fig. 3 Street map data you see an example street map and the representing data lists which have to be filled by the filters.
For a street map to be complete, the following requirements have to be fulfilled by one or more filters:
SegmentListData type:
SegmentList
NodePairListData type:
NodePairList
TravelDirectionListData type:
TravelDirectionList
Example skeleton:
1class MyStreetMapReader : public AppComponents::Common::Filter::Filter
2{
3public:
4 MyStreetMapReader( std::istream & input );
5 bool operator()(
6 Types::Street::SegmentList &,
7 Types::Street::NodePairList &,
8 Types::Street::TravelDirectionList & );
9
10private:
11 std::istream & input_;
12};
13
14
15MyStreetMapReader::MyStreetMapReader( std::istream & input )
16: Filter( "MyStreetMapReader" ), input_( input )
17{
18 setRequirements( {} );
19 setOptionals( {} );
20 setFulfillments( { "SegmentList", "NodePairList", "TravelDirectionList" } );
21}
22
23bool MyStreetMapReader::operator()(
24 Types::Street::SegmentList & segmentList,
25 Types::Street::NodePairList & nodePairList,
26 Types::Street::TravelDirectionList & travelDirectionList )
27{
28 APP_LOG_TAG( noise, "I/O" ) << "Reading street map";
29
30 // read `input_` filling `segmentList`, `nodePairList` and `travelDirectionList`
31
32 return true;
33}