Toronto DineSafe

From OpenStreetMap Wiki
Jump to: navigation, search

Toronto DineSafe is part of Toronto Open Data, available at [1]. This database provides data on public health inspections of all food service establishments in the City of Toronto. This can be used to create a list of all food service establishments (e.g. restaurants, fast food, supermarkets) in Toronto and addresses which can then be entered (manually) into OpenStreetMap.

To convert the XML file to human readable format, install the Ubuntu package xml2, and then run the command:

xml2 < dinesafe.xml | 2csv /ROWDATA/ROW ESTABLISHMENT_NAME ESTABLISHMENT_ADDRESS ESTABLISHMENTTYPE ESTABLISHMENT_ID | awk '!x[$0]++' | sort > dinesafe.csv

This creates a comma separated value (CSV) file with establishment name, address, type and ID number which can then be loaded into any spreadsheet program, while removing the unneeded data about the results of health inspections.