grass icon indicating copy to clipboard operation
grass copied to clipboard

[Feat] Improve JSON in v.to.db

Open petrasovaa opened this issue 6 months ago • 2 comments

Is your feature request related to a problem? Please describe. There are couple things to address in the current JSON schema, mainly consistency.

  • [ ] The key "unit", should be renamed to "units" and should look like totals:
    "units": {
        "length": "kilometers"
    },
    "totals": {
        "length": 38.839528111915129
    },

This will be more consistent and in the future if we decide to implement printing multiple geometry attributes, the units could be different for each attribute.

  • [ ] Also, totals and units should appear everytime, but if it does not apply, it should be empty {}.

  • [ ] update tests

  • [ ] add example to documentation, a simple Python one showing the JSON output

petrasovaa avatar May 21 '25 03:05 petrasovaa

Has this already been addressed in https://github.com/OSGeo/grass/pull/4036, or is there something else that still needs updating?

NishantBansal2003 avatar Jun 14 '25 18:06 NishantBansal2003

I somehow forgot this was implemented, I reviewed the implementation and changed the PR description.

petrasovaa avatar Jun 16 '25 15:06 petrasovaa