Conversation
nilason
left a comment
There was a problem hiding this comment.
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
formatwhich 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.