Skip to content
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.category: add JSON support #4018

Merged
merged 3 commits into from
Jul 19, 2024
Merged

r.category: add JSON support #4018

merged 3 commits into from
Jul 19, 2024

Conversation

kritibirda26
Copy link
Contributor

The JSON output looks as follows:

[
    {
        "category": 1,
        "description": "trees, very green"
    },
    {
        "category": 2,
        "description": "water, very deep"
    }
]

Note that the format option for this module is named as output_format because format is being used as the name for another option.

@github-actions github-actions bot added raster Related to raster data processing C Related code is in C HTML Related code is in HTML module docs labels Jul 10, 2024
Copy link
Contributor

@cwhite911 cwhite911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kritibirda26 overall this looks good.

I have a few thoughts about some additional features we could add, but they are outside of the scope of this PR. So, just for a quick discussion should we make some new feature issues for the following ideas.

  1. Color option - We should add a new option that outputs the category color. In any use case where the user wants to create a visualization they will want to know the category label and color.
  2. JSON input - Allow user to use json as the rules file. As part of this we might just want to look at a way to allow this for all spots where we have a text rules files.

raster/r.category/main.c Show resolved Hide resolved
raster/r.category/main.c Show resolved Hide resolved
@kritibirda26
Copy link
Contributor Author

Hi @cwhite911 and @echoix, I have updated the PR according to the feedback and created issues for the suggested new features. The PR should be ready to merge.

@echoix
Copy link
Member

echoix commented Jul 18, 2024

I have nothing to say against, but I would prefer another approval to be confident.

@echoix echoix merged commit c1f55e3 into OSGeo:main Jul 19, 2024
26 checks passed
@neteler neteler added this to the 8.5.0 milestone Jul 21, 2024
Mahesh1998 pushed a commit to Mahesh1998/grass that referenced this pull request Sep 19, 2024
* r.category: add JSON support

* add test and docs

* address PR feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C docs HTML Related code is in HTML module raster Related to raster data processing
Projects
Development

Successfully merging this pull request may close these issues.

4 participants