GSoC 2026 Adding JSON output support to v.build

I’ve analyzed the current tasks and noticed that v.build doesn’t have JSON output yet, as you mentioned in your previous email. I’m starting to work on adding JSON support to v.build.

Nice, this might be of interest to those who clean messy vector data. Check also v.clean - the JSON output may need to be partially synced. It may be good to design these two together.

1 Like

This requires more analysis and lot of testing. So it may be better suited for the GSoC project itself, because it may take some time to accomplish this.

Try to look at GRASS addons as well, there may be several tools, e.g. r/v.neighborhoodmatrix.

1 Like

Hi Anna, thank you for the feedback. I agree that designing v.clean and other tools together for JSON output is a better approach for a GSoC project. I will start analyzing how to standardize this across these modules.

Hi Anna, I was reading the r.neighborhoodmatrix manual page. “ r.neighborhoodmatrix - GRASS GIS manual

While running my first test, I realized that the example command provided is not working.

The current version is: r.neighborhoodmatrix -l n=bc_int sep=comma output=county_neighbors.csv

I changed n=bc_int to in=bc_int and it worked! If this is a mistake in the documentation, I would be happy to fix the web page. Let me know what you think! Thank you.

Definitely a mistake in the documentation. This example command is just an extension of the previous one, where input is in=. Any abbreviation of a parameter has to contain the beginning of that parameter name.

I opened an issue and fix in here.

If needed, I can start looking into r/v.neighborhoodmatrix again.

Hi @annakrat ,
I run the v.neighborhoodmatrix module, it generates results as CSV file. After that when I analyzed the code, I encountered with a problem.
I have a question:
Given that there is no existing JSON output standard in Python (such as g_opt_format), would it be reasonable to use the standard Python jsonlibrary directly?

Also there is not any testsuite folder or test file in there, Can I add one?

@wenzeslaus ?

I am somewhat confused by the question. G_OPT_FORMAT should work in Python and yes use the python json library. Yes, please include a pytest.

Thanks for the clarification, that makes sense.

Hi Anna,
First of all, thank you for your help. I have a few questions.

Firstly, the following was written in the v.neighborhoodmatrix.md file:

v.neighborhoodmatrix in=census_wake2000 idcolumn=STFID output=census_neighbors.csv

I also added my own to the .md file like this:

v.neighborhoodmatrix in=census_wake2000 idcolumn=STFID output=census_neighbors.json

Will the code work like this, that is, will it somehow create a file? I’m asking because it’s described that way here.

Secondly,
What should I write in the key-value sections when generating JSON?
In CSV it was like in below.

37183050100|37183050300

For now I’ve done it like this:

“[{“from”: “37183050100”,“to”: “37183050300”}, …]”

It will work in the sense that it will create a file named ‘census_neighbors.json’, but that file will be in csv format. If your question is whether the module automatically detects output file format from file extension, the answer is no. That’s why you would need a format= parameter.

That seems like a reasonable format to me.

I fixed.