algeria
algeria is a simple Node.js package that provides administrative, location,.. information about algeria.
Using package
var dz = ;
Available functions
wilaya
(wilaya is the algerian name for county)
dz
where id
is the wilaya number, between 1 and 48.
field
can be id
, name
, longName
, position
, latitude
, longitude
.
If field
is not given, an abject with all available information is returned.
Exemple:
var dz=; dz // "Alger" dz // "Wilaya de Tizi Ouzou" dz // "06" dz // { latitude: 24.0982893, longitude: 3.743509 }
wilaya.each
A loop through wilayas.
Exemple:
var dz=; dzwilaya;
commune
Get a 'commune' element by its 'ONS code' (primary key). (commune is the algerian name for township)
var dz=; dz; // { name: 'Belouizdad', wilaya: 16, ONSCode: '1604'}
commune(code).wilaya
The previous command returns information about the wilaya (county) :
var dz=; dzwilaya;
commune.each( callback )
A loop through all communes of algeria :
var dz=; dzcommune;
commune.each( wilaya, callback )
Loop through all communes of a wilaya :
var dz=; dzcommune;