grass icon indicating copy to clipboard operation
grass copied to clipboard

Add JSON and YAML C library dependency

Open cwhite911 opened this issue 1 year ago • 3 comments

Discussed in https://github.com/OSGeo/grass/discussions/3019

Originally posted by cwhite911 June 5, 2023 In an effort add additional output data formats to modules (e.g., r.report, r.info, etc..) we are discussing adding new library dependencies to aid in JSON and YAML encoding.

Please share your feedback on the following candidate dependencies.

JSON

parson https://github.com/kgabis/parson/ Current release: 1.5.2 (2023)

Parson is a lightweight json library written in C.

  • [X] Linux
  • [X] Windows
  • [X] Mac OSX

YAML

libyaml https://github.com/yaml/libyaml Current release: 1.2.2 (2021-10-01)

LibYAML is a YAML parser and emitter library.

  • [X] Linux
  • [X] Windows
  • [X] Mac OSX

Related Issues and PRs

  • https://github.com/OSGeo/grass/pull/2666
  • https://github.com/OSGeo/grass/pull/2542
  • https://github.com/OSGeo/grass/pull/2386
  • https://github.com/OSGeo/grass/pull/2258
  • https://github.com/OSGeo/grass/pull/476
  • https://github.com/OSGeo/grass/pull/3033

Candidate Modules

Which modules should have JSON & YAML output support?

General

  • [x] g.mapsets https://github.com/OSGeo/grass/pull/2542
  • [x] g.region (GSoC) https://github.com/OSGeo/grass/pull/3941
  • [ ] g.proj (GSoC) https://github.com/OSGeo/grass/pull/4104
  • [ ] g.mapset
  • [ ] g.list
  • [ ] g.version
  • [ ] etc..

Raster

  • [x] r.univar (GSoC) https://github.com/OSGeo/grass/pull/3783
  • [x] r.report https://github.com/OSGeo/grass/pull/3033
  • [x] r.info (GSoC) https://github.com/OSGeo/grass/pull/3744
  • [x] r.kappa https://github.com/OSGeo/grass/pull/2666
  • [x] r.horizon https://github.com/OSGeo/grass/pull/3768
  • [x] r.what (GSoc) https://github.com/OSGeo/grass/pull/3528
  • [x] r.profile (GSoC) https://github.com/OSGeo/grass/pull/3872
  • [x] r.category (GSoC) https://github.com/OSGeo/grass/pull/4018
  • [x] r.object.geometry (GSoC) https://github.com/OSGeo/grass/pull/4105
  • [ ] r.stats (GSoC) https://github.com/OSGeo/grass/pull/3884
  • [ ] r.describe (GSoC)
  • [ ] r.coin
  • [ ] r.colors.out
  • [ ] r.volume
  • [ ] etc..

3d Raster

  • [ ] etc..

Vector

  • [x] v.info (GSoC) https://github.com/OSGeo/grass/pull/3755
  • [x] v.univar (GSoC) https://github.com/OSGeo/grass/pull/3784
  • [x] v.db.select https://github.com/OSGeo/grass/pull/476
  • [x] v.db.univar https://github.com/OSGeo/grass/pull/2386
  • [ ] v.to.db (GSoC) https://github.com/OSGeo/grass/pull/4036
  • [ ] v.distance (GSoC) https://github.com/OSGeo/grass/pull/3942
  • [ ] v.category (GSoC) https://github.com/OSGeo/grass/pull/4020
  • [ ] v.report (GSoC)
  • [ ] v.colors.out
  • [ ] etc..

Database

  • [x] db.univar https://github.com/OSGeo/grass/pull/2386
  • [x] db.describe (GSoC) https://github.com/OSGeo/grass/pull/4202
  • [ ] etc..

JSON output support without a library

  • [x] v.db.select https://github.com/OSGeo/grass/pull/476
  • [x] r.kappa https://github.com/OSGeo/grass/pull/2666
  • [x] g.mapsets https://github.com/OSGeo/grass/pull/2542
  • [ ] r.geomorphon
  • [ ]

cwhite911 avatar Jun 05 '23 09:06 cwhite911

Adding here that the preferred JSON encoding for g.proj output would be the PROJJSON specification: https://proj.org/en/latest/specifications/projjson.html. It's a JSON encoding of WKT2:2019.

florisvdh avatar Jun 15 '24 11:06 florisvdh

@cwhite911 could this be closed?

nilason avatar Aug 03 '24 19:08 nilason

@cwhite911 could this be closed?

@nilason I'm still using this issue to track all the work getting done implementing json outputs. I'm happy to close this issue and move this somewhere else if you have a good suggestion.

cwhite911 avatar Aug 11 '24 18:08 cwhite911

The original issue was solved. Let's create a new issue or I can create a project.

wenzeslaus avatar Oct 21 '24 21:10 wenzeslaus

A project would be nice to keep track of this.

cwhite911 avatar Oct 26 '24 22:10 cwhite911

Hey @cwhite911 @wenzeslaus , has JSON support been added to all the required modules, or are there still some modules left that need JSON support? If so, please let me know—I would love to contribute in this area!

NishantBansal2003 avatar Oct 31 '24 12:10 NishantBansal2003