Method of movement in json export?

I’m trying to understand the json export format. I’d like to use it to generate a report on, for instance, how much time I spent walking vs in a car vs on the bus vs on a motorcycle. I can see the place data and the movement-segment data, but I don’t see any field in there that represents the type of locomotion. Is that missing from the export, or am I just not looking in the correct place?

Hi @BrianEnigma!

There’s two places where you will find that information. The highest level is in the TimelineItem objects in the “activityType” field. For Visit items there will probably not be an activityType value, but for Path items there should almost always be one. That value will be “walking”, “cycling”, etc.

The second place you’ll find it is in the LocomotionSample objects, which represent the individual recorded samples within TimelineItems. Those will have one or two fields - “confirmedType” and “classifiedType”. The first one is the type that you confirmed as correct in the app’s UI (if you did so). The second is the type that the activity type classifier assigned to the sample automatically.

Oh, wow. You are 100% correct. I must have been looking at the wrong day or something. I see those fields now. Thank you for setting me straight.

1 Like

No worries. Sometimes those fields won’t be there, for some timeline items. It’s possible you just stumbled onto some that didn’t have them.

They might be missing if a Path item is … well I can’t think of a good example, but basically yeah it can happen under some conditions. If you’re doing anything programmatic, it’s good to keep in mind that those values aren’t guaranteed! They should be there 99% of the time, but you can’t rely on it - the classifier might not have got to an item yet, and/or you might not have manually classified it either.