Giter Site home page Giter Site logo

xemasiv / psgc2 Goto Github PK

View Code? Open in Web Editor NEW
18.0 1.0 8.0 3.12 MB

:philippines: Official Philippine Standard Geographic Code (PSGC)

Home Page: https://www.npmjs.com/package/psgc2

License: Creative Commons Attribution 4.0 International

JavaScript 100.00%
philippine philippines regions provinces cities municipalities

psgc2's Introduction

psgc2

Official Philippine Standard Geographic Code (PSGC) in json formats.

Contains all the latest regions, provinces, cities, municipalities and barangays.

This library allows you to:

  1. Use pre-compiled JSON sets of regions, provinces, cities, municipalities and barangays.
const psgc2 = require('psgc2');
// Documented below
  1. Parse & generate latest JSON's from the official PSGC Excel (xlsx) file provided quarterly by the Philippine Statistics Authority (PSA) at http://nap.psa.gov.ph/activestats/psgc/default.asp.
// configure xlsx path first @ /build.js, then:
npm run build

Usage

const psgc2 = require('psgc2');
// {
//   raw,  // Array
//   tree,  // Object
//   regions,  // Array
//   provinces,  // Array
//   cities,  // Array
//   municipalities, // Array
// }

Structure

psgc2.raw, ~/psgc2/raw.json Array

  • Raw worksheet rows from PSGC Publication xlsx file.

psgc2.tree, ~/psgc2/tree.json Object

  • Complete JSON structured tree.
  • Used objects for hierarchical structure, easier to iterate and sort.
  • [ Region Name ] Object
    • population Integer
    • notes String (if provided by PSA)
    • [ Province Name ] Object
      • population Integer
      • notes String (if provided by PSA)
      • [ City / Municipality Name ] Object
        • population Integer
        • notes String (if provided by PSA)
        • class String, either
          • 'City'
          • 'Municipality'
        • cityClass if class=City only, String, either:
          • 'Component City'
          • 'Independent Component City'
          • 'Highly Urbanized City'
        • [ Barangay Name ]
          • population Integer
          • notes String (if provided by PSA)
          • district String
          • subMunicipality String

psgc2.regions, ~/psgc2/regions.json Array

  • Object
    • name String, region name
    • population Integer
    • notes String (if provided by PSA)

psgc2.provinces, ~/psgc2/provinces.json Array

  • Object
    • name String, province name
    • population Integer
    • notes String (if provided by PSA)
    • region String, region name

psgc2.cities, ~/psgc2/cities.json Array

  • Object
    • name String, city name
    • population Integer
    • notes String (if provided by PSA)
    • province String, province name
    • region String, region name

psgc2.municipalities, ~/psgc2/municipalities.json Array

  • Object
    • name String, municipality name
    • population Integer
    • notes String (if provided by PSA)
    • province String, province name
    • region String, region name

Changelog

  • 2018.3.31-v4
    • Fixed regions.json structure, from String -> Object.
  • 2018.3.31-v3
    • Regex-based approach on parsing population field.
    • Population field is now a purely Integer field.
    • Added notes field to contain PSA notes from population field, particularly on Provinces in this version.
    • Removed title-case transforms on Region names (better).
    • Removed title-case transforms on Barangay names (redundant).
  • 2018.3.31-v2
    • Reduced package size
  • 2018.3.31-v1
    • README updates
  • 2018.3.31
    • First working version.

PSGC Publication Info

Title

Philippine Standard Geographic Code (PSGC)

Originator

Philippine Statistics Authority (PSA)

Publication Date

31 March 2018

Abstract

The Philippine Standard Geographic Code (PSGC) is a systematic classification and coding of geographic areas in the Philippines. It is based on the four (4) well-established hierarchical levels of geographical-political subdivisions of the country, namely, the administrative region, the province, the municipality/city, and the barangay.

Process

The PSGC is updated based on the official changes occuring in the administrative structure of the country through Republic Acts and local ordinances ratified through plebiscites conducted by the COMELEC.

Progress

Ongoing (updated quarterly)

Access Constraints

None

Use constraints

Acknowledgement of the Philippine Statistics Authority (PSA) as the source


Versioning

Since this package is date-sensitive, version is based from the format:

  • YEAR . MONTH . DATE, such as 2018.3.31.

Dev Dependencies

  • xlsx @ npm
    • Parsing of xlsx files
  • case @ npm
    • Title-casing of geographic names.

License (psgc2 library)

Attribution 4.0 International (CC BY 4.0)

cc by

psgc2's People

Contributors

xemasiv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

psgc2's Issues

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.