Giter VIP home page Giter VIP logo

tanzania-locations-db's Introduction

Tanzania Locations Repo

Quick Introduction

Tanzania locations, All Regions from Tanzania, with their respective Districts wards & streets.

Very useful for easily implementing Tanzania locations in any application.

How to use

What you need before running the code.

  1. Install & Start Postgresql Db Service

  2. Copy files from location-files to a top level directory /posts/... this is necessary for postgresql Copy command to function as expected refer to this question.

  3. Give user postgres full permissions to /posts directory with

sudo chmod -R postgres:postgres /posts

  1. Create your locations database owned by postgres user

createdb --encoding utf8 --password --owner postgres DATABASE_NAME

Option --password will prompt you to enter password for the Db.

  1. Use psql DATABASE_NAME to enter into the database.

  2. Extract everything

  • Create Tables \i tables_creation.sql

  • Copy regions information to general table with \i general.sql (Don't judge the repetition)

  • Extract countries \i countries.sql

  • Extract all Tanzania locations \i extract.sql

  1. Done!

Room for improvements

  1. Locations (Region, District & Wards) need to use a different auto-incrementing ID field and not it's area code.

The area code should stay as is (in it's field), but there should be a different ID field this will help reduce mixing the IDs once we get broader than just one country.

  1. This whole process can easily be automated.

  2. At least we should start with general.sql as I'm really not proud of it.

  3. API for this will be awesome!

Reference

This data was obtained from TCRA POSTCODE LIST we are by no means fully responsible for it's accuracy.

Credits

Process of data standardization was the most complicated and I was helped by a few friends whom I promised to credit.

  1. Natali Isuja

  2. Joe Master

  3. Robert Mnama

  4. And of course TCRA for publishing this information.

tanzania-locations-db's People

Contributors

maotora avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.