brails.scrapers.fema_firm_scraper.fema_firm_scraper module

Class for scraping FEMA FIRM infomation for inidividual assets in an inventory.

FEMAFIRMScraper([input_dict])

A class for scraping and processing National Tunnel Inventory (NTI) data.

class brails.scrapers.fema_firm_scraper.fema_firm_scraper.FEMAFIRMScraper(input_dict=None)

Bases: AssetDataAugmenter

A class for scraping and processing National Tunnel Inventory (NTI) data.

The class handles tasks such as fetching and processing tunnel data, meshing the region into smaller cells for efficient data retrieval, and organizing the results into an AssetInventory.

Parameters:
  • units (str) – The length unit to use (default is ‘ft’).

  • requested_attributes (List[str]) – List of attributes selected for output.

  • inventory (AssetInventory) – An inventory object holding the assets for this instance.

static get_available_attributes()

Retrieve the list of available attribute names from the API layer.

This method fetches all field names currently defined in the dataset at the configured API endpoint.

Returns:

A list of attribute names provided by the API.

Return type:

List[str]

Example

>>> from brails import Importer
>>> importer = Importer()
>>>
>>> firm_Scraper = importer.get_class(FEMAFIRMScraper)
>>> attributes = firm_Scraper.get_available_attributes()
>>> print(attributes[:5])
['OBJECTID', 'NAME', 'ZONE', 'FLOOD_RISK', 'ELEVATION']
populate_feature(input_inventory)

Populate each asset in inventory with relevant FEMA FIRM attributes.

This method:
  • Computes the bounding box of the assets in the inventory.

  • Downloads the FIRM data for the bounding box.

  • Processes the data and assigns requested attributes to each asset.

Parameters:

input_inventory (AssetInventory) – An inventory of assets to augment with FEMA FIRM data.

Returns:

The updated AssetInventory with FEMA FIRM attributes added.

Return type:

AssetInventory

Raises:

TypeError – If input_inventory is not an instance of AssetInventory.