-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the own data export #542
Comments
e-mission already exports the data for a single day in geojson format. I picked geojson precisely because it was a standard. See Some examples of the resulting output, that are used in the unit tests, can be found at https://github.com/e-mission/e-mission-server/tree/master/emission/tests/data/real_examples/ (files ending with I am pretty sure that the geojson generated by e-mission doesn't follow the tracejson extension because I hadn't heard about it before. I don't think it was popular at the time that I wrote that code in 2015 😄 But it should be fairly easy to change it to be compatible - the UI code would also need some minor fixes. "Download JSON dump" is really intended to download the raw data from the server. So if users want to verify what data is collected about them, potentially load it to their own server, or work on enhancements to the algorithms with their own data, they can do so.
There is already a wrapper function: https://github.com/e-mission/e-mission-phone/blob/5fe208d8623fcb1b933e167e83bed3cebf17134f/www/js/services.js#L49 So it should be fairly trivial to include another button labelled "Export as geojson" which calls that method instead of I should be able to get to this when I make the next set of small client fixes. But it should be pretty easy for you to add and submit a PR if you want to get it before that. |
@nlehuby one caveat/question: the geojson can ONLY be generated for processed data. So if the user selects a day that has not yet been processed, they will not get any export. Would be good if we could think through the UX and user communication in that case. |
Using geojson for the raw data is problematic because there are data types (e.g. I am not aware of a smartphone sensor data standard, but if you do, I would be happy to change to it. |
Indeed, the geojson returned by |
@nlehuby do you want to submit a PR to make the generated geojson compatible with tracejson? It should be fairly straightforward. And then when I get into the client updates, the generated data will already be compatible! |
I guess the changes to output tracejson are quite simple (maybe as simple as that) but I haven't yet managed to install a dev environment to test my changes and I don't yet have clear ideas about the architecture and data flow within the project. |
@nlehuby I fixed #543 last night - it should work now. Make sure to use wrt architecture and data flow, maybe you can check chapter 3 of my thesis and the existing documentation. |
@nlehuby any thoughts on whether you would like to schedule a call to understand the flow better? |
Hello, I haven't had time to get back into it yet. I hope to do it by the end of the week 🤞 |
@nlehuby has converted the export to tracejson. The primary change there is that the UX:
We do use
or
or
So I will merge the other change when I make this one. |
Thinking through how best to reconcile this since we use seconds internally while tracejson uses milliseconds internally. The geojson we get from the server should already be tracejson compatible. For any geojson that we create locally, we should also use milliseconds for compatibility. For other code that works off the geojson, what do we do and where do we translate? For example, the I am going to punt on this for now by returning a new field called "timestamps" instead of editing the existing "times". This makes it completely backwards compatible at the cost of increased verbosity. Then at the end of the upcoming internship, we can fix this for real. |
The `tracejson` format has some open questions around how to represent start and end times. Should they also be milliseconds? What should the labels be, etc? In order to avoid dealing with those issues right now, we return both "times" and "timestamps". The "times" retain backward compatibility with existing code; the "timestamps" ensure that it is valid tracejson. We will revisit this after the paper on mobility standards: e-mission/e-mission-docs#542 (comment)
The `tracejson` format has some open questions around how to represent start and end times. Should they also be milliseconds? What should the labels be, etc? In order to avoid dealing with those issues right now, we return both "times" and "timestamps". The "times" retain backward compatibility with existing code; the "timestamps" ensure that it is valid tracejson. We will revisit this after the paper on mobility standards: e-mission/e-mission-docs#542 (comment)
When a user exports his own data over a day in the application, he recovers a very large json dump that is difficult to exploit. The use of a standard format would be more appropriate.
Two candidates seem particularly relevant: GPX and Geojson (with the tracejson extension). Being able to choose between the two formats would be nice to have.
In GPX, each trip would be a
trk
and with can split bytrkseg
if multiple modes. Theextensions
can be used for the metadata.In Geojson, we would need to split by mode I think.
For instance, with two trips
GPX: https://gist.githubusercontent.com/nlehuby/6fb26fb280ff636f1b9461149d3dfa01/raw/45e5e75343a1a1f9d138d816bad79ba64d4e7b0a/map.gpx
Geojson: https://gist.githubusercontent.com/nlehuby/5589cf45879f6e1bfe85db1ba44ada0c/raw/87b8c3d59971cd9091e967f19289a54ef1bfcbcf/map.geojson
The text was updated successfully, but these errors were encountered: