Official Philippine Standard Geographic Code (PSGC) in json formats.
Contains all the latest regions, provinces, cities, municipalities and barangays.
This library allows you to:
- Use pre-compiled JSON sets of regions, provinces, cities, municipalities and barangays.
const psgc2 = require('psgc2');
// Documented below
- 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
const psgc2 = require('psgc2');
// {
// raw, // Array
// tree, // Object
// regions, // Array
// provinces, // Array
// cities, // Array
// municipalities, // Array
// }
- Raw worksheet rows from PSGC Publication xlsx file.
- 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
- Object
- name String, region name
- population Integer
- notes String (if provided by PSA)
- Object
- name String, province name
- population Integer
- notes String (if provided by PSA)
- region String, region name
- Object
- name String, city name
- population Integer
- notes String (if provided by PSA)
- province String, province name
- region String, region name
- Object
- name String, municipality name
- population Integer
- notes String (if provided by PSA)
- province String, province name
- region String, region name
- 2018.3.31-v4
- Fixed
regions.json
structure, from String -> Object.
- Fixed
- 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.
Philippine Standard Geographic Code (PSGC)
Philippine Statistics Authority (PSA)
31 March 2018
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.
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.
Ongoing (updated quarterly)
None
Acknowledgement of the Philippine Statistics Authority (PSA) as the source
Since this package is date-sensitive, version is based from the format:
- YEAR . MONTH . DATE, such as 2018.3.31.
- xlsx @ npm
- Parsing of xlsx files
- case @ npm
- Title-casing of geographic names.
Attribution 4.0 International (CC BY 4.0)