Skip to content

Script written to add longitude and latitude to Singapore school data retrieved from data.gov.sg

Notifications You must be signed in to change notification settings

DtCarrot/sg-school-data-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

sg-school-data-json

Script written to convert school data from .csv to geocoded .json file.

Datset

https://data.gov.sg/dataset/school-directory-and-information

Original CSV file

school_name url_address address
NATIONAL JUNIOR COLLEGE www.nationaljc.moe.edu.sg 37 HILLCREST ROAD

After converting to JSON file

[{
"school_name": "NATIONAL JUNIOR COLLEGE", 
"address": "37 HILLCREST ROAD", 
"lat": 38.7880067, 
"lng": -104.8568176
}]

Geocoding

Geocoding is done using the Google Geocoding API. You can get the API key via the Google Cloud Platform.

External libraries used

  1. dotenv - To store environment variables API Keys should never be exposed in the code!!!!
  2. requests - For HTTP Request to Google Geocoding API
  3. panda - To parse csv file

About

Script written to add longitude and latitude to Singapore school data retrieved from data.gov.sg

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages