@il-address/data
v1.0.2
Published
Israeli city and street data for @il-address/core
Readme
@il-address/data
Israeli city and street data for @il-address/core. Typically installed automatically as a transitive dependency — you usually don't import this package directly.
Data is sourced from the official data.gov.il CKAN API (Population & Immigration Authority / רשות האוכלוסין וההגירה).
Official sources
| Dataset | CKAN resource ID | Approx. size |
|---------|------------------|--------------|
| Cities (ישובים) | 8f714b6f-c35c-4b40-a0e7-547b675eee0e | ~1,310 records |
| Streets + synonyms (רחובות עם שמות נרדפים) | bf185c7f-1a4e-4662-88c5-fa118a244bda | ~152k raw rows → ~63k unique streets |
City count in cities.json and “cities with streets” in the build log can differ by a few codes: the streets file sometimes lists a locality (small farm / settlement) that isn’t in the official ישובים list. City autocomplete uses cities.json only; orphan street files may still exist under generated/streets/{cityCode}.json. The build prints any orphan codes (with names from the streets file) when that happens.
Fetched via:
GET https://data.gov.il/api/3/action/datastore_search?resource_id=<id>No API key required. See data.gov.il for the full catalog.
Fetches use paginated datastore_search (32k page size — CKAN’s cap) with User-Agent: datagov-external-client, retries (404/429/502/503/504 + network errors, exponential backoff), and a short delay between pages. Cloud CI IPs sometimes get edge/WAF 404s on the same URL that works in a browser; fewer pages + the community UA reduces that.
Contents (published)
| Path | Description |
|------|-------------|
| generated/cities.json | All cities (~1,300) |
| generated/streets/{cityCode}.json | Streets for one city |
| generated/street-loader.js | Lazy loader map (cityCode → import(...)) |
| manifest.json | CKAN lastModified, record counts, build timestamp |
| CHANGELOG.md | Append-only log of what each sync changed (cities/streets) |
Data shapes
Raw CKAN — cities
What we download into raw/cities.json (gitignored):
{
_id: number;
city_code: number;
city_name_he: string;
city_name_en: string;
region_code: number;
region_name: string;
PIBA_bureau_code: number;
PIBA_bureau_name: string;
Regional_Council_code: number;
Regional_Council_name: string | null;
}Raw CKAN — streets
What we download into raw/streets.json (gitignored). Each street can appear multiple times — once as official, plus synonym rows:
{
_id: number;
region_code: number;
region_name: string;
city_code: number;
city_name: string;
street_code: string;
street_name: string;
street_name_status: string; // e.g. "official" | "synonym of 100"
official_code: number;
}Built — cities (generated/cities.json)
{
code: number; // city_code
nameHe: string; // city_name_he
nameEn: string | null; // city_name_en
regionCode: number;
regionName: string;
}Built — streets (generated/streets/{cityCode}.json)
Official name + aliases collapsed into one record per official_code:
{
code: number; // official_code
nameHe: string; // official street name
aliases: string[]; // synonym spellings (excluding the official name)
}Example:
{
"code": 100,
"nameHe": "דיזנגוף",
"aliases": ["דיזינגוף"]
}Manifest (manifest.json)
{
sources: {
cities: { resourceId: string; lastModified: string; recordCount: number };
streets: { resourceId: string; lastModified: string; recordCount: number };
};
built: {
cityCount: number;
uniqueStreetCount: number;
rawStreetRecordCount: number;
streetCountByCity: Record<string, number>;
generatedAt: string; // ISO timestamp of last content write
generatedAtDate: string; // DD-MM-YYYY — last gov.il data change (README badge)
};
}sources.*.lastModified comes from the government CKAN metadata (when gov.il last touched the resource). built.generatedAt / generatedAtDate are when we last synced changed city/street content from gov.il into generated/ (the last gov.il change badge shows generatedAtDate). Rebuilds that only see a newer CKAN lastModified (same records) do not rewrite files, so the weekly sync does not open empty PRs. The cities / streets badges read counts from manifest.json on main.
When content does change, the build appends a dated section to CHANGELOG.md and writes a gitignored sync-summary.md used as the automated PR body (cities added/removed, street-file coverage, count deltas).
Transform notes
- City/street strings are trimmed; empty Hebrew names are dropped
- Street rows with status starting with
officialbecomenameHe; other statuses becomealiases - Streets are grouped by
city_code+official_code, then written one JSON file per city - Cities and streets are sorted Hebrew-locale (
he)
Rebuild
pnpm data:sync # fetch from CKAN + build
pnpm data:build # rebuild from packages/data/raw/
pnpm data:validate # compare local counts against live CKANBring your own JSON
Drop files in packages/data/raw/:
cities.json— seeraw/cities.json.examplestreets.json— seeraw/streets.json.example
Then run pnpm data:build.
License
MIT — underlying geographic names are public data from data.gov.il.
