Input/Output

write(skmob_df, file)

Write a TrajDataFrame to a json file.

read(file)

Read a TrajDataFrame from a json file.

load_geolife_trajectories(...[, user_ids, ...])

Load the Geolife trajectories in a TrajDataFrame

skmob.io.file.load_geolife_trajectories(path_to_geolife_data_dir, user_ids=[], filter_kwargs={'max_speed_kmh': 400}, compress_kwargs={'spatial_radius_km': 0.2})

Load the Geolife trajectories in a TrajDataFrame

Parameters
  • path_to_geolife_data_dir – str local path of the directory ‘Geolife Trajectories 1.3/’

  • user_ids – list list of user IDs to load. If empty all users are loaded.

  • filter_kwargs – dict arguments of preprocessing.filtering.filter(). If empty, data is not filtered.

  • compress_kwargs – dict arguments of preprocessing.compression.compress(). If empty, data is not compressed.

Returns

TrajDataFrame a TrajDataFrame containing all trajectories

Return type

TrajDataFrame

skmob.io.file.read(file)

Read a TrajDataFrame from a json file.

Parameters

file – str path and name of the json file to read.

Returns

object loaded from file.

skmob.io.file.write(skmob_df, file)

Write a TrajDataFrame to a json file.

Parameters
  • skmob_df – TrajDataFrame object that will be saved.

  • file – str path and name of the json output file.

Returns

None