I need to extract the "data:" for station listed bellow from this url http://swe-sso.dlr.de/Ionospheric_Perturbations/Rate_Of_Change_Of_TEC_Index/mean_ROTI_Europe/latest/mean_ROTI_Europe.json
{
"properties": {
"rcv": "BUCU00ROU0_EUREF",
"sat": "G24",
"roti": 0.508,
"azimuth_deg": 168.4,
"elevation_deg": 20.99
},
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
25.34,
45.15
]
}
}
"Data:" is the main index for stations data
what is the correct syntax to do that with js?
I assume you mean sat
and not station
, as that doesn't exist in your example. You could access it like this with JavaScript by assigning it to a variable:
var sat = yourJSONobj["properties"]["sat"]
Here's an example printing that object in that array:
yourJSON = { "properties":{ "rcv":"BUCU00ROU0_EUREF", "sat":"G24", "roti":0.508, "azimuth_deg":168.4, "elevation_deg":20.99 } }, { "type":"Feature", "geometry":{ "type":"Point", "coordinates":[ 25.34, 45.15 ] } }
document.getElementById("json").innerHTML +=JSON.stringify(yourJSON["properties"]["sat"]);
<p id="json"></p>
edit: cleaned up code
I'm going to try to point you in the right direction here, but you'll need to still do some reading. To clarify, you appear to be asking how you can use jQuery to load some JSON data, and then pull out parts of it. I'm inferring this by looking at the URL you provided.
If you use JSONPath, you could use a path like
metadata.integrated_gnss_stations.features..[?(@.rcv=='BUCU00ROU0_EUREF')]
… to get an array of all 5 satellites for the items where rcv == "BUCU00ROU0_EUREF". You can then take that return and project it into whatever other form you'd like.
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
Find Postal Code | Zipcode using Google map geocoding reverse
Can anyone please help me find a way to return objects from an object array to concat all of them into a new object array with object names instead of keys
I'm working on a PHP webpage, and I get an error on my front-end saying; Warning: Illegal string offset 'all' on line 93
I'm currently using this URL structure on my webpage: examplecom/folder/file1