Intelligent Architectural Briefs with Random Forest and OpenStreetMaps

Original article was published by Sayjel Vijay Patel on Artificial Intelligence on Medium

Since our code is in Python and the OpenStreetMap’s data is stored in JSON format, the first step is to convert it into a Python data structure called a ‘Pandas DataFrame’.

# Inspect the OSM Datawith open(‘Desktop\osm-Zurich.json’, ‘r’) as f:# Loading the json datadata = json.load(f)# normalizing it and converting to pandas data framedata = pd.json_normalize(data)print(data.columns)# Columns> [‘highway’, ‘route’, ‘oneway’, ‘crossing’, ‘sidewalk’, ‘building’,‘building_3d’, ‘building_3d_random’, ‘craft’, ‘geological’,‘topography’, ‘contours’, ‘waterway’, ‘leisure’, ‘amenity’, ‘emergency’,‘cycleway’, ‘busway’, ‘bicycle_road’, ‘driving_side’, ‘embedded_rails’,‘historic’, ‘landuse’, ‘man_made’, ‘military’, ‘natural’, ‘office’,‘power’, ‘public_transport’, ‘railway’, ‘bridge’, ‘shop’, ‘sport’,‘tourism’, ‘telecom’, ‘place’]