Processing JSON data into variables (in Python) - Lesson 1

Опубликовано: 15 Май 2026
на канале: Brad Evans
932
15

Taking data from a geoJSON data source and converting it into data stored in variables.

Resources:
https://gchq.github.io/CyberChef/
https://www.data.brisbane.qld.gov.au/...

Source Code:
import json #imports the json library so we can read the data as a json file

with open("road_restrictions.geojson") as jsonFile:
jsonObject = json.load(jsonFile)
jsonFile.close()

for feature in jsonObject["features"]:

print(feature["properties"]["LAT"])
print(feature["properties"]["LONG"])
print(feature["properties"]["DESCRIPTION"])
print(feature["properties"]["SIGNED_CLEARANCE_MIN"])
print(" ")

lat = (feature["properties"]["LAT"])
long = (feature["properties"]["LONG"])
name = (feature["properties"]["DESCRIPTION"])
height = (feature["properties"]["SIGNED_CLEARANCE_MIN"])

print (lat)
print (long)
print (name)
print (height)