Skip to content

pycensus.census.countries.israel.cbs.loader

Loader for CBS Census 2022 locality-level data, returning a common-schema GeoDataFrame.

Technical aspects

Mirrors :mod:pycensus.mexico.inegi.loader's shape: reads as much as possible from pyCensus' parquet cache (:mod:pycensus.cache), fetching only the logical columns actually missing, per region (here: per CBS locality). Attribute data comes from a real, live, unauthenticated ArcGIS FeatureServer query (:data:pycensus.israel.constants.CENSUS_SETL_2022_URL, verified 2026-08-19), boundary data from :func:pycensus.israel.geography.load_boundaries.

Both locality and statistical_area have a real, verified attribute source wired up (see :mod:pycensus.israel.cbs.schema's field list -- all fields verified against a live query, e.g. SETL_CODE=9000 (Be'er Sheva) -> pop_approx=217580.0 at locality level; summing pop_approx over the 83 statistical areas with SEMEL_YISHUV=9000 gives 217,600, matching to rounding). See :data:pycensus.israel.constants.CENSUS_STAT_2022_URL's docstring for how the statistical-area source was found and verified. district/nation requests raise (no CBS attribute table at that native granularity is wired up here; aggregate up from locality/ statistical_area via :mod:geohierarchy instead, which is how every other pyCensus source handles resampling across levels).

Investigated 2026-08-22 and confirmed not to exist: any real, live-queryable geography finer than statistical_area with actual population/demographic data. Both CBS's own ArcGIS org (JcXY3lLZni6BK4El) and the general municipal-GIS org (b6zSqPB0TQc3mBgU) that hosts the מפקד_2022/socioeconomic-index layers were enumerated (FeatureServer service lists at each org's REST root); the only finer-than-statistical_area polygon layer found (שכונות / neighborhoods, on b6zSqPB0TQc3mBgU) carries only shchuna/yishuv/nyb_name codes and names -- no population, household, or demographic attribute of any kind. statistical_area is therefore this module's real ceiling for finer-than-locality geography with actual census data, not an arbitrary stopping point. (A מדד_חברתי_כלכלי_2021 -- socioeconomic index -- layer does exist on b6zSqPB0TQc3mBgU, but is keyed to 2011-vintage statistical-area codes (STAT11/YISHUV_STAT11), not the 2022 vintage used everywhere else in this module, and no verified crosswalk between the two vintages was found, so it isn't wired in.)

2026-08-22: added 11 new fields (age-by-sex medians, labour-force participation, work hours, self-employed wage, top-wage-decile share, household composition by age of resident, children-born, household parking) after confirming they're real columns on both the locality (census_2022_setl_all_2021) and statistical-area (מפקד_2022) ArcGIS layers -- verified live for Be'er Sheva (SETL_CODE=9000) and one of its statistical areas (YISHUV_STAT_2022=90000111); see tests/test_israel.py's test_real_cbs_new_fields_for_beersheba_locality/ test_real_cbs_new_fields_present_at_statistical_area_level.

Source

CBS Census 2022 (via CBS's own hosted ArcGIS layers): https://services8.arcgis.com/JcXY3lLZni6BK4El/arcgis/rest/services/ https://services.arcgis.com/b6zSqPB0TQc3mBgU/arcgis/rest/services/

load(aoi=None, localities=None, regions=None, level='locality', year='latest', api_key=None, cache_dir=None, cache=True, data_dir=None)

Load CBS Census 2022 locality-level data as a common-schema GeoDataFrame.

Parameters:

Name Type Description Default
aoi Optional[GeoDataFrame]

Area of interest. Used to auto-detect which localities to load if localities/regions isn't given, and to clip the final result.

None
localities Optional[Union[str, List[str]]]

Locality name(s) or CBS/LAMAS code(s) to load (see :func:pycensus.israel.utils.locality_code). Derived from aoi if omitted (aoi is then required).

None
regions Optional[Union[str, List[str]]]

Alias for localities, kept for interface parity with other pyCensus sources.

None
level str

Standard geometry level name. "locality" and "statistical_area" have real attribute sources wired up (see module docstring); anything else raises.

'locality'
year Union[int, str]

Vintage year, or "latest". Only 2022 is available.

'latest'
api_key Optional[str]

Not used -- every source wired up here is public and unauthenticated (verified 2026-08-19).

None
cache_dir Optional[str]

Root of pyCensus' parquet cache. Defaults to :func:pycensus.cache.default_cache_dir.

None
cache bool

If False, bypass the cache entirely -- always fetch fresh and don't persist the result.

True
data_dir Optional[str]

Not used (kept for interface parity).

None

Returns:

Type Description
GeoDataFrame

GeoDataFrame with GEOID, geometry, and one cbs_-prefixed

GeoDataFrame

column per logical column in :data:pycensus.israel.cbs.schema.SCHEMA.

Raises:

Type Description
ValueError

If neither localities/regions nor aoi is given, or level resolves to something outside :data:IMPLEMENTED_LEVELS.