@geoalgeria/agriculture 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 +21 -0
- package/README.ar.md +93 -0
- package/README.fr.md +93 -0
- package/README.md +111 -0
- package/data/agriculture.json +5098 -0
- package/data/csv/agriculture.csv +197 -0
- package/data/geojson/agriculture.geojson +1 -0
- package/data/metadata.json +29 -0
- package/index.js +22 -0
- package/package.json +57 -0
- package/types/index.d.ts +116 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"source": "Ministry of Agriculture, Rural Development and Fisheries (MADR) institutional directory (madr.gov.dz / fr.madr.gov.dz), geocoded against the geoalgeria commune set",
|
|
3
|
+
"origin": "https://madr.gov.dz/contact/دليل-الهاتف/, https://fr.madr.gov.dz/contact/annuaire/",
|
|
4
|
+
"license": "MADR directory: factual public-sector listing. See README for attribution.",
|
|
5
|
+
"agriculture": 196,
|
|
6
|
+
"by_type": {
|
|
7
|
+
"centre_formation": 11,
|
|
8
|
+
"chambre_agriculture": 49,
|
|
9
|
+
"conservation_forets": 48,
|
|
10
|
+
"dsa": 58,
|
|
11
|
+
"groupe_public": 10,
|
|
12
|
+
"institut_recherche": 16,
|
|
13
|
+
"office_public": 4
|
|
14
|
+
},
|
|
15
|
+
"by_sector": {
|
|
16
|
+
"public": 196
|
|
17
|
+
},
|
|
18
|
+
"by_geo_precision": {
|
|
19
|
+
"wikidata_point": 0,
|
|
20
|
+
"commune_centroid": 89,
|
|
21
|
+
"wilaya_centroid": 107,
|
|
22
|
+
"none": 0
|
|
23
|
+
},
|
|
24
|
+
"wilayas_covered": 58,
|
|
25
|
+
"geocoded": 196,
|
|
26
|
+
"linkage_note": "Names + wilaya + address + phone/fax are from the MADR directory, which carries no coordinates. Commune is matched from the address against the geoalgeria commune set within the wilaya; coordinates are that commune's centroid, or the wilaya chief-town centroid when the address has no recognizable commune (see geo_precision).",
|
|
27
|
+
"coverage_note": "196 agriculture-sector institutions across 7 MADR networks (DSA, Conservations des Forêts, technical/research institutes, training centres, Chambres d'Agriculture, public offices, public groups). DSA covers all 58 wilayas; Conservations des Forêts and Chambres use the pre-2019 48-wilaya division. Names + wilaya are official; coordinates are best-effort (mostly commune/wilaya centroid).",
|
|
28
|
+
"generated_at": "2026-06-30"
|
|
29
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// @geoalgeria/agriculture — lightweight loaders for Algeria's agriculture-sector institutions.
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { dirname, join } from "node:path";
|
|
5
|
+
|
|
6
|
+
const DATA = join(dirname(fileURLToPath(import.meta.url)), "data");
|
|
7
|
+
const load = (p) => JSON.parse(readFileSync(join(DATA, p), "utf-8"));
|
|
8
|
+
|
|
9
|
+
export const agriculture = () => load("agriculture.json"); // MADR institutional directory, geocoded
|
|
10
|
+
export const institutionById = (id) =>
|
|
11
|
+
agriculture().find((r) => r.id === String(id)) ?? null;
|
|
12
|
+
export const institutionsByWilaya = (code) => {
|
|
13
|
+
const w = String(code).padStart(2, "0");
|
|
14
|
+
return agriculture().filter((r) => r.wilaya_code === w);
|
|
15
|
+
};
|
|
16
|
+
export const institutionsByType = (type) => {
|
|
17
|
+
const t = String(type).toLowerCase();
|
|
18
|
+
return agriculture().filter((r) => r.type === t);
|
|
19
|
+
};
|
|
20
|
+
export const metadata = () => load("metadata.json");
|
|
21
|
+
|
|
22
|
+
export default { agriculture, institutionById, institutionsByWilaya, institutionsByType, metadata };
|
package/package.json
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@geoalgeria/agriculture",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Agriculture-sector institutions of Algeria — agricultural-services directorates (DSA), forest conservations, technical & research institutes, training centres, chambers of agriculture, public offices and groups from the Ministry of Agriculture (MADR), bilingual FR/AR, geocoded against the geoalgeria commune set with wilaya/commune linkage. JSON, CSV, GeoJSON, TypeScript.",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"types": "types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./types/index.d.ts",
|
|
11
|
+
"default": "./index.js"
|
|
12
|
+
},
|
|
13
|
+
"./data/*": "./data/*"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"data/**/*.json",
|
|
17
|
+
"data/**/*.csv",
|
|
18
|
+
"data/**/*.geojson",
|
|
19
|
+
"types/",
|
|
20
|
+
"index.js"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"test": "node ../../scripts/validate-packages.mjs agriculture"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"algeria",
|
|
27
|
+
"agriculture",
|
|
28
|
+
"madr",
|
|
29
|
+
"dsa",
|
|
30
|
+
"forets",
|
|
31
|
+
"chambre-agriculture",
|
|
32
|
+
"inraa",
|
|
33
|
+
"itgc",
|
|
34
|
+
"ministry-of-agriculture",
|
|
35
|
+
"rural-development",
|
|
36
|
+
"geojson",
|
|
37
|
+
"geoalgeria",
|
|
38
|
+
"dz"
|
|
39
|
+
],
|
|
40
|
+
"author": "Yasser's Studio (https://yasser.studio)",
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
44
|
+
},
|
|
45
|
+
"bugs": {
|
|
46
|
+
"url": "https://github.com/yasserstudio/geoalgeria/issues"
|
|
47
|
+
},
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "git+https://github.com/yasserstudio/geoalgeria.git",
|
|
51
|
+
"directory": "packages/agriculture"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://geoalgeria.com",
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=18"
|
|
56
|
+
}
|
|
57
|
+
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// Type definitions for @geoalgeria/agriculture
|
|
2
|
+
// Agriculture-sector institutions of Algeria — the Ministry of Agriculture,
|
|
3
|
+
// Rural Development and Fisheries (MADR) institutional directory, geocoded
|
|
4
|
+
// against the geoalgeria commune set.
|
|
5
|
+
|
|
6
|
+
/** Institution network / category. */
|
|
7
|
+
export type AgricultureType =
|
|
8
|
+
| "dsa"
|
|
9
|
+
| "conservation_forets"
|
|
10
|
+
| "institut_recherche"
|
|
11
|
+
| "centre_formation"
|
|
12
|
+
| "chambre_agriculture"
|
|
13
|
+
| "office_public"
|
|
14
|
+
| "groupe_public";
|
|
15
|
+
|
|
16
|
+
/** Ownership sector (the MADR directory is entirely public-sector). */
|
|
17
|
+
export type AgricultureSector = "public";
|
|
18
|
+
|
|
19
|
+
/** Where the record's identity came from, plus which geo sources contributed a precise point. */
|
|
20
|
+
export type AgricultureSource = "madr" | "madr+wikidata";
|
|
21
|
+
|
|
22
|
+
/** How the coordinates were obtained. */
|
|
23
|
+
export type GeoPrecision =
|
|
24
|
+
| "wikidata_point"
|
|
25
|
+
| "commune_centroid"
|
|
26
|
+
| "wilaya_centroid"
|
|
27
|
+
| "none";
|
|
28
|
+
|
|
29
|
+
/** An agriculture-sector institution. */
|
|
30
|
+
export interface AgricultureInstitution {
|
|
31
|
+
/** Stable id, `{wilaya_code}-{type}-{seq}` (e.g. "16-office_public-01"). */
|
|
32
|
+
id: string;
|
|
33
|
+
/** Best available display name (French preferred, else Arabic). */
|
|
34
|
+
name: string;
|
|
35
|
+
/** Arabic name, or null. */
|
|
36
|
+
name_ar: string | null;
|
|
37
|
+
/** French name, or null (most named entities are Arabic-only at source). */
|
|
38
|
+
name_fr: string | null;
|
|
39
|
+
/** Institution network / category. */
|
|
40
|
+
type: AgricultureType;
|
|
41
|
+
/** Canonical French label for the type. */
|
|
42
|
+
type_label_fr: string;
|
|
43
|
+
/** Canonical Arabic label for the type. */
|
|
44
|
+
type_label_ar: string;
|
|
45
|
+
/** Ownership sector (always "public" for the MADR directory). */
|
|
46
|
+
sector: AgricultureSector;
|
|
47
|
+
/** Latin abbreviation (e.g. "INRAA", "OAIC", "ITMAS Alger"), or null. */
|
|
48
|
+
abbreviation: string | null;
|
|
49
|
+
/** Wilaya name (French). */
|
|
50
|
+
wilaya: string;
|
|
51
|
+
/** Wilaya name (Arabic). */
|
|
52
|
+
wilaya_ar: string;
|
|
53
|
+
/** Wilaya code as a zero-padded string ("01".."58"). */
|
|
54
|
+
wilaya_code: string;
|
|
55
|
+
/** Commune name (French), best-effort from the address. Null when unresolved. */
|
|
56
|
+
commune: string | null;
|
|
57
|
+
/** Commune code (geoalgeria code_commune), best-effort. Null when unresolved. */
|
|
58
|
+
commune_code: number | null;
|
|
59
|
+
/** Latitude (commune/wilaya centroid, or a precise point). */
|
|
60
|
+
lat: number | null;
|
|
61
|
+
/** Longitude (commune/wilaya centroid, or a precise point). */
|
|
62
|
+
lng: number | null;
|
|
63
|
+
/** Street address (Arabic) as listed in the directory, or null. */
|
|
64
|
+
address: string | null;
|
|
65
|
+
/** Phone number (digits), or null. */
|
|
66
|
+
phone: string | null;
|
|
67
|
+
/** Fax number (digits), or null. */
|
|
68
|
+
fax: string | null;
|
|
69
|
+
/** Provenance: MADR directory, plus Wikidata where a precise point matched. */
|
|
70
|
+
source: AgricultureSource;
|
|
71
|
+
/** How `lat`/`lng` were obtained. */
|
|
72
|
+
geo_precision: GeoPrecision;
|
|
73
|
+
/** Wikidata QID when a Wikidata entity matched, else null. */
|
|
74
|
+
wikidata: string | null;
|
|
75
|
+
/** OSM element id (e.g. "node/123") when an OSM entity matched, else null. */
|
|
76
|
+
osm_id: string | null;
|
|
77
|
+
/** URL slug. */
|
|
78
|
+
slug: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Dataset metadata (data/metadata.json). */
|
|
82
|
+
export interface Metadata {
|
|
83
|
+
source: string;
|
|
84
|
+
origin: string;
|
|
85
|
+
license: string;
|
|
86
|
+
agriculture: number;
|
|
87
|
+
by_type: Record<AgricultureType, number>;
|
|
88
|
+
by_sector: Record<AgricultureSector, number>;
|
|
89
|
+
by_geo_precision: Record<GeoPrecision, number>;
|
|
90
|
+
wilayas_covered: number;
|
|
91
|
+
geocoded: number;
|
|
92
|
+
linkage_note: string;
|
|
93
|
+
coverage_note: string;
|
|
94
|
+
/** ISO date (YYYY-MM-DD) the snapshot was generated. */
|
|
95
|
+
generated_at: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** All agriculture-sector institutions. */
|
|
99
|
+
export function agriculture(): AgricultureInstitution[];
|
|
100
|
+
/** A single institution by id, or null. */
|
|
101
|
+
export function institutionById(id: string): AgricultureInstitution | null;
|
|
102
|
+
/** Institutions in a wilaya (accepts numeric or zero-padded code). */
|
|
103
|
+
export function institutionsByWilaya(code: string | number): AgricultureInstitution[];
|
|
104
|
+
/** Institutions of a given type. */
|
|
105
|
+
export function institutionsByType(type: AgricultureType | string): AgricultureInstitution[];
|
|
106
|
+
/** Dataset metadata. */
|
|
107
|
+
export function metadata(): Metadata;
|
|
108
|
+
|
|
109
|
+
declare const _default: {
|
|
110
|
+
agriculture: typeof agriculture;
|
|
111
|
+
institutionById: typeof institutionById;
|
|
112
|
+
institutionsByWilaya: typeof institutionsByWilaya;
|
|
113
|
+
institutionsByType: typeof institutionsByType;
|
|
114
|
+
metadata: typeof metadata;
|
|
115
|
+
};
|
|
116
|
+
export default _default;
|