tracktable.rw.read_write_json module

Module contents

tracktable.rw.read_write_json - Read/Write a trajectory from/to a JSON file

tracktable.rw.read_write_json.json_file_from_trajectory(trajectory, json_filename)[source]

Constructes a json file from the given trajectory

Parameters:
  • json_filename (File) – the json file to convert into a trajectory representation

  • trajectory (Trajectory) – the trajectory to convert into a json representation

Returns:

Returns a trajectory constructed from the given json file

tracktable.rw.read_write_json.json_from_trajectory(trajectory)[source]

Constructes a json string from the given trajectory

Parameters:

trajectory (Trajectory) – the trajectory to convert into a json representation

Returns:

Returns a json string constructed from the given trajectory

tracktable.rw.read_write_json.json_loads_byteified(json_text)[source]

Constructes a byteified json string from the given json text.

Leveraged from: https://stackoverflow.com/questions/956867/how-to-get-string-objects-instead-of-unicode-from-json

Parameters:

json_text (json) – the json to convert into a json string

Returns:

Returns a byteified json string constructed from the given json text

tracktable.rw.read_write_json.trajectory_from_json(json_string)[source]

Constructes a trajectory from the given json string.

Parameters:

json_string (json) – the json to convert into a trajectory

Returns:

Returns a trajectory constructed from the given json string

tracktable.rw.read_write_json.trajectory_from_json_file(json_filename)[source]

Constructes a trajectory from the given json file

Parameters:

json_filename (File) – the json file to convert into a trajectory representation

Returns:

Returns a trajectory constructed from the given json file