unsprawl.providers.data.us.ca.sf.datasf_provider

Attributes

Classes

SFRaster

DataSFProvider

Provider for San Francisco mobility vector fields (network-first, synthetic

Functions

Module Contents

BBox
_default_data_root()[source]
class SFRaster[source]
lon: ndarray[tuple[int, int], dtype[numpy.float32]]
lat: ndarray[tuple[int, int], dtype[numpy.float32]]
u: ndarray[tuple[int, int], dtype[numpy.float32]]
v: ndarray[tuple[int, int], dtype[numpy.float32]]
class DataSFProvider[source]

Provider for San Francisco mobility vector fields (network-first, synthetic fallback).

No token required. If DATASF_TOKEN is set, it will be used, but we always fall back to a no-token public path with rate-limit awareness.

data_root: Path
property cache_dir: Path
_ensure_cache()[source]
fetch_road_vectors(*, force=False)[source]

Fetch simplified road vectors with speed estimates.

Returns columns: lon1, lat1, lon2, lat2, speed_mps Network-first; synthetic fallback on error.

_synthetic_roads()[source]
rasterize(bbox, res=128)[source]

Rasterize road vectors into an Eulerian grid over bbox.

We aggregate segment directions into a (u,v) field using simple binning.