xuancong84 / singapore-address-heatmap

A database and crawling script for Singapore postal code, address name and geo-coordinates
13 stars 6 forks source link

Singapore Map/Address Library

This is an improved and augmented version from https://github.com/xkjyeah/singapore-postal-codes

It also contains a dump of all Singapore postal codes retrieved from Onemap.sg on 10 Jun 2020. See example.ipynb for the demo/tutorial.

The repo has 4 main functional components:

  1. The download script and address name processor. Run download_postal_codes.py to crawl Singapore address and store in singpostcode.json.gz. Run process.sh to process/normalize address names, it will output to database.json.gz and database.csv.gz .
  2. The database searcher: dbsearch.py uses database.json.gz with everything in JSON format; dfsearch.py uses database.csv.gz with everything in Pandas DataFrame format.

  3. The count-map highlighter: given [geo-coordinates, count] pairs with corresponding color hint, it can draw circles on the map, with areas proportional to the counts at that location.

  4. The heat-map highlighter: given a table with columns [datetime,address,count] or [datetime,latitude,longitude,count], it shows a timestamped heatmap, with color intensity proportional to the counts at that location.

Note: Use of the data is governed by the Open Data Licence