OSGeo / grass

GRASS GIS - free and open-source geospatial processing engine
https://grass.osgeo.org
Other
791 stars 288 forks source link

v.distance: add json support #3942

Open kritibirda26 opened 3 days ago

kritibirda26 commented 3 days ago

Using parson, add JSON support to v.distance module.

The output looks like as follows:

[
    {
        "from_cat": 1,
        "to_cat": 33,
        "distances": [
            {
                "value": 54371.188688694157,
                "name": "dist"
            },
            {
                "value": "Zebulon",
                "name": "to_attr"
            }
        ]
    },
    {
        "from_cat": 8,
        "to_cat": 18,
        "distances": [
            {
                "value": 284.67149902717813,
                "name": "dist"
            },
            {
                "value": "RFD #14",
                "name": "to_attr"
            }
        ]
    }
]

I will add tests and update documentation once the JSON format is finalized.