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

[Bug] r.info: format=json does not respect flags #4039

Open
veroandreo opened this issue Jul 12, 2024 · 4 comments
Open

[Bug] r.info: format=json does not respect flags #4039

veroandreo opened this issue Jul 12, 2024 · 4 comments
Labels
bug Something isn't working gsoc Reserved for Google Summer of Code student(s)

Comments

@veroandreo
Copy link
Contributor

Describe the bug

r.info with format=json does not seem to respect the flags and always prints the same info.

To reproduce

r.info -r map=elevation format=json
r.info -g map=elevation format=json
r.info -h  map=elevation format=json
r.info -e  map=elevation format=json

They all print this:

{
    "north": 228500,
    "south": 215000,
    "nsres": 10,
    "east": 645000,
    "west": 630000,
    "ewres": 10,
    "rows": 1350,
    "cols": 1500,
    "cells": 2025000,
    "datatype": "FCELL",
    "ncats": 255,
    "min": 55.578792572021484,
    "max": 156.32986450195312,
    "map": "elevation",
    "maptype": "raster",
    "mapset": "PERMANENT",
    "location": "nc_spm_08_grass7",
    "project": "nc_spm_08_grass7",
    "database": "\/home\/vandreo\/grassdata",
    "date": "Tue Nov  7 01:09:51 2006",
    "creator": "helena",
    "title": "South-West Wake county: Elevation NED 10m",
    "timestamp": null,
    "units": null,
    "vdatum": null,
    "semantic_label": null,
    "source1": "",
    "source2": "",
    "description": "generated by r.proj",
    "comments": [
        "r.proj input=\"ned03arcsec\" location=\"northcarolina_latlong\" mapset=\"\\",
        "helena\" output=\"elev_ned10m\" method=\"cubic\" resolution=10"
    ]
}

Expected behavior

format=json should print only what the flag indicates as format=plain does

System description

GRASS version: 8.5.0dev                                                         
Code revision: ee9fa48798                                                       
Build date: 2024-07-11                                                          
Build platform: x86_64-pc-linux-gnu                                             
GDAL: 3.7.1                                                                     
PROJ: 9.2.1                                                                     
GEOS: 3.12.0                                                                    
SQLite: 3.42.0                                                                  
Python: 3.11.6                                                                  
wxPython: 4.2.1                                                                 
Platform: Linux-6.5.0-44-generic-x86_64-with-glibc2.38                          
@veroandreo veroandreo added bug Something isn't working gsoc Reserved for Google Summer of Code student(s) labels Jul 12, 2024
@veroandreo
Copy link
Contributor Author

@kritibirda26 would you mind having a look?

@kritibirda26
Copy link
Contributor

Hi @veroandreo! This is the intended behavior. As per the discussion at #3744, only the -s flag is respected.

@veroandreo
Copy link
Contributor Author

Hi @veroandreo! This is the intended behavior. As per the discussion at #3744, only the -s flag is respected.

I see, would you please document that behavior in the r.info manual page? I found it pretty confusing that flags were not respected.

@kritibirda26
Copy link
Contributor

Sure, will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working gsoc Reserved for Google Summer of Code student(s)
Projects
None yet
Development

No branches or pull requests

2 participants