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.describe: Add JSON support #4918

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion raster/r.describe/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ MODULE_TOPDIR = ../..

PGM = r.describe

LIBES = $(RASTERLIB) $(GISLIB)
LIBES = $(RASTERLIB) $(GISLIB) $(PARSONLIB)
DEPENDENCIES = $(RASTERDEP) $(GISDEP)

include $(MODULE_TOPDIR)/include/Make/Module.make
Expand Down
12 changes: 7 additions & 5 deletions raster/r.describe/describe.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
#include <grass/gis.h>
#include <grass/raster.h>
#include <grass/glocale.h>

#include "local_proto.h"

int describe(const char *name, int compact, char *no_data_str, int range,
int windowed, int nsteps, int as_int, int skip_nulls)
int windowed, int nsteps, int as_int, int skip_nulls,
enum OutputFormat format)
{
int fd;
struct Cell_stats statf;
Expand Down Expand Up @@ -127,20 +129,20 @@ int describe(const char *name, int compact, char *no_data_str, int range,
if (range) {
if (compact)
compact_range_list(negmin, negmax, zero, posmin, posmax, null,
no_data_str, skip_nulls);
no_data_str, skip_nulls, format);
else
range_list(negmin, negmax, zero, posmin, posmax, null, no_data_str,
skip_nulls);
skip_nulls, format);
}
else {
Rast_rewind_cell_stats(&statf);

if (compact)
compact_list(&statf, dmin, dmax, no_data_str, skip_nulls, map_type,
nsteps);
nsteps, format);
else
long_list(&statf, dmin, dmax, no_data_str, skip_nulls, map_type,
nsteps);
nsteps, format);

Rast_free_cell_stats(&statf);
}
Expand Down
Loading
Loading