grass icon indicating copy to clipboard operation
grass copied to clipboard

g.region: add JSON support

Open kritibirda opened this issue 1 year ago • 0 comments

Using parson, add JSON support to g.region module.

The output looks like as follows:

{
    "projection": 99,
    "zone": 0,
    "region": {
        "north": 228500,
        "south": 215000,
        "west": 630000,
        "east": 645000,
        "ns-res": 10,
        "ns-res3": 10,
        "ew-res": 10,
        "ew-res3": 10
    },
    "top": 1,
    "bottom": 0,
    "tbres": 1,
    "rows": 1350,
    "rows3": 1350,
    "cols": 1500,
    "cols3": 1500,
    "depths": 1,
    "cells": 2025000,
    "cells3": 2025000
}

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.

kritibirda avatar Jun 29 '24 09:06 kritibirda