Skip to content

pycensus.census.countries.israel.arcgis

Thin, generic client for the public ArcGIS REST "FeatureServer/query" API.

Technical aspects

Every real Israel data source wired up in this package (CBS's own hosted ArcGIS Online services, and the Israel Planning Administration's iplan.gov.il ArcGIS Server) speaks the same Esri REST query protocol. This module implements just the subset needed here: paginated attribute+geometry queries, returned already reprojected to EPSG:4326 (via the server-side outSR parameter, verified to work against both hosts), and conversion of Esri JSON geometry to Shapely.

None of the endpoints used by this package require an API key or authentication token -- confirmed by live, unauthenticated queries against both hosts on 2026-08-19.

query_features(url, where='1=1', out_fields='*', return_geometry=True, page_size=1000)

Fetch every feature matching where from an ArcGIS FeatureServer layer.

Handles pagination transparently via resultOffset/resultRecordCount so callers never see exceededTransferLimit truncation.

Parameters:

Name Type Description Default
url str

Full FeatureServer layer URL (e.g. ".../FeatureServer/0").

required
where str

SQL WHERE clause (default "1=1", i.e. everything).

'1=1'
out_fields str

Comma-separated field list, or "*".

'*'
return_geometry bool

Whether to request geometry (reprojected to EPSG:4326 server-side via outSR).

True
page_size int

Records requested per page.

1000

Returns:

Type Description
List[dict]

List of raw Esri JSON feature dicts (``{"attributes": {...},

List[dict]

"geometry": {...}}``).

Raises:

Type Description
HTTPError

If any page request fails.

RuntimeError

If the server returns an error payload.

features_to_geodataframe(features)

Convert raw Esri JSON features (from :func:query_features) to a GeoDataFrame.

Parameters:

Name Type Description Default
features List[dict]

Feature list as returned by :func:query_features.

required

Returns:

Type Description
GeoDataFrame

GeoDataFrame in EPSG:4326 with one column per attribute plus

GeoDataFrame

geometry. Empty (zero-row, no geometry column) if features

GeoDataFrame

is empty.