Provinces and Municipalities
Data Source
ACAP uses a combination of the PAGASA 10-day weather forecast Excel files (opens in a new tab) and the PAGASA Seasonal Forecast- Forecast Rainfall Analysis Table (opens in a new tab) as a data source for its region, provinces, and municipalities list.
FAQs
Regional Provinces / Municipalities Inconsistency
While ACAP Bicol (Region 5) or other regions generally may sync well with its provinces and municipalities listed from the PAGASA 10-day weather forecast Excel data source, several factors may affect its consistency in the long run.
-
Updates in the Philippine geopolitical or administrative divisions in the future (usually mandated by the Philippine Standard Geographic Code (opens in a new tab) (PSGC)) may take some time to reflect on the contents and naming convention within the PAGASA 10-day weather forecast Excel files or Seasonal Forecast - Rainfall Analysis Table.
-
It is not yet thoroughly tested if ALL regions, provinces, and municipality names from PAGASA's 10-day weather forecast Excel files (
provinces and municipalities
) and their Seasonal Weather Forecast - Rainfall Analysis table (regions and provinces
) are up to date with the latest Philippine administrative divisions.
Updating Regional Provinces
This simple region-province grouping method assigns the PAGASA 10-day Excel files' provinces (and their associated municipalities) to a region without transforming or altering the original province/municipalities naming contents of the 10-day Excel files.
It requires target province(s) defined in the PAGASA 10-day Excel file to work.
Confirm target provinces
-
Download and open a PAGASA 10-day weather forecast Excel file from the PAGASA 10-Day Climate Forecast web page (opens in a new tab).
-
Find the province(s) in the downloaded Excel file to add to your region.
- These province(s) may belong to other regions generated by the
npm run pagasa:municipalities
script, or they may be missing from the list but exist in the 10-day Excel files.
- These province(s) may belong to other regions generated by the
Add province to a region
Add new provinces(s) to a region's list of provinces from province names confirmed on step #1. For example to add the "Isabela"
province to ACAP Bicol's list of provinces, add "Isabela"
to the server's PROVINCES
variable in the .env
file.
PROVINCES=Albay,Camarines Norte,Camarines Sur,Catanduanes,Masbate,Sorsogon,Isabela
PROVINCES_ARCHIVE...
Remove a province
Similarly to remove a province from a region, remove its text string from the PROVINCES
(or PROVINCES_ARCHIVE
) server environment variables.
Sync new provinces
Run the script after adding or removing a province from a region to update ACAP's list of provinces and municipalities.
npm run cron:tenday
Intensive Province/Municipalities Customizations
For intensive naming and grouping transformation beyond the simple method covered in the Updating Regional Provinces section, developers can start checking the /server/src/scripts/cron/update_tenday_weather
"group" of scripts, possibly extending and overriding its /classes/exceladapter/index.js
class. This class extends (opens in a new tab) the ph-municipalities library's ExcelFile
class for managing the PAGASA 10-day Excel provinces/municipality lists.
The ExcelFile
class has available class methods, functions, and constructors (opens in a new tab) dedicated and tested to parsing provinces/municipality lists from a PAGASA 10-day weather forecast Excel file, which developers can override (opens in a new tab) and extend (opens in a new tab) within ACAP's existing class scripts to customize region/province/municipality grouping and naming processing.
Some parts of the front end may also need updating depending on the level of customization required.
This method will alter the original (province and municipalities) naming convention of a PAGASA 10-day weather forecast Excel file. Consult and deliberate first if this is a requirement before proceeding.
Indicate notices and messages in the public ACAP front end about these changes to the PAGASA 10-day provinces and municipalities naming and grouping for transparency.
References
- This page is related to the Server Setup - Initialize provinces and municipalities section.