@geoalgeria/ecoles 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 Yasser's Studio (https://yasser.studio)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.ar.md ADDED
@@ -0,0 +1,199 @@
1
+ [English](README.md) | [Français](README.fr.md) | **العربية**
2
+
3
+ <div align="center">
4
+
5
+ # @geoalgeria/ecoles
6
+
7
+ **مدارس الجزائر — كبيانات قابلة للتثبيت.**
8
+
9
+ [![npm](https://img.shields.io/npm/v/@geoalgeria/ecoles)](https://www.npmjs.com/package/@geoalgeria/ecoles)
10
+ [![npm downloads](https://img.shields.io/npm/dm/@geoalgeria/ecoles)](https://www.npmjs.com/package/@geoalgeria/ecoles)
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
12
+
13
+ </div>
14
+
15
+ **11٬830 مدرسة بإحداثيات جغرافية** عبر **69 ولاية** في الجزائر — كلٌّ بإحداثياته،
16
+ مُصنَّفة حسب **الطور** (ابتدائي · متوسط/CEM · ثانوي/lycée · تحضيري)، ومعظمها باسمٍ
17
+ عربي و/أو فرنسي، مع ربطٍ بالبلدية والولاية. مُستخرَجة من **OpenStreetMap**
18
+ ومُقدَّمة بصدقٍ مقابل نحو 28٬000 مؤسسة في الشبكة المدرسية الوطنية. متوفرة بصيغ JSON
19
+ وCSV وGeoJSON وTypeScript. جزء من
20
+ [GeoAlgeria](https://github.com/yasserstudio/geoalgeria).
21
+
22
+ ```bash
23
+ npm install @geoalgeria/ecoles
24
+ ```
25
+
26
+ ```js
27
+ import ecoles from "@geoalgeria/ecoles";
28
+
29
+ const all = ecoles.ecoles(); // 11٬830 مدرسة بإحداثيات
30
+
31
+ // ثانويات ولاية معيّنة (ربطٌ على wilaya_code من GeoAlgeria)
32
+ const lyceesSetif = all.filter((e) => e.wilaya_code === "19" && e.cycle === "secondaire");
33
+
34
+ // المدارس المُسمّاة فقط، باسمٍ فرنسي
35
+ const named = all.filter((e) => e.name_fr);
36
+ ```
37
+
38
+ ## ماذا يمكنك أن تبني
39
+
40
+ - **خرائط وأدلّة المدارس** — إحداثيات على كامل السجلّات الـ11٬830، جاهزة لخريطة أو
41
+ لترتيبٍ حسب أقرب مدرسة.
42
+ - **تفصيلٌ حسب الطور** — رشِّح الابتدائي / المتوسط / الثانوي / التحضيري، أو رتِّب
43
+ كثافة المدارس حسب البلدية/الولاية.
44
+ - **أدلّة ثنائية اللغة** — آلاف الأسماء بالعربية والفرنسية جنبًا إلى جنب.
45
+
46
+ ## المحتوى
47
+
48
+ | مجموعة البيانات | العدد | الإحداثيات | ملاحظات |
49
+ | --- | --- | --- | --- |
50
+ | المدارس | **11٬830** | ✅ الكل | 8٬640 مُسمّاة، 69 ولاية |
51
+
52
+ **حسب الطور**
53
+
54
+ | الطور | العدد | المعنى |
55
+ | --- | --- | --- |
56
+ | `primaire` | 4٬020 | مدرسة ابتدائية (ISCED 1) |
57
+ | `moyen` | 2٬377 | متوسطة / CEM (ISCED 2) |
58
+ | `secondaire` | 1٬574 | ثانوية / lycée (ISCED 3) |
59
+ | `prescolaire` | 268 | تحضيري / روضة (ISCED 0) |
60
+ | `autre` | 3٬591 | مدرسة غير محدّدة الطور (بلا اسم، أو اسمٌ بلا كلمة طور) |
61
+
62
+ > **هذا استخراجٌ من OpenStreetMap، وليس سجلًّا رسميًّا.** التغطية جزئية ومتفاوتة
63
+ > بين الولايات — نحو 11.8 ألف مدرسة مُخرَّطة مقابل ~28٬000 في الشبكة الوطنية
64
+ > (ابتدائي + متوسط + ثانوي، وزارة التربية الوطنية، تقريبيًّا). تتغيّر الأعداد مع
65
+ > تعديل OpenStreetMap.
66
+
67
+ **الطور مُستنتَج.** يأتي من `isced:level` ومن الاسم الفرنسي/العربي — فالمتوسطة
68
+ تحمل دائمًا متوسطة/collège، والثانوية ثانوية/lycée، والروضة روضة/préscolaire. أمّا
69
+ «مدرسة»/«école» المجرّدة بلا كلمة طور فتُصنَّف `primaire` بحكم العُرف الجزائري؛ وما
70
+ تبقّى دون حسمٍ فهو `autre`. تحصل 93٪ من المدارس *المُسمّاة* على طورٍ محدّد.
71
+
72
+ **حسب النوع (`kind`)** — الـ`kind` هو نوع المؤسسة، *مستقلٌّ* عن الطور، ليتيح ترشيح
73
+ (أو عزل) الأماكن الخاصة التي يصنّفها OpenStreetMap تحت `amenity=school`:
74
+
75
+ | النوع | العدد | المعنى | الطور |
76
+ | --- | --- | --- | --- |
77
+ | `regular` | 11٬640 | مدرسة/متوسطة/ثانوية/روضة عادية | طورها الحقيقي |
78
+ | `formation` | 91 | مركز تكوين مهني | `autre` |
79
+ | `coranique` | 40 | مدرسة قرآنية | `autre` |
80
+ | `langues` | 24 | مدرسة/معهد لغات | `autre` |
81
+ | `special` | 30 | مدرسة للتربية الخاصة (الصم، المكفوفين…) | يحتفظ بطوره |
82
+ | `conduite` | 5 | مدرسة تعليم السياقة | `autre` |
83
+
84
+ الأنواع الأربعة خارج التعليم الأساسي (`formation`/`coranique`/`langues`/`conduite`)
85
+ تحمل الطور `autre` — فهي ليست مدارس ابتدائية رغم احتواء اسمها على «école»؛ الـ`kind`
86
+ يجعلها قابلة للعثور بدل ضياعها في `autre`.
87
+
88
+ **كذلك في كل سجلّ:** `isced_levels` (مستويات `isced:level` من OSM، مُطبَّعة كقائمة
89
+ مرتّبة مثل `"1;2"` — في 2٬037 سجلًّا)، و`address` (من وسوم `addr:*` — في 2٬625)،
90
+ و`sector` (`public`/`private` حيث تشير الخريطة).
91
+
92
+ ## الصيغ
93
+
94
+ يوفّر حزمة npm صيغة **JSON** (قابلة للاستيراد مباشرة):
95
+
96
+ ```js
97
+ import ecoles from "@geoalgeria/ecoles/data/ecoles.json" with { type: "json" };
98
+ // أو عبر CDN، دون تثبيت:
99
+ // https://cdn.jsdelivr.net/npm/@geoalgeria/ecoles/data/ecoles.json
100
+ ```
101
+
102
+ المُحمِّلات وأشكال السجلّات مُنمّطة بالكامل — تعريفات TypeScript مُضمَّنة في الحزمة:
103
+
104
+ ```ts
105
+ import ecoles, { type Ecole } from "@geoalgeria/ecoles";
106
+ const all: Ecole[] = ecoles.ecoles();
107
+ ```
108
+
109
+ صيغتا **CSV وGeoJSON** موجودتان في المستودع ضمن [`data/`](data) ومُضمَّنتان في كل
110
+ [إصدار على GitHub](https://github.com/yasserstudio/geoalgeria/releases):
111
+
112
+ ```
113
+ data/
114
+ ecoles.json # 11٬830 مدرسة (مصفوفة)
115
+ metadata.json # المصدر، الأعداد، التغطية، generated_at
116
+ csv/ecoles.csv # المستودع + حزمة الإصدار (ليست في حزمة npm)
117
+ geojson/ecoles.geojson # معالم نقطية
118
+ ```
119
+
120
+ ## شكل السجلّ
121
+
122
+ ```json
123
+ {
124
+ "id": "16-00042",
125
+ "source": "osm",
126
+ "osm_id": "way/292876445",
127
+ "name": "Lycée El Idrissi",
128
+ "name_ar": "ثانوية الإدريسي",
129
+ "name_fr": "Lycée El Idrissi",
130
+ "cycle": "secondaire",
131
+ "cycle_label_fr": "Lycée",
132
+ "cycle_label_ar": "ثانوية",
133
+ "kind": "regular",
134
+ "kind_label_fr": "École ordinaire",
135
+ "kind_label_ar": "مدرسة عادية",
136
+ "isced_levels": "3",
137
+ "sector": null,
138
+ "wilaya": "Alger",
139
+ "wilaya_ar": "الجزائر",
140
+ "wilaya_code": "16",
141
+ "commune": "Casbah",
142
+ "commune_code": 1607,
143
+ "address": null,
144
+ "lat": 36.779365,
145
+ "lng": 3.05949,
146
+ "geo_precision": "osm_centroid"
147
+ }
148
+ ```
149
+
150
+ `id` مفتاحٌ ثابت `{wilaya_code}-{seq}` يُوَلِّده GeoAlgeria؛ و`osm_id` يعود إلى
151
+ الكائن المصدر. `name` يكون `null` للنقاط غير المُسمّاة. `cycle` هو الطور و`kind`
152
+ نوع المؤسسة (انظر أعلاه)، ولكلٍّ منهما تسميتان ثنائيتا اللغة. `isced_levels`
153
+ و`address` يأتيان مباشرةً من OSM (`null` عند غياب الوسوم). `sector` يكون
154
+ `"public"`/`"private"` فقط عند وجود إشارةٍ صريحة، وإلّا `null`. `geo_precision`
155
+ يكون `osm_node` (نقطة مسحية) أو `osm_centroid` (مركز مُخطَّط مبنى). ويُربَط
156
+ `wilaya_code` بِـ`wilaya_code` من GeoAlgeria.
157
+
158
+ > **ربط البلدية/الولاية مُستنتَج، لا يأتي من المصدر.** لا يحمل OpenStreetMap الرموز
159
+ > الإدارية الجزائرية. يُلحِق GeoAlgeria `wilaya_code` و`commune_code` و`commune`
160
+ > عبر **ربطٍ بأقرب مركز ثقل** مقابل مجموعة بلديات
161
+ > [`geoalgeria`](https://www.npmjs.com/package/geoalgeria). إسناد الولاية دقيقٌ
162
+ > عمليًّا؛ أمّا البلدية فأفضل تقدير (قرب المركز، لا الاحتواء المضلَّعي).
163
+
164
+ ## أتحتاج إلى التقسيمات الإدارية أيضًا؟
165
+
166
+ للولايات والدوائر والبلديات، استخدم الحزمة الرئيسية
167
+ **[`geoalgeria`](https://www.npmjs.com/package/geoalgeria)** — بها تُحوِّل
168
+ `commune_code` لمدرسةٍ إلى مُضلَّعٍ أو مركز ثقل. استخدم `@geoalgeria/ecoles` حين
169
+ تحتاج إلى المدارس *فقط*.
170
+
171
+ ## المصدر والمنهجية
172
+
173
+ شغّل `npm run fetch` لإعادة توليد كل المخرجات. يقوم السكربت بِـ:
174
+
175
+ 1. الاستعلام من **OpenStreetMap** (Overpass) عن `amenity=school` و
176
+ `amenity=kindergarten` داخل الجزائر؛
177
+ 2. **تصنيف الطور** من `isced:level` والاسم الفرنسي/العربي؛
178
+ 3. إزالة تكرار المدرسة نفسها المُخرَّطة كنقطةٍ ومبنى معًا؛
179
+ 4. إلحاق البلدية/الولاية بأقرب مركز ثقل بلدية.
180
+
181
+ تُخزَّن الاستخراجات الخام مؤقتًا ضمن
182
+ [`research/ecoles/`](https://github.com/yasserstudio/geoalgeria/tree/main/research/ecoles).
183
+
184
+ ## الرخصة والإسناد
185
+
186
+ **كود** الحزمة تحت رخصة [MIT](LICENSE). أمّا **البيانات** فمن **OpenStreetMap** —
187
+ **© مساهمو OpenStreetMap**، تحت رخصة
188
+ **[ODbL 1.0](https://www.openstreetmap.org/copyright)**. إذا استخدمت هذه البيانات
189
+ أو أعدت توزيعها، فعليك **إسناد الفضل لمساهمي OpenStreetMap** وإبقاء قواعد البيانات
190
+ المُشتقّة تحت رخصةٍ متوافقة.
191
+
192
+ تحقّق من المصادر الرسمية للحصول على معلوماتٍ موثوقة. تُقدَّم هذه البيانات للاستئناس
193
+ ولتشغيل [GeoAlgeria](https://geoalgeria.com).
194
+
195
+ [توثيق الـAPI والحقول →](https://geoalgeria.com/data/docs/ecoles) · [تصفّح كل الحزم →](https://geoalgeria.com/data)
196
+
197
+ ---
198
+
199
+ من إنجاز [Yasser's Studio](https://yasser.studio) · [LinkedIn](https://www.linkedin.com/in/yasserberrehail/) · [X](https://x.com/yassersstudio) · [hello@yasser.studio](mailto:hello@yasser.studio)
package/README.fr.md ADDED
@@ -0,0 +1,210 @@
1
+ [English](README.md) | **Français** | [العربية](README.ar.md)
2
+
3
+ <div align="center">
4
+
5
+ # @geoalgeria/ecoles
6
+
7
+ **Les écoles d'Algérie — sous forme de données prêtes à installer.**
8
+
9
+ [![npm](https://img.shields.io/npm/v/@geoalgeria/ecoles)](https://www.npmjs.com/package/@geoalgeria/ecoles)
10
+ [![npm downloads](https://img.shields.io/npm/dm/@geoalgeria/ecoles)](https://www.npmjs.com/package/@geoalgeria/ecoles)
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
12
+
13
+ </div>
14
+
15
+ **11 830 écoles géolocalisées** dans les **69 wilayas** d'Algérie — chacune avec
16
+ ses coordonnées, classée par **cycle** (primaire · moyen/CEM · secondaire/lycée ·
17
+ préscolaire), la plupart avec un nom en arabe et/ou en français, et un
18
+ rattachement commune/wilaya. Extraites d'**OpenStreetMap** et présentées
19
+ honnêtement face aux ~28 000 établissements du réseau scolaire national. Livré en
20
+ JSON, CSV, GeoJSON et TypeScript. Fait partie de
21
+ [GeoAlgeria](https://github.com/yasserstudio/geoalgeria).
22
+
23
+ ```bash
24
+ npm install @geoalgeria/ecoles
25
+ ```
26
+
27
+ ```js
28
+ import ecoles from "@geoalgeria/ecoles";
29
+
30
+ const all = ecoles.ecoles(); // 11 830 écoles géolocalisées
31
+
32
+ // Lycées d'une wilaya (jointure sur wilaya_code de GeoAlgeria)
33
+ const lyceesSetif = all.filter((e) => e.wilaya_code === "19" && e.cycle === "secondaire");
34
+
35
+ // Uniquement les écoles nommées, avec un libellé français
36
+ const named = all.filter((e) => e.name_fr);
37
+ ```
38
+
39
+ ## Ce que vous pouvez construire
40
+
41
+ - **Cartes & annuaires d'écoles** — coordonnées sur les 11 830 enregistrements,
42
+ prêtes pour une carte ou un tri par école la plus proche.
43
+ - **Répartitions par cycle** — filtrez primaire / moyen / secondaire /
44
+ préscolaire, ou classez la densité scolaire par commune/wilaya.
45
+ - **Annuaires bilingues** — des milliers de noms en arabe et en français, côte à côte.
46
+
47
+ ## Contenu
48
+
49
+ | Jeu de données | Nombre | Coordonnées | Notes |
50
+ | --- | --- | --- | --- |
51
+ | Écoles | **11 830** | ✅ toutes | 8 640 nommées, 69 wilayas |
52
+
53
+ **Par cycle**
54
+
55
+ | Cycle | Nombre | Signification |
56
+ | --- | --- | --- |
57
+ | `primaire` | 4 020 | école primaire (CITE 1) |
58
+ | `moyen` | 2 377 | collège d'enseignement moyen / CEM (CITE 2) |
59
+ | `secondaire` | 1 574 | lycée (CITE 3) |
60
+ | `prescolaire` | 268 | préscolaire / maternelle / روضة (CITE 0) |
61
+ | `autre` | 3 591 | école de cycle indéterminé (non nommée, ou nom sans mot de cycle) |
62
+
63
+ > **Il s'agit d'un extrait OpenStreetMap, pas d'un registre officiel.** La
64
+ > couverture est partielle et inégale selon les wilayas — ~11,8k écoles
65
+ > cartographiées face aux ~28 000 du réseau national (primaire + moyen +
66
+ > secondaire, Ministère de l'Éducation Nationale, approximatif). Les nombres
67
+ > évoluent au fil des contributions à OpenStreetMap.
68
+
69
+ **Le cycle est déduit.** Il provient d'`isced:level` et du nom français/arabe —
70
+ un CEM se nomme toujours متوسطة/collège, un lycée ثانوية/lycée, une maternelle
71
+ روضة/préscolaire. Une simple « école »/« مدرسة » sans mot de cycle est classée
72
+ `primaire` par convention algérienne ; le reste est `autre`. 93 % des écoles
73
+ *nommées* obtiennent un cycle précis.
74
+
75
+ **Par type (`kind`)** — le `kind` est le type d'établissement, *orthogonal* au
76
+ cycle, pour filtrer (ou isoler) les lieux particuliers qu'OSM classe sous
77
+ `amenity=school` :
78
+
79
+ | Type | Nombre | Signification | Cycle |
80
+ | --- | --- | --- | --- |
81
+ | `regular` | 11 640 | école / CEM / lycée / maternelle ordinaire | son cycle réel |
82
+ | `formation` | 91 | centre de formation professionnelle | `autre` |
83
+ | `coranique` | 40 | école coranique | `autre` |
84
+ | `langues` | 24 | école / institut de langues | `autre` |
85
+ | `special` | 30 | école spécialisée (sourds, aveugles…) | garde son cycle |
86
+ | `conduite` | 5 | auto-école | `autre` |
87
+
88
+ Les quatre types hors K-12 (`formation`/`coranique`/`langues`/`conduite`) portent
89
+ le cycle `autre` — ce ne sont pas des écoles primaires même si leur nom contient
90
+ « école » ; le `kind` les rend repérables au lieu de les noyer dans `autre`.
91
+
92
+ **Aussi sur chaque enregistrement :** `isced_levels` (les niveaux `isced:level`
93
+ d'OSM, normalisés en liste triée comme `"1;2"` — sur 2 037 enregistrements),
94
+ `address` (depuis les tags OSM `addr:*` — sur 2 625) et `sector`
95
+ (`public`/`private` là où la carte le signale).
96
+
97
+ ## Formats
98
+
99
+ Le paquet npm fournit le **JSON** (importable directement) :
100
+
101
+ ```js
102
+ import ecoles from "@geoalgeria/ecoles/data/ecoles.json" with { type: "json" };
103
+ // ou via CDN, sans installation :
104
+ // https://cdn.jsdelivr.net/npm/@geoalgeria/ecoles/data/ecoles.json
105
+ ```
106
+
107
+ Les chargeurs et les formes d'enregistrement sont entièrement **typés** — les
108
+ définitions TypeScript sont incluses dans le paquet :
109
+
110
+ ```ts
111
+ import ecoles, { type Ecole } from "@geoalgeria/ecoles";
112
+ const all: Ecole[] = ecoles.ecoles();
113
+ ```
114
+
115
+ Les fichiers **CSV et GeoJSON** sont dans le dépôt sous [`data/`](data) et
116
+ inclus dans chaque
117
+ [Release GitHub](https://github.com/yasserstudio/geoalgeria/releases) :
118
+
119
+ ```
120
+ data/
121
+ ecoles.json # 11 830 écoles (tableau)
122
+ metadata.json # source, décomptes, couverture, generated_at
123
+ csv/ecoles.csv # dépôt + bundle Release (pas dans le tarball npm)
124
+ geojson/ecoles.geojson # entités Point
125
+ ```
126
+
127
+ ## Forme d'un enregistrement
128
+
129
+ ```json
130
+ {
131
+ "id": "16-00042",
132
+ "source": "osm",
133
+ "osm_id": "way/292876445",
134
+ "name": "Lycée El Idrissi",
135
+ "name_ar": "ثانوية الإدريسي",
136
+ "name_fr": "Lycée El Idrissi",
137
+ "cycle": "secondaire",
138
+ "cycle_label_fr": "Lycée",
139
+ "cycle_label_ar": "ثانوية",
140
+ "kind": "regular",
141
+ "kind_label_fr": "École ordinaire",
142
+ "kind_label_ar": "مدرسة عادية",
143
+ "isced_levels": "3",
144
+ "sector": null,
145
+ "wilaya": "Alger",
146
+ "wilaya_ar": "الجزائر",
147
+ "wilaya_code": "16",
148
+ "commune": "Casbah",
149
+ "commune_code": 1607,
150
+ "address": null,
151
+ "lat": 36.779365,
152
+ "lng": 3.05949,
153
+ "geo_precision": "osm_centroid"
154
+ }
155
+ ```
156
+
157
+ `id` est une clé stable `{wilaya_code}-{seq}` synthétisée par GeoAlgeria ;
158
+ `osm_id` renvoie à l'objet source. `name` est `null` pour les points non nommés.
159
+ `cycle` est le niveau et `kind` le type d'établissement (voir ci-dessus), chacun
160
+ avec des libellés bilingues. `isced_levels` et `address` proviennent directement
161
+ d'OSM (`null` si les tags sont absents). `sector` vaut `"public"`/`"private"`
162
+ uniquement en présence d'un signal explicite, sinon `null`. `geo_precision` vaut
163
+ `osm_node` (point relevé) ou `osm_centroid` (centre d'un contour de bâtiment).
164
+ `wilaya_code` se joint au `wilaya_code` de GeoAlgeria.
165
+
166
+ > **Le rattachement commune/wilaya est déduit, pas issu de la source.**
167
+ > OpenStreetMap ne porte pas les codes administratifs algériens. GeoAlgeria
168
+ > attache `wilaya_code`, `commune_code` et `commune` par une **jointure au
169
+ > centroïde le plus proche** contre le jeu de communes
170
+ > [`geoalgeria`](https://www.npmjs.com/package/geoalgeria). La wilaya est
171
+ > quasi exacte ; la commune est au mieux (proximité de centroïde, pas
172
+ > d'inclusion polygonale).
173
+
174
+ ## Besoin aussi des divisions administratives ?
175
+
176
+ Pour les wilayas, daïras et communes, utilisez le paquet principal
177
+ **[`geoalgeria`](https://www.npmjs.com/package/geoalgeria)** — c'est ainsi que
178
+ vous transformez le `commune_code` d'une école en polygone ou centroïde. Utilisez
179
+ `@geoalgeria/ecoles` lorsque vous ne voulez *que* les écoles.
180
+
181
+ ## Source & méthode
182
+
183
+ Lancez `npm run fetch` pour régénérer toutes les sorties. Le script :
184
+
185
+ 1. interroge **OpenStreetMap** (Overpass) pour `amenity=school` et
186
+ `amenity=kindergarten` en Algérie ;
187
+ 2. **classe le cycle** à partir d'`isced:level` et du nom français/arabe ;
188
+ 3. déduplique la même école cartographiée à la fois comme nœud et comme bâtiment ;
189
+ 4. attache commune/wilaya par centroïde de commune le plus proche.
190
+
191
+ Les extractions brutes sont mises en cache sous
192
+ [`research/ecoles/`](https://github.com/yasserstudio/geoalgeria/tree/main/research/ecoles).
193
+
194
+ ## Licence & attribution
195
+
196
+ Le **code** du paquet est sous [MIT](LICENSE). Les **données** proviennent
197
+ d'**OpenStreetMap** — **© les contributeurs d'OpenStreetMap**, sous licence
198
+ **[ODbL 1.0](https://www.openstreetmap.org/copyright)**. Si vous utilisez ou
199
+ redistribuez ce jeu de données, vous devez **attribuer les contributeurs
200
+ d'OpenStreetMap** et conserver les bases dérivées sous une licence compatible.
201
+
202
+ Vérifiez auprès des sources officielles pour toute information faisant autorité.
203
+ Ce jeu de données est fourni à titre de référence et pour alimenter
204
+ [GeoAlgeria](https://geoalgeria.com).
205
+
206
+ [Docs API & champs →](https://geoalgeria.com/data/docs/ecoles) · [Voir tous les paquets →](https://geoalgeria.com/data)
207
+
208
+ ---
209
+
210
+ Réalisé par [Yasser's Studio](https://yasser.studio) · [LinkedIn](https://www.linkedin.com/in/yasserberrehail/) · [X](https://x.com/yassersstudio) · [hello@yasser.studio](mailto:hello@yasser.studio)
package/README.md ADDED
@@ -0,0 +1,203 @@
1
+ **English** | [Français](README.fr.md) | [العربية](README.ar.md)
2
+
3
+ <div align="center">
4
+
5
+ # @geoalgeria/ecoles
6
+
7
+ **The schools of Algeria — as data you can install.**
8
+
9
+ [![npm](https://img.shields.io/npm/v/@geoalgeria/ecoles)](https://www.npmjs.com/package/@geoalgeria/ecoles)
10
+ [![npm downloads](https://img.shields.io/npm/dm/@geoalgeria/ecoles)](https://www.npmjs.com/package/@geoalgeria/ecoles)
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
12
+
13
+ </div>
14
+
15
+ **11,830 geocoded schools** across all **69 wilayas** of Algeria — every one with
16
+ coordinates, classified by **cycle** (primaire · moyen/CEM · secondaire/lycée ·
17
+ préscolaire), most with Arabic and/or French names, and commune/wilaya linkage.
18
+ Extracted from **OpenStreetMap** and framed honestly against the ~28,000
19
+ establishments of the national school network. Shipped as JSON, CSV, GeoJSON, and
20
+ TypeScript. Part of [GeoAlgeria](https://github.com/yasserstudio/geoalgeria).
21
+
22
+ ```bash
23
+ npm install @geoalgeria/ecoles
24
+ ```
25
+
26
+ ```js
27
+ import ecoles from "@geoalgeria/ecoles";
28
+
29
+ const all = ecoles.ecoles(); // 11,830 geocoded schools
30
+
31
+ // Lycées in a wilaya (joins GeoAlgeria's wilaya_code)
32
+ const lyceesSetif = all.filter((e) => e.wilaya_code === "19" && e.cycle === "secondaire");
33
+
34
+ // Only the named ones, with a French label
35
+ const named = all.filter((e) => e.name_fr);
36
+ ```
37
+
38
+ ## What you can build
39
+
40
+ - **School maps & locators** — coordinates on all 11,830 records, ready for a map
41
+ or nearest-school distance sorting.
42
+ - **Cycle breakdowns** — filter primaire / moyen / secondaire / préscolaire, or
43
+ rank school density per commune/wilaya across the country.
44
+ - **Bilingual directories** — thousands of Arabic and French names, side by side.
45
+
46
+ ## What's inside
47
+
48
+ | Dataset | Count | Coordinates | Notes |
49
+ | --- | --- | --- | --- |
50
+ | Schools | **11,830** | ✅ all | 8,640 named, 69 wilayas |
51
+
52
+ **By cycle**
53
+
54
+ | Cycle | Count | Meaning |
55
+ | --- | --- | --- |
56
+ | `primaire` | 4,020 | école primaire (ISCED 1) |
57
+ | `moyen` | 2,377 | collège d'enseignement moyen / CEM (ISCED 2) |
58
+ | `secondaire` | 1,574 | lycée (ISCED 3) |
59
+ | `prescolaire` | 268 | préscolaire / maternelle / روضة (ISCED 0) |
60
+ | `autre` | 3,591 | school of undetermined cycle (unnamed, or a name with no cycle word) |
61
+
62
+ > **This is an OpenStreetMap extract, not an official registry.** Coverage is
63
+ > partial and uneven by wilaya — ~11.8k schools mapped against the ~28,000 in the
64
+ > national network (primaire + moyen + secondaire, Ministry of National
65
+ > Education, approximate). Counts move as OpenStreetMap is edited; each rebuild
66
+ > reflects the current state of the map.
67
+
68
+ **Cycle is inferred.** It comes from `isced:level` and the French/Arabic name — a
69
+ CEM always names itself متوسطة/collège, a lycée ثانوية/lycée, a maternelle
70
+ روضة/préscolaire. A bare "école"/"مدرسة" with no cycle word is classified
71
+ `primaire` by Algerian convention (a standalone school is a primary school);
72
+ anything unresolved is `autre`. 93% of *named* schools resolve to a specific cycle.
73
+
74
+ **By kind** — `kind` is the establishment type, *orthogonal* to cycle, so you can
75
+ filter out (or in) the special-purpose places OSM files under `amenity=school`:
76
+
77
+ | Kind | Count | Meaning | Cycle |
78
+ | --- | --- | --- | --- |
79
+ | `regular` | 11,640 | a standard école / CEM / lycée / maternelle | its real cycle |
80
+ | `formation` | 91 | vocational / training centre | `autre` |
81
+ | `coranique` | 40 | Quranic school | `autre` |
82
+ | `langues` | 24 | language school / institute | `autre` |
83
+ | `special` | 30 | adapted / special-needs school (deaf, blind…) | keeps its cycle |
84
+ | `conduite` | 5 | driving school (auto-école) | `autre` |
85
+
86
+ The four non-K-12 kinds (`formation`/`coranique`/`langues`/`conduite`) carry
87
+ cycle `autre` — they're *not* primary schools even though their name contains
88
+ "école"; `kind` is what makes them findable instead of buried in `autre`.
89
+
90
+ **Also on each record:** `isced_levels` (the OSM `isced:level` served, normalized
91
+ to a sorted list like `"1;2"` — on 2,037 records), `address` (from OSM `addr:*`
92
+ tags — on 2,625), and `sector` (`public`/`private` where the map signals it).
93
+
94
+ ## Formats
95
+
96
+ The npm package ships the **JSON** (importable directly):
97
+
98
+ ```js
99
+ import ecoles from "@geoalgeria/ecoles/data/ecoles.json" with { type: "json" };
100
+ // or via CDN, no install:
101
+ // https://cdn.jsdelivr.net/npm/@geoalgeria/ecoles/data/ecoles.json
102
+ ```
103
+
104
+ The loaders and record shapes are fully **typed** — TypeScript definitions ship in the package:
105
+
106
+ ```ts
107
+ import ecoles, { type Ecole } from "@geoalgeria/ecoles";
108
+ const all: Ecole[] = ecoles.ecoles();
109
+ ```
110
+
111
+ **CSV and GeoJSON** are in the repo under [`data/`](data) and bundled in every
112
+ [GitHub Release](https://github.com/yasserstudio/geoalgeria/releases):
113
+
114
+ ```
115
+ data/
116
+ ecoles.json # 11,830 schools (array)
117
+ metadata.json # source, counts, coverage, generated_at
118
+ csv/ecoles.csv # repo + Release bundle (not in npm tarball)
119
+ geojson/ecoles.geojson # Point features
120
+ ```
121
+
122
+ ## Record shape
123
+
124
+ ```json
125
+ {
126
+ "id": "16-00042",
127
+ "source": "osm",
128
+ "osm_id": "way/292876445",
129
+ "name": "Lycée El Idrissi",
130
+ "name_ar": "ثانوية الإدريسي",
131
+ "name_fr": "Lycée El Idrissi",
132
+ "cycle": "secondaire",
133
+ "cycle_label_fr": "Lycée",
134
+ "cycle_label_ar": "ثانوية",
135
+ "kind": "regular",
136
+ "kind_label_fr": "École ordinaire",
137
+ "kind_label_ar": "مدرسة عادية",
138
+ "isced_levels": "3",
139
+ "sector": null,
140
+ "wilaya": "Alger",
141
+ "wilaya_ar": "الجزائر",
142
+ "wilaya_code": "16",
143
+ "commune": "Casbah",
144
+ "commune_code": 1607,
145
+ "address": null,
146
+ "lat": 36.779365,
147
+ "lng": 3.05949,
148
+ "geo_precision": "osm_centroid"
149
+ }
150
+ ```
151
+
152
+ `id` is a stable `{wilaya_code}-{seq}` key synthesized by GeoAlgeria; `osm_id`
153
+ links back to the upstream object. `name` is the best available display name and
154
+ is `null` for unnamed points. `cycle` is the education level and `kind` the
155
+ establishment type (see above), each with bilingual labels. `isced_levels` and
156
+ `address` come straight from OSM (`null` when the tags are absent). `sector` is
157
+ `"public"`/`"private"` only when the map carries an explicit signal, else `null`.
158
+ `geo_precision` is `osm_node` (a surveyed point) or `osm_centroid` (a building
159
+ outline's centre). `wilaya_code` joins to GeoAlgeria's `wilaya_code`.
160
+
161
+ > **Commune/wilaya linkage is derived, not from the source.** OpenStreetMap does
162
+ > not carry Algerian administrative codes. GeoAlgeria attaches `wilaya_code`,
163
+ > `commune_code`, and `commune` by a **nearest-centroid join** against the
164
+ > [`geoalgeria`](https://www.npmjs.com/package/geoalgeria) commune set. Wilaya
165
+ > assignment is effectively exact; commune is best-effort (centroid proximity,
166
+ > not polygon containment).
167
+
168
+ ## Need the administrative divisions too?
169
+
170
+ For wilayas, dairas, and communes, use the main
171
+ **[`geoalgeria`](https://www.npmjs.com/package/geoalgeria)** package — it's how
172
+ you turn a school's `commune_code` into a polygon or centroid. Use
173
+ `@geoalgeria/ecoles` when you *only* need the schools.
174
+
175
+ ## Source & method
176
+
177
+ Run `npm run fetch` to regenerate every output. It:
178
+
179
+ 1. queries **OpenStreetMap** (Overpass) for `amenity=school` and
180
+ `amenity=kindergarten` inside Algeria;
181
+ 2. **classifies the cycle** from `isced:level` and the French/Arabic name;
182
+ 3. de-duplicates the same school mapped as both a node and a building;
183
+ 4. attaches commune/wilaya by nearest commune centroid.
184
+
185
+ Raw source pulls are cached under
186
+ [`research/ecoles/`](https://github.com/yasserstudio/geoalgeria/tree/main/research/ecoles).
187
+
188
+ ## License & attribution
189
+
190
+ Package **code** is [MIT](LICENSE). The **data** is from **OpenStreetMap** —
191
+ **© OpenStreetMap contributors**, licensed under the
192
+ **[ODbL 1.0](https://www.openstreetmap.org/copyright)**. If you use or
193
+ redistribute this dataset, you must **attribute OpenStreetMap contributors** and
194
+ keep derived databases under a compatible license.
195
+
196
+ Verify against official sources for authoritative information. This dataset is
197
+ provided for reference and to power [GeoAlgeria](https://geoalgeria.com).
198
+
199
+ [API docs & field reference →](https://geoalgeria.com/data/docs/ecoles) · [Browse all packages →](https://geoalgeria.com/data)
200
+
201
+ ---
202
+
203
+ Made by [Yasser's Studio](https://yasser.studio) · [LinkedIn](https://www.linkedin.com/in/yasserberrehail/) · [X](https://x.com/yassersstudio) · [hello@yasser.studio](mailto:hello@yasser.studio)