-
Notifications
You must be signed in to change notification settings - Fork 19
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
Issue #601 fieldnotes #630
base: master
Are you sure you want to change the base?
Conversation
9eea97d
to
2d546a1
Compare
@wrygiel: could you please review this pull request when you have a chance? Thank you! |
88bf7b2
to
9bda9e2
Compare
Hi! I'm not much familiar with this. Can you point me to some docs explaining what are field notes, and how they differs from log entries? |
I am not aware of any documentation but I can quickly explain what it is and also post an example. Some applications on the smartphone, such as: cgeo, Locus Map, Garmin, Looking4Cache, Cachly provide a capability to "offline log" a geocache out in the field, an important function if you don't have a mobile carrier out there. These offline logs end up in a file (or internal data structure) that consists of one or more CSV formatted records like this:
There are some complications associated with this though. First: It is not standardized. Some tools encode For this reason I explilcitly require the client app to convert it on their side to character encoding The OCDE website can parse such a file via upload from the browser. The user can then, for each draft log, edit the log text and finally submit it a real log. With this PR I provide the capability to client applications to directly upload their fieldnotes file into the database as draft logs. Once they are up, there is no difference compared to manual upload via the browser and the filesystem. |
Isn't it the same as submitting a series of logs via Is the idea to move some work related to processing the file from the app to the server? |
I apologize for being not precise enough: It is not the same as submitting log. Submitting a log is the final transaction that also records a statistics update for the cacher and more importantly makes this log visible in the cache listing. The upload fieldnotes function puts these logs into a draft state, they will not be commited as real logs yet. There go into a separate table in the database (details). There is a UI in OCDE (as it is on other platforms) to manage these draft logs, e.g. by editing the log text, change time/date, perhaps changinf the log type and then, at the end, press the "submit" button which finally commits a draft log into a real log and this making it visible to othersin the cache listing. Does this help? Let me know if it doesn't |
Ah, got it, so a "field note" is a "draft log entry". Yes, I can review it now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed the docs only for now. Once we agree on the API, I will review the code too.
376d223
to
370b545
Compare
77650d9
to
36b7e8a
Compare
A remark on character encoding of the However, and for whatever reason cgeo uses an obscure encoding, which I believe is not even standardized. I also know that cgeo hast changed that a few years to what it is now. For reference I include a cgeo fieldnotes file header in hex such that you can draw your own conclusion:
The only thing that's clear is that it is a 16-bit encoding, however:
It seems to be UTF-16LE without BOM. So what do we do, accept this format? Tell cgeo to encode in UTF-8? Be very smart and accept it all whatever it is? Update: I generated a very short line, a single log. Such that I could paste it into the OKAPI browser:
And guess what: The OKAPI browser's signature was also rejected by the OKAPI server:
So this tells me (what I actually new ahead of time), that this input format you see above (in hex) is actually garbage, however, garbage I can't make cgeo change. I will do one more test with PLAINTEXT signature on this payload but I am almost sure it will fail too as that character encoding is not understood by PHP and it can't be converted as I have already tried:
|
The uncommon encoding has historic reasons. It was specified/implemented that way a long, long time ago together with Garmin GPS receivers and hasn't changed since then. |
4785220
to
07c469c
Compare
07c469c
to
59d7d87
Compare
I am proposing the following design point: