How do I manage to filter after specific key values in a json file? I am using C#. I want to get every distance.value and save them into an array of doubles. That way I want to create a distance matrix.
Stackoverflow wants me to add more information but I am not sure what additional code snippets are useful. If I am missing something I will add it to the comments.
Here is the json output.
{
"destination_addresses" : [],
"origin_addresses" : [],
"rows" : [
{
"elements" : [
{
"distance" : {
"text" : "1 m",
"value" : 0
},
"duration" : {
"text" : "1 Minute",
"value" : 0
},
"status" : "OK"
},
{
"distance" : {
"text" : "5 m",
"value" : 5
},
"duration" : {
"text" : "1 Minute",
"value" : 1
},
"status" : "OK"
},
{
"distance" : {
"text" : "3,7 km",
"value" : 3730
},
"duration" : {
"text" : "10 Minuten",
"value" : 582
},
"status" : "OK"
}
]
},
{
"elements" : [
{
"distance" : {
"text" : "0,5 km",
"value" : 510
},
"duration" : {
"text" : "3 Minuten",
"value" : 182
},
"status" : "OK"
},
{
"distance" : {
"text" : "1 m",
"value" : 0
},
"duration" : {
"text" : "1 Minute",
"value" : 0
},
"status" : "OK"
},
{
"distance" : {
"text" : "3,7 km",
"value" : 3725
},
"duration" : {
"text" : "10 Minuten",
"value" : 581
},
"status" : "OK"
}
]
}
],
"status" : "OK"
}