Skip to content

Data providers

geoscales ships integration code, not data. Natural Earth is the default provider; its source and scale are recorded on the object, and no boundaries are bundled.

get_geoscale_provider

get_geoscale_provider(name: str) -> dict

register_geoscale_provider

register_geoscale_provider(
    name: str,
    fetch: Callable[..., Any],
    geoframes: Sequence[str] | None = None,
    weights: Sequence[str] | None = None,
    desc: str = "",
) -> dict

list_geoscale_providers

list_geoscale_providers() -> pa.Table

ne_source

ne_source(
    scale: int = 110,
    geoframe: str = "country",
    country: str | Sequence[str] | None = None,
    path: str | None = None,
)

Natural Earth admin-0 ("country") or admin-1 ("states") features as a GeoDataFrame, with feature and country columns (adm0_a3/adm1_code, "-99" as missing). path reads a local shapefile/zip instead of the cached download.

ne_geoscale

ne_geoscale(
    scale: int = 110,
    geoframes: Sequence[str] = (
        "continent",
        "subregion",
        "country",
        "feature",
    ),
    weights: Sequence[str] = ("pop_est", "gdp_md"),
    geometry: bool = True,
    **kwargs: Any,
) -> GeoScale

The Natural Earth admin-0 hierarchy as a GeoScale.