-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
r.horizon: add json output #3534
Conversation
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.
Over all this looks fine to me. I have a couple of suggestions, which you may certainly dismiss if you like as they are only style related. Your, in my opinion, good choice of using enum for type of format, begs to use switch
statement instead of if..else
. In addition to a clearer, albeit a bit more wordy, code, it has the advantage of being checked by the compiler, should the format options change.
I was mostly stealing from v.db.select implementation:) I can change it to switch, it's just I forgot it even existed since it was not in Python (looks like it is there now). |
This PR adds JSON format to r.horizon. Adds option
format
which can beplain
(default, the previous output format) orjson
.I am open to alternative JSON schemes if others think they would be better. For the context, I plan to add support for multiple points.