Core Boundaries (Detailed)
Geographic boundary management for climate data clipping.
Overview
climakitae.core.boundaries provides the Boundaries class for managing geographic regions used to subset climate data. It handles:
- Loading predefined boundaries (counties, watersheds, utilities)
- Lazy loading to minimize memory usage
- Caching of boundary geometries
- Geographic operations (clipping, spatial queries)
Note
Both legacy (climakitae.core.boundaries) and the ClimateData interface (climakitae.new_core.data_access.boundaries) implement similar functionality. New code should use the ClimateData version.
Boundaries Class
Get geospatial polygon data from the S3 stored parquet catalog. Used to access boundaries for subsetting data by state, county, etc.
Attributes:
| Name | Type | Description |
|---|---|---|
_cat |
Catalog
|
Parquet boundary catalog instance |
_us_states |
DataFrame
|
Table of US state names and geometries |
_ca_counties |
DataFrame
|
Table of California county names and geometries Sorted by county name alphabetical order |
_ca_watersheds |
DataFrame
|
Table of California watershed names and geometries Sorted by watershed name alphabetical order |
_ca_utilities |
DataFrame
|
Table of California IOUs and POUs, names and geometries |
_ca_forecast_zones |
DataFrame
|
Table of California Demand Forecast Zones |
_ca_electric_balancing_areas |
DataFrame
|
Table of Electric Balancing Areas |
Methods:
| Name | Description |
|---|---|
_get_us_states |
Returns a dict of state abbreviations and indices |
_get_ca_counties |
Returns a dict of California counties and their indices |
_get_ca_watersheds |
Returns a dict for CA watersheds and their indices |
_get_forecast_zones |
Returns a dict for CA electricity demand forecast zones |
_get_ious_pous |
Returns a dict for CA electric load serving entities IOUs & POUs |
_get_electric_balancing_areas |
Returns a dict for CA Electric Balancing Authority Areas |
Source code in climakitae/core/boundaries.py
load()
Read parquet files and sets class attributes.
Source code in climakitae/core/boundaries.py
boundary_dict()
Return a dict of the other boundary dicts, used to populate ck.Select.
This returns a dictionary of lookup dictionaries for each set of
geoparquet files that the user might be choosing from. It is used to
populate the DataParameters cached_area dynamically as the category
in the area_subset parameter changes.
Returns:
| Type | Description |
|---|---|
dict
|
|
Source code in climakitae/core/boundaries.py
Available Boundary Types
The Boundaries class provides access to several predefined boundary catalogs:
- US States — Western US states
- CA Counties — All 58 California counties
- CA Watersheds — HUC8-level watersheds in California
- CA Utilities — Investor-owned utilities (IOUs) and publicly-owned utilities (POUs)
- CA Electric Zones — Electricity demand forecast zones
- CA Balancing Authorities — Electric balancing authority areas
- CA Census Tracts — Census tract boundaries
Usage Example
from climakitae.core.boundaries import Boundaries
# Initialize boundary loader
boundaries = Boundaries()
# Get available counties
counties = boundaries.available_counties()
# Get geometry for specific county
la_geom = boundaries.get_geometry("Los Angeles")
# Multiple regions (union)
multi_geom = boundaries.get_geometry(["Alameda", "Contra Costa"])