-
-
Notifications
You must be signed in to change notification settings - Fork 291
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
g.region: add JSON support #3941
base: main
Are you sure you want to change the base?
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.
@kritibirda26 please address the comments I left in the review and add tests to make sure the JSON format respects the various flag combinations.
} | ||
} | ||
|
||
/* flag.gmt_style */ | ||
if (print_flag & PRINT_GMT) | ||
if ((print_flag & PRINT_GMT) && format != JSON) |
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.
The json format should work with GMT and WMS print flags.
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.
What should be the output format in case of the GMT and WMS flags used with JSON respectively?
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.
The outputs can match what is returned from the plain and shell formats.
{
"GMT": "629970/645000/215010/228540",
"WMS": "bbox=629970,215010,645000,228540"
}
Using parson, add JSON support to g.region module.
The output looks like as follows:
The interaction of format option with existing flags needs more looking into. We may want to disallow some combinations.
I will add tests and update documentation once the JSON format is finalized.