Tanzania locations, All Regions from Tanzania, with their respective Districts wards & streets.
Very useful for easily implementing Tanzania locations in any application.
What you need before running the code.
-
Install & Start Postgresql Db Service
-
Copy files from location-files to a top level directory
/posts/...
this is necessary for postgresqlCopy
command to function as expected refer to this question. -
Give user
postgres
ownership to/posts
directory with
sudo chown -R postgres:postgres /posts
- Create your locations database owned by
postgres
user
createdb --encoding utf8 --owner postgres DATABASE_NAME
-
Use
psql DATABASE_NAME
to enter into the database. -
Extract everything
-
Create Tables
\i tables_creation.sql
-
Extract countries
\i countries.sql
-
Copy regions information to
general table
with\i general.sql
(Don't judge the repetition) -
Extract all Tanzania locations
\i extract.sql
- Done!
-
Create custom IDs to reference tables in (Regions, Districts & Wards) Status: 🗓 🔥
-
This whole process can easily be automated. Status: 🤔
Current Ideas
-
Write a Bash script to automate this
-
Contenarization as suggested in this issue by Olomi
-
API for this will be awesome. Status: 🕶
- Mtaa - Python Package 😎
- Mtaa API - Python API based on Mtaa 😎
- Locations API - NestJs & Postgresql based on this rep☻
Process of data standardization was the most complicated and I was helped by a few friends whom I promised to credit.
-
Natali Isuja
-
Joe Master
-
Robert Mnama