DEV.co
Open-Source Databases · cahyadsn

wilayah

Wilayah is an Indonesian administrative region and island code database synchronized with official 2025 government regulations (Kepmendagri). It provides PHP/MySQL/AJAX tooling to query and display hierarchical administrative data (provinces, districts, subdistricts, villages) plus population, area, and geographic metadata for Indonesia.

Source: GitHub — github.com/cahyadsn/wilayah
1.2k
GitHub stars
413
Forks
SQL
Primary language
MIT
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorycahyadsn/wilayah
Ownercahyadsn
Primary languageSQL
LicenseMIT — OSI-approved
Stars1.2k
Forks413
Open issues5
Latest releasev2026.7 (2026-07-02)
Last updated2026-07-03
Sourcehttps://github.com/cahyadsn/wilayah

What wilayah is

SQL-primary repository delivering normalized MySQL schemas for Indonesian administrative boundaries per Kepmendagri No 300.2.2-2430 (2025), with historical versions back to 2015, coordinate/elevation/timezone attributes, and a web demo built on PHP+AJAX. Includes alternative PostgreSQL dumps and related boundary/logo/postal-code datasets.

Quickstart

Get the wilayah source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/cahyadsn/wilayah.gitcd wilayah# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Government & Civic Tech Platforms

Forms, dashboards, and reporting tools requiring accurate, regulation-compliant Indonesian administrative hierarchies (e.g., election systems, tax/licensing portals, census-linked services).

Location-Based SaaS for Indonesia

E-commerce, logistics, or fintech platforms targeting Indonesia that need canonical region codes, postal mappings, population data, and boundaries for shipping zones, customer segmentation, or compliance.

Government Data Modernization Projects

Replace legacy, inconsistent region datasets with a single authoritative source aligned to current Kepmendagri standards, including population and area metrics from official geographic sources.

Implementation considerations

  • Import wilayah.sql into MySQL (or wilayah_level_1_2_postgresql.sql for PostgreSQL); verify schema version matches your Kepmendagri requirement (2025 vs. archived versions).
  • Establish a data refresh schedule linked to annual Kepmendagri releases; plan migration scripts if regulatory code changes occur (e.g., new provinces, boundary shifts).
  • Test hierarchical queries (province → district → subdistrict → village) and join performance on the `id_prov`, `id_kabkota`, `id_kecamatan` foreign keys.
  • If using boundaries or coordinates, cross-validate with Badan Informasi Geospasial (BIG) data and clarify projection/datum with your GIS team.
  • Plan for validation of postal code mappings if linking to wilayah_kodepos; ensure codes remain current after administrative changes.

When to avoid it — and what to weigh

  • Global Multi-Country Deployments — This is Indonesia-specific only. If you need administrative data for other nations or a unified global schema, choose a generalized geospatial solution.
  • Real-Time Boundary/Population Updates — Data is released annually per Kepmendagri decree; no live APIs or incremental feeds. If you need sub-annual refresh cycles, plan for custom sync pipelines.
  • Minimal DB Footprint Requirements — The full schema and spatial boundaries are substantial SQL dumps; low-bandwidth or embedded-only projects may prefer lightweight REST endpoints or vector tiles instead.
  • Regulatory Compliance Outside Government Context — Kepmendagri alignment is mandatory for government vendors but optional for private sector. Private ventures should verify whether official codes are contractually required.

License & commercial use

MIT License. Permissive OSI-approved license allowing commercial use, modification, and distribution with attribution. No copyleft restrictions.

MIT permits commercial deployment without royalties or additional licensing. However, if you are a government contractor, verify that your procurement terms require Kepmendagri-certified data (this repo aligns but may not carry explicit vendor liability). For SaaS redistribution, retain attribution.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

No explicit security audit data. Considerations: (1) SQL dumps are data-only; validate input on any web layer accepting region codes. (2) If exposing via APIs, implement rate limiting and input validation to prevent injection attacks. (3) The demo app (PHP+AJAX) predates modern frameworks; conduct code review before production use. (4) No mention of access control or PII handling; government projects should add encryption and audit logging. (5) Keep MySQL/PostgreSQL patched.

Alternatives to consider

OpenStreetMap (OSM) + Nominatim

Global, crowdsourced administrative boundaries; more granular in some regions. Lacks official Indonesian regulatory alignment and population/area metrics; requires custom mapping to Kepmendagri codes.

Natural Earth Data

Curated global administrative datasets with good performance for maps. Lower specificity for sub-district/village levels; no direct postal-code or population linkage; requires manual validation against Indonesian law.

Badan Informasi Geospasial (BIG) Official Services

Authoritative government source; likely has REST APIs and certified data. Requires direct vendor engagement; potentially higher cost and longer lead times than this open-source snapshot.

Software development agency

Build on wilayah with DEV.co software developers

Contact Devco to build a custom API, government-compliant forms, or geospatial platform on top of this dataset. We handle schema design, validation, and deployment.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

wilayah FAQ

Is this data current for 2025?
Yes. The primary wilayah.sql file follows Kepmendagri No 300.2.2-2430 Tahun 2025. Historical versions (2016–2023) are archived. Check release notes for any updates after 2026-07-03.
Can I use this in a commercial product?
Yes, under MIT license. No royalties or approval needed. Provide attribution. If you are a government vendor, verify that your contract explicitly requires Kepmendagri-certified data (this repo qualifies but carry your own liability insurance).
What about spatial/geographic queries (e.g., 'find all villages in a polygon')?
Base wilayah.sql is relational (IDs, names, counts). Boundaries (GeoJSON/polygon) are in wilayah_boundaries repo and require PostGIS or a separate spatial engine. Coordinates and timezone are in wilayah_level_1_2.sql but are point data only.
How do I stay synchronized with new Kepmendagri updates?
Watch the GitHub repo for releases; test new SQL dumps in staging before deploying. No automated sync; plan for annual or ad-hoc manual updates and corresponding application code changes if codes or hierarchies shift.

Software developers & web developers for hire

Adopting wilayah is usually one piece of a larger software development effort. As a software development agency, DEV.co provides software development services and web development expertise — pairing senior software developers and web developers with your team to design, build, and operate open-source databases software in production.

Ready to integrate authoritative Indonesian region data?

Contact Devco to build a custom API, government-compliant forms, or geospatial platform on top of this dataset. We handle schema design, validation, and deployment.