FRED#
fetchez.fred#
Fetches Remote Elevation Datalist (FRED)
Handles the indexing, storage, and spatial querying of remote datasets that lack a public API but provide file lists (e.g., NCEI Thredds, USACE).
- copyright:
2010 - 2026 Regents of the University of Colorado
- license:
MIT, see LICENSE for more details.
- class fetchez.fred.FRED(name='FRED', local=False)[source]#
Bases:
objectFRED (Fetches Remote Elevation Datalist) manages a local GeoJSON-based index of remote files. It allows spatial queries to determine which files to download.
- SCHEMA = ['Name', 'ID', 'Date', 'Agency', 'MetadataLink', 'MetadataDate', 'DataLink', 'IndexLink', 'Link', 'DataType', 'DataSource', 'Resolution', 'HorizontalDatum', 'VerticalDatum', 'LastUpdate', 'Etcetra', 'Info']#
- add_survey(geom, **kwargs)[source]#
Add a single survey entry to the FRED database.
- Parameters:
geom (Dict) – GeoJSON geometry dictionary (e.g., {‘type’: ‘Polygon’, ‘coordinates’: …})
**kwargs – Attributes matching the schema.
- search(region=None, where=[], layer=None)[source]#
Search for data in the reference vector file.
- Parameters:
region (
Optional[Tuple[float,float,float,float]], default:None) – Tuple (xmin, xmax, ymin, ymax) from spatial.parse_regionwhere (
List[str], default:[]) – List of simple SQL-style filters (e.g. “Agency = ‘NOAA’”) (Currently supports simple equality checks for simplicity without SQL parser)layer (
Optional[str], default:None) – Filter by ‘DataSource’ field (e.g., ‘ncei_thredds’)
- Returns:
List[Dict] – List of dictionaries containing the properties of matching features.