Providers#
easysnowdata.providers#
Thin, generic adapters over the access libraries — no snow knowledge here.
stac— pystac-client + odc-stac (Planetary Computer, Earth Search, CMR-STAC)opentopography— OpenTopography’s static STAC catalog of public COGs (no search API; tiles picked by asset bbox)earthdata— earthaccess search / open / downloadgee— Earth Engine via xee at the native gridplanet— Planet Data and Orders APIs via theplanetSDKraster_http— COGs and zipped GeoTIFFs over HTTPS, with a pooch cachezarr_cloud— anonymous cloud Zarr storesvector_http— remote GDB / GeoJSON / GeoParquet with bbox or mask pushdowntable_http— small text tables (climate-index files) over HTTPS, re-fetched when the cached copy is a day old
Every read happens inside easysnowdata._gdal.gdal_env() (and the auth
providers’ env()); nothing here configures GDAL, xarray or “today” at
import time (§2.9).
Apply GDAL options for the duration of the block (and to lazy reads). |
easysnowdata.providers.stac#
STAC search and load: pystac-client for search, odc-stac for lazy loading.
Open a STAC API by name ( |
|
Search a STAC API and return a |
|
Items → GeoDataFrame (EPSG:4326) with |
|
Rebuild |
|
Lazily load STAC items into an |
|
|
|
GDAL + credential environment for reading assets found in catalog. |
easysnowdata.providers.earthdata#
NASA Earthdata via earthaccess: search, open, download (cached).
Log in (once) and return the |
|
GDAL environment for |
|
|
|
Granules → GeoDataFrame: |
|
|
|
|
|
Download one file from a server that refuses a bearer token. |
|
Whether url is on the Earthdata Login host (a request that ended at the login page). |
|
Whether this GDAL build can read HDF4 (HDF-EOS2) files. |
|
Fail fast when product is HDF4 and GDAL has no HDF4 driver. |
easysnowdata.providers.gee#
Google Earth Engine via xee: open at the native grid, features → GeoDataFrame.
import ee and import xee are deferred so a broken Google auth stack
cannot break import easysnowdata. Earth Engine is initialised once through
easysnowdata.auth; Dask workers re-initialise themselves through
ee_init_if_necessary / ee_init_kwargs.
Initialise Earth Engine once (see the |
|
Return the initialised |
|
Pixel-grid kwargs for |
|
|
|
An |
|
An |
easysnowdata.providers.opentopography#
OpenTopography’s raster catalog: a static STAC catalog of public COGs.
OpenTopography publishes its whole raster library — the global DEMs and the
community lidar surveys — as a static STAC 1.1 catalog
(CATALOG_URL), with the tiles as anonymous Cloud Optimized GeoTIFFs
on SDSC’s S3-compatible store (BUCKET_URL). No account, no signing.
It is not a STAC API: there is no /search endpoint, so
pystac-client cannot query it. Each dataset is one collection holding
one item per product level (COP30_hh, SRTM_GL1_srtm,
NASADEM_be), and every tile of that dataset is an asset of the one
item, with its own bbox. The Copernicus GLO-30 item is 12 MB of JSON
with about 26 000 assets. search() therefore downloads the item once
into the cache (re-fetched after MAX_AGE), picks the assets whose
bbox meets the AOI, and turns each into a pystac.Item that
odc-stac can load. The assets carry no proj: metadata, so the grid
of each selected tile is read from its COG header (one small range request
per tile, in parallel).
Two more quirks worth knowing: an item’s datetime is when OpenTopography
processed the dataset, not when it was acquired, so the items built here
take their dates from the collection’s temporal extent instead; and each
item also lists a <item>.vrt mosaic of all its tiles (11 MB for
Copernicus), which this module does not use.
The collection an item belongs to: |
|
URL of the collection JSON for a short name such as |
|
URL of the item JSON for an id such as |
|
The collection JSON for a short name ( |
|
The item JSON for an id ( |
|
The data assets of item_id whose |
|
The tiles of item_id covering aoi as a |
easysnowdata.providers.planet#
Planet Labs via the planet SDK 3.x: Data API search, Orders API delivery.
Thin and generic, like the other providers: it knows how to talk to Planet,
not what PlanetScope is. The snow knowledge lives in
easysnowdata.optical.planetscope.
Everything goes through one planet.Planet client built by the planet
auth provider (easysnowdata.auth.planet), which delegates credential
detection and login to the SDK’s own stack. Nothing here configures GDAL: the
APIs hand out signed download URLs.
Quota. A Data API search is free. Activating a Data API asset charges
the whole scene against the account’s quota, and an order charges the
clipped area, which is why create_order() refuses to run without an AOI
and why ordering is never part of a test.
Return the process-wide |
|
Alias of |
|
Return the imported |
|
Build a Data API |
|
Run a Data API quick-search and return the items as dicts (free). |
|
Data API items → GeoDataFrame with |
|
One |
|
Create an Orders API order clipped to aoi, and return the order dict. |
|
Return the newest order called name (in state, if given), or |
|
Block until an order reaches a final state and return that state. |
|
Download a finished order into the easysnowdata cache and return the paths. |
|
Return a signed download URL for one asset of one scene. |
easysnowdata.providers.raster_http#
COGs and zipped GeoTIFFs over HTTPS (rioxarray), plus a pooch download cache.
easysnowdata.providers.zarr_cloud#
Anonymous cloud Zarr stores (GCS, S3, Azure, HTTPS) with xarray.
Anonymous-access |
|
|
|
Subset a global lat/lon dataset to an AOI and time range. |
easysnowdata.providers.vector_http#
Remote vectors (GDB, GeoJSON, zipped shapefiles, GeoParquet) with pyogrio pushdown.
|
|
|
|
GDAL/fiona-style zip path: |
easysnowdata.providers.table_http#
Small text tables over HTTPS (climate-index files), cached with pooch.
The files are a few kilobytes and are republished in place every month, so they are downloaded whole with a plain GET and re-fetched once the cached copy is older than max_age. Parsing is the product module’s job; this layer only moves bytes, like the other providers.
Download url into the cache and return the local path. |