parse Semantic Timeline
Parse JSON string to SemanticTimeline object.
This method efficiently parses Google Takeout Semantic Location History JSON data using cached adapters for optimal performance on repeated calls.
Return
Parsed SemanticTimeline object
Parameters
json
The JSON string containing SemanticTimeline data
Throws
Json Data Exception
if the JSON is malformed or missing required fields
if json parameter is null
// Sample usage of parser to parse semantic timeline JSON.
val parser = Parser()
val json: String = File("your-file.json").bufferedReader().readText()
val semanticTimeline: SemanticTimeline = parser.parseSemanticTimeline(json)
println("Got semantic timeline: ${semanticTimeline.timelineObjects.size} objects.")
Content copied to clipboard
Parse JSON buffered source to SemanticTimeline object.
This method efficiently parses Google Takeout Semantic Location History JSON data using cached adapters and is recommended for large files as it provides better I/O performance.
Return
Parsed SemanticTimeline object
Parameters
buffered Source
The BufferedSource containing SemanticTimeline JSON data
Throws
Json Data Exception
if the JSON is malformed or missing required fields
if bufferedSource parameter is null
// Sample usage of parser to parse semantic timeline JSON.
val parser = Parser()
val bufferedSource: BufferedSource = File("your-file.json").source().buffer()
val semanticTimeline: SemanticTimeline = parser.parseSemanticTimeline(bufferedSource)
println("Got semantic timeline: ${semanticTimeline.timelineObjects.size} objects.")
Content copied to clipboard