libcity.data.dataset.map_matching_dataset

class libcity.data.dataset.map_matching_dataset.MapMatchingDataset(config)[source]

Bases: libcity.data.dataset.abstract_dataset.AbstractDataset

路网匹配数据集的基类。

_load_dyna()[source]

加载.dyna文件,格式 [dyna_id,type,time,entity_id,location] self.with_time 用于表示轨迹是否包含时间信息 :returns: 数据数组 :rtype: np.ndarray

_load_geo_and_rel()[source]

加载.geo文件,格式[geo_id, type, coordinates, properties(若干列)] 加载.rel文件,格式[rel_id, type, origin_id, destination_id, properties(若干列)], .rel文件用来表示路网数据

Returns

networkx.MultiDiGraph

Return type

self.rd_nwk

_load_truth_dyna()[source]

加载.dyna文件,格式: 每行一个 rel_id 或一组 rel_id Returns:

_load_usr()[source]

加载.usr文件, 格式 [usr_id] :returns: self.usr_lst 用户id的集合 :rtype: np.ndarray

get_data()[source]

返回训练数据、验证数据、测试数据 对于MapMatching,训练数据和验证数据为None。 :returns: {

‘trajectory’: np.array (time, lon, lat) if with_time else (lon, lat) ‘rd_nwk’: networkx.MultiDiGraph ‘route’: ground truth, numpy array }

Return type

dictionary

get_data_feature()[source]

返回一个 dict,包含数据集的相关特征

Returns

包含数据集的相关特征的字典

Return type

dict

class libcity.data.dataset.map_matching_dataset.UnionSet(n)[source]

Bases: object

find(index)[source]
print()[source]
union(index1, index2)[source]