Skip to content

r.regression.line: Add JSON support #5993

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

Merged
merged 2 commits into from
Jul 1, 2025

Conversation

NishantBansal2003
Copy link
Contributor

Fixes: #5950

This PR adds JSON support to the r.regression.line module. The JSON output looks like:

{
	"a": -1.6592786233805945,
	"b": 1.0439679629649166,
	"R": 0.8940383063008781,
	"N": 225000,
	"F": 896093.366283,
	"x_mean": 110.30757108713786,
	"x_stddev": 20.311997672696272,
	"y_mean": 113.49829166406644,
	"y_stddev": 23.718306793642626
}

This PR includes the following changes:

  1. Adds a format option with plain, shell, and json modes for output formatting.
  2. Adds format = shell option; the -g flag is now deprecated.
  3. Adds tests covering each of the new formats.
  4. Adds a Python example to the documentation for parsing JSON output.

@github-actions github-actions bot added raster Related to raster data processing Python Related code is in Python C Related code is in C module docs markdown Related to markdown, markdown files tests Related to Test Suite CMake labels Jun 30, 2025
@cwhite911 cwhite911 added the gsoc Reserved for Google Summer of Code student(s) label Jun 30, 2025
@cwhite911 cwhite911 moved this to In Progress in GRASS JSON Outputs Jun 30, 2025
@cwhite911 cwhite911 added this to the 8.5.0 milestone Jun 30, 2025
@petrasovaa petrasovaa merged commit 4ae5cc2 into OSGeo:main Jul 1, 2025
27 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in GRASS JSON Outputs Jul 1, 2025
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 CMake docs gsoc Reserved for Google Summer of Code student(s) markdown Related to markdown, markdown files module Python Related code is in Python raster Related to raster data processing tests Related to Test Suite
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Feat] Add JSON output to r.regression.line
3 participants