grass icon indicating copy to clipboard operation
grass copied to clipboard

v.distance: add JSON support

Open kritibirda opened this issue 1 year ago • 1 comments

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.

kritibirda avatar Jun 29 '24 16:06 kritibirda

@cwhite911 the pr is ready for review.

kritibirda avatar Aug 06 '24 09:08 kritibirda

@cwhite911 the PR will automatically merge once all conditions are met, that means that there's only open conversations remaining

echoix avatar Jan 23 '25 14:01 echoix

@cwhite911 the PR will automatically merge once all conditions are met, that means that there's only open conversations remaining

@echoix I don't see a button to resolve conversations anymore. Did a setting recently get changed?

cwhite911 avatar Jan 23 '25 16:01 cwhite911

Oh, maybe you don't even have triage access for the grass repo but maybe others? It's surprising..

Comment like done on them, to make sure we don't forget some, and I'll close them

cc @neteler can you take a look at what level he should be having (especially if he was mentoring students, and couldn't approve them himself). Since last summer at least I was approving his grey-approvals, like a proxy, to unblock PRs

echoix avatar Jan 23 '25 16:01 echoix

Done!

echoix avatar Jan 23 '25 17:01 echoix

This triggered:

*** CID 1590732:  Memory - illegal accesses  (UNINIT)
/vector/v.distance/print.c: 109 in print_upload()
103                         }
104                         else {
105                             json_object_set_null(relation_object, "value");
106                         }
107                         break;
108                     }
>>>     CID 1590732:  Memory - illegal accesses  (UNINIT)
>>>     Using uninitialized value "name" when calling "json_object_set_string".
109                     json_object_set_string(relation_object, "name", name);
110                     json_array_append_value(relations, relation_value);
111                     break;
112                 case PLAIN:
113                     switch (Upload[j].upload) {
114                     case CAT:

petrasovaa avatar Jan 24 '25 16:01 petrasovaa