GSoC 2024 - Final Report - Add JSON output to different tools in C

Title and Organization

Title: Add JSON output to different tools in C
Organization: Grass GIS OSGeo

Abstract

The GRASS GIS project is a powerful Geographic Information System (GIS) for geospatial data management, analysis, and visualization. Despite its modular design and extensive toolset, most of its outputs are in plain text format, which limits the ease of integration with modern data processing tools. This project aimed to introduce JSON as a new output format for selected GRASS GIS tools, leveraging the parson library recently added to the codebase. By providing a more structured and portable output, this enhancement simplifies data ingestion and processing in tools like Pandas, which are widely used in data science. The project also included the development of Python test cases to ensure the correctness of JSON outputs and prevent future regressions.

The State of the Art Before GSoC

Before this project, the majority of GRASS GIS tools produced outputs in plain text, which required manual parsing or conversion to be used in other software systems. Some modules already had JSON support, but the implementation was inconsistent, using different flags or options. This made it challenging to automate tasks or integrate GRASS GIS outputs directly with modern data processing pipelines.

The Addition (Added Value) That My Project Brought to the Software

The project brought significant improvements by adding JSON output support to 16 GRASS GIS tools. This enhancement allows users to specify their desired output format (plain text or JSON), making it easier to integrate with data analysis tools and workflows. Additionally, the project standardized the options for tools that already had JSON support, improving consistency across the platform. The introduction of comprehensive Python test cases for these outputs ensures that the enhancements are reliable and future-proof.

Potential Future Work

JSON support for 4 modules is currently a work in progress and should hopefully be complete soon. Further work is needed to extend JSON output support to the remaining tools within GRASS GIS. Future developers can build on this foundation, focusing on additional modules or enhancing the JSON schema to support more complex use cases.

Links

A list of all weekly reports and pull requests worked on as part of the project can be found at the following link.
https://grasswiki.osgeo.org/wiki/GRASS_GSoC_2024_Add_JSON_output

2 Likes