fityannugroho / idn-area-data Goto Github PK
View Code? Open in Web Editor NEWProvides the administrative areas data of Indonesia based on the latest official sources 🇮🇩
Home Page: https://www.npmjs.com/package/idn-area-data
License: MIT License
Provides the administrative areas data of Indonesia based on the latest official sources 🇮🇩
Home Page: https://www.npmjs.com/package/idn-area-data
License: MIT License
Put it at /docs/upgrading
directory
Add dot separator in the code field like the original data from PDF
Original Code (PDF) | Code in Data | |
---|---|---|
Province | 11 | 11 |
Regency | 11.01 | 1101 |
District | 11.01.01 | 110101 |
Island | 11.01.40001 | 110140001 |
Village | 11.01.01.2001 | 1101012001 |
This package is currently not providing the islands data contained in REF-2022-1 (starts from page 3548 to 4038).
The island data consists of:
Island code, for example: 11.06.40007
11.06
is the regency code, 4
is digit indicating it's an island, and 0007
is the serial number starts from 0001.
But sometimes, the island does not belong to any regency. So that, the third and fourth digits will be zero (00
). See 12.00.40001 Pulau Babi
for the example.
Island name, for example: Pulau Bateeleblah
Island coordinate, for example: 05°47'34.72" U 094°58'26.09" T
The coordinate is written in DMS (degree minute seconds) format. U
stands for "Utara" or "North", and T
stands for "Timur" or "East".
Island information, for example: TBP (PPKT)
The information available includes:
BT
: stands for "Berpenghuni" or "Populated".TBP
: stands for "Tidak Berpenghuni" or "Unpopulated".PPKT
: stands for "Pulau-Pulau Kecil Terluar" or "Outermost Small Islands" (see the definition).Create islands.csv
file that contains this column:
code
for the island code without dot separation. For example: 110640007
.regency_code
for relation to the regency data. For example: 1106
. If the island does not belong to any regency, just leave the regency_code
column empty (put ,
and go to the next column).coordinate
for the island coordinate with English term. For example: 05°47'34.72" N 094°58'26.09" E
.is_populated
with value 1
if the island is populated (BT
), or 0
if (TBP
) and no available data.is_outermost_small
with value 1
if the island is The Outermost Small Islands (PPKT
), or 0
if not.name
for the island name. For example: Pulau Bateeleblah
.Create new function to get all island data.
Create a tests suite to test the islands data.
None
Especially for the development of this feature, please PR to feat/islands
branch.
To adding the island data, you can ask ChatGPT help to formatting the data with this prompt:
I need you to sanitize and format this raw data.
First you must learn and analyze the pattern of this raw data and the result.
// raw data
11.09.40017 Pulau Babi 02°10'08.00" U 096°38'10.00" T
11.09.40018 Pulau Balok 02°28'58.49" U 096°23'11.95" T TBP
11.09.40019 Pulau Balubuk 02°53'52.51" U 095°50'14.15" BP
11.09.40020 Pulau Balung 02°40'13.00" U 096°07'58.00" T PPTK
11.09.40023 Pulau Batuberlayar Kecil 02°25'29.46" U 096°31'18.48" T BP (PPTK)
11.09.40024 Pulau Batuhek 02°21'37.72" U 096°12'13.66" T BP
11.09.40025 Pulau Benar 02°32'17.33" U 096°21'27.12" T TBP (PPTK)
// result
code,regency_code,coordinate,is_populated,is_outermost_small,name
110940017,1109,02°10'08.00" N 096°38'10.00" E,0,0,Pulau Babi
110940018,1109,02°28'58.49" N 096°23'11.95" E,0,0,Pulau Balok
110940019,1109,02°53'52.51" N 095°50'14.15" E,1,0,Pulau Balubuk
110940020,1109,02°40'13.00" N 096°07'58.00" E,0,1,Pulau Balung
110940023,1109,02°25'29.46" N 096°31'18.48" E,1,1,Pulau Batuberlayar Kecil
110940024,1109,02°21'37.72" N 096°12'13.66" E,1,0,Pulau Batuhek
110940025,1109,02°32'17.33" N 096°21'27.12" E,0,1,Pulau Benar
Hint for you:
- Value for is_populated: `1` if `BP` present, and `0` if not.
- Value for is_outermost_small, `1` if `PPKT` present, and `0` if not .
- `BP` not same with `TBP`.
- Just ignore the `TBP`.
DON'T RETURN ANY RESPONSE NOW! Just analyze the data.
Then you can start asking ChatGPT to formatting the real data in the next prompt.
Make sure you check the ChatGPT answer from wrong data, typo, etc.
Don't trust ChatGPT completely.
Add an optional option (boolean
type) to remove dots from code
and parent_code
data for getRegencies()
, getDistricts()
, getVillages()
, and getIslands()
methods.
The option name suggestions: removeDotsFromCode
.
Translate the README into Bahasa Indonesia and other languages.
docs
folder and named it with README_{2 letter of language code}.md
the language code must follows the ISO 639-1 code languages, e.g. README_id.md
for Indonesian (Bahasa Indonesia).<i>Data Wilayah Indonesia</i>
.[!NOTE]
, [!IMPORTANT]
, and [!WARNING]
).For everyone who wants to contribute to this issue, please fork this repo, make changes, and create a new PR. When ready, ask me to review your work. I will not assign each person individually.
Halo,
Sebelumnya terimakasih telah membuat projek yang sangat bagus seperti ini, sangat berguna sekali diprojekan saya.
Tapi disisi lain, menurut saya ada yang kurang diprojek ini, yaitu file SQL untuk programmer yang masih berkutat dibidang RDBMS seperti saya ini.
Dengan tersedianya file SQL, programmer tidak perlu repot-repot lagi untuk mengubah dari CSV ke SQL atau melakukan pembuatan table wilayah lalu import csvnya.
Apa mas @fityannugroho berkenan kalau saya open PR untuk menambahkan file SQL tersebut?
Terimakasih ☕️
Currently, the island that doesn't belong to any regency will give the regency_code
value with empty string ''
.
It is better if the regency_code
value of the island that doesn't belong to any regency (and any empty value later) is transformed into null
.
kode 96
Decamelize the district name and village name like the original data written in the PDF source.
Update the data based on latest regulation:
Keputusan Menteri Dalam Negeri Nomor 100.1.1-6117 Tahun 2022 Tentang Pemberian dan Pemutakhiran Kode, Data Wilayah Administrasi Pemerintahan, dan Pulau (alternative link)
The main changes is the expansion of the province PAPUA and PAPUA BARAT.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.