Skip to content

Latest commit

 

History

History
229 lines (176 loc) · 5.52 KB

README.md

File metadata and controls

229 lines (176 loc) · 5.52 KB

ph-locations

npm CI ISO3166 PSGC GitHub

Library of locations in the Philippines (regions, provinces, and cities & municipalities).

This library automatically checks the sources, ensuring the data is always updated.

Usage

Install

# NPM
npm install ph-locations

# Yarn
yarn add ph-locations

Import

Default (ISO 3166)

// CommonJS
const {
  regions,
  provinces,
  citiesMunicipalities,
} = require('ph-locations');

// ES6
import {
  regions,
  provinces,
  citiesMunicipalities,
} from 'ph-locations';

PSGC

// CommonJS
const {
  regions,
  provinces,
  citiesMunicipalities,
} = require('ph-locations').psgc;

// ES6
import { psgc } from 'ph-locations';
const {
  regions,
  provinces,
  citiesMunicipalities,
} = psgc;

ISO 3166 (same result as default)

// CommonJS
const {
  regions,
  provinces,
  citiesMunicipalities,
} = require('ph-locations').iso3166;

// ES6
import { iso3166 } from 'ph-locations';
const {
  regions,
  provinces,
  citiesMunicipalities,
} = iso3166;

Sources

ISO 3166 & Wikipedia

Philippine Standard Geographic Code (PSGC)

Notes regarding NCR:

PSGC does not assign NCR cities and municipalities under a province. Instead, they are classified under districts. Because of this, an unofficial pseudo-province called "Metro Manila" (code 130100000) was added and all cities and provinces of NCR are listed under this.

Automatic Checking

GitHub Actions (ISO 3166, PSGC) automatically run everyday to check if the data is updated. See the ISO 3166 and PSGC badges above.

Properties

Regions

Property Description ISO 3166 PSGC
code ISO 3166 or PSGC code
name English name
nameTL Tagalog name
altName Alternative name, often the roman number or acronym of the region

ISO 3166

{
  "code": "PH-05",
  "name": "Bicol",
  "nameTL": "Rehiyon ng Bikol",
  "altName": "V"
}

PSGC

{
  "code": "050000000",
  "name": "Bicol Region",
  "altName": "Region V"
}

Provinces

Property Description ISO 3166 PSGC
code ISO 3166 or PSGC code
name English name
altName Alternative name, often its former name
nameTL Tagalog name
region ISO 3166 or PSGC code of the province's region

ISO 3166

{
  "code": "PH-CAS",
  "name": "Camarines Sur",
  "altName": null,
  "nameTL": "Timog Kamarines",
  "region": "PH-05"
}

PSGC

{
  "code": "051700000",
  "name": "Camarines Sur",
  "altName": null,
  "region": "050000000"
}

Cities and Municipalities

Property Description ISO 3166 PSGC
code PSGC code
name Name
fullName Complete name. For ISO 3166, all cities will have names end with "City". For PSGC, this will be the complete name as listed in the PSGC website.
altName Alternative name, often its former name
province ISO 3166 or PSGC code of the city's or municipality's province
classification Classification of the city or municipality (see below)
isCapital Is the city or municipality the capital of the province

ISO 3166

{
  "name": "Naga",
  "fullName": "Naga City",
  "altName": null,
  "province": "PH-CAS",
  "classification": "ICC",
  "isCapital": false
}

PSGC

{
  "code": "051724000",
  "name": "Naga City",
  "fullName": "City Of Naga",
  "altName": null,
  "province": "051700000",
  "classification": "CITY",
  "isCapital": false
}

Classification

ISO 3166

Value Description
Mun Municipality
CC Component city
ICC Independent component city
HUC Highly urbanized city

PSGC

Value Description
MUNICIPALITY Municipality
CITY City

License

Licensed under MIT License