Skip to content

LinkSight is a web app for applying the Philippine Standard Geographic Code to messy and misspelled barangay, municipality, city, and province names.

License

Notifications You must be signed in to change notification settings

rukku/linksight

 
 

Repository files navigation

LinkSight

This web app takes a list of barangay, municipality, city, and province names and looks up their closest matches in the Philippine Standard Geographic Code (PSGC). It's useful if you're trying to standardize location names for merging location datasets from diverse sources.

How it works

  1. Upload a single CSV file that contains separate barangay, province, and city or municipality columns.
  2. Identify the columns that correspond to the correct administrative levels in the PSG code.
  3. For places with exact matches in the PSGC, LinkSight returns the precise PSG code. For places with more than one possible matching PSG code, use the app's graphical user interface to select the correct match.
  4. Export the results as a CSV.

Feedback

This app is in active development! Your feedback will help us improve it. If you have any suggestions for features, enhancements, or find any bugs, or just want to contribute, please send us an email at [email protected].

Development

React App

  1. Install dependencies

    cd app
    npm install
  2. Run server

    npm start

Django API

  1. Install dependencies

    make install
  2. Set configuration values

    cp .env{.template,}
    
    Config name Description
    DEBUG Toggles running the server in debug mode
    DATABASE_URL See DJ-Database-URL
    SECRET_KEY String used to provide cryptographic signing of sessions, etc.
    EMAIL_PORT Port to use when sending email
    EMAIL_HOST_USER User for sending email
    EMAIL_HOST_PASSWORD Password for above
    SOCIAL_AUTH_GOOGLE_OAUTH2_KEY Key for Google OAuth2
    SOCIAL_AUTH_GOOGLE_OAUTH2_SECRET Secret for Google OAuth2
    GOOGLE_APPLICATION_CREDENTIALS Path to the Google Cloud Service Account key file used to retrieve the list of approved emails
    APPROVED_EMAILS_SHEET_ID Google Sheets ID of th list of approved emails
    APPROVED_EMAILS_SHEET_RANGE The sheet range for approved emails
    APPROVED_EMAILS_ROW_KEY The row key for approved emails

    If you are a member of the official LinkSight development team, you can ask for access to the template with secrets filled in.

  3. Install postgresql and run the following in psql:

    CREATE DATABASE linksight;
    

    Make sure that you can connect using the DATABASE_URL you used in .env.

  4. Run the server

    source venv/bin/activate
    python manage.py migrate
    python manage.py runserver
  5. Go to http://localhost:3000/

Components Catalog

npm run catalog-start

Testing

gunzip -k data/clean-psgc.csv.gz
python manage.py test

You can run specific subsets of tests like so.

Deployment

Staging

cd deploy
make

Production

Instructions to follow.

About

LinkSight is a web app for applying the Philippine Standard Geographic Code to messy and misspelled barangay, municipality, city, and province names.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Jupyter Notebook 76.6%
  • Python 12.0%
  • JavaScript 9.8%
  • Other 1.6%