Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.

Location Summary

Kelvin edited this page Oct 28, 2020 · 19 revisions

Location Summary Method

location.get_summary(
    search_items, 
    location_type, 
    csv=False, 
    output_dir='/output'
)

Returns an array of LocationSummary product for the given IDs and location_type. Optionally creates a csv file

(More information on the Location product can be found on the Location Summary Page on the First Street Foundation API Data Dictionary)

Arguments:

  • search_items: list/file of SearchItems, parcels to retrieve location summary for.
  • location_type: string, one of {property, neighborhood, city, zcta, tract, county, cd, state}, for the search item type.
  • csv: bool, whether to create a CSV for the retrieved data.
  • output_dir: string, location to output the created CSV (if csv is True).

Example (Command Line):

# Call location.get_summary on a list with 3 property FSIDs
python -m firststreet -p location.get_summary -i 511447411;511447412;511447413 -l property

# Call location.get_summary on a list with 1 state FSID
python -m firststreet -p location.get_summary -i 19 -l state

# Call location.get_summary on a file of SearchItems
python -m firststreet -p location.get_summary -f sample.txt -l property

Example (Python File):

# Contents of sample.py
# Create a `FirstStreet` object.  
import firststreet
fs = firststreet.FirstStreet("api-key")

# Call location.get_summary on a list with 3 property FSIDs
location_summary = fs.location.get_summary([511447411, 511447412, 511447413], "property")

# Call location.get_summary on a list with 1 state FSID
location_summary = fs.location.get_summary([19], "state")

# Call location.get_summary on a file of SearchItems
location_summary = fs.location.get_summary("sample.txt", "property", csv=True)

Location Summary Objects

Location Summary (Property Location Type)

Key Type Description Example
fsid int First Street ID (FSID) is a unique identifier assigned to each location. 392804911
floodFactor int The property's Flood Factor, a numeric integer from 1-10 (where 1 = minimal and 10 = extreme) based on flooding risk to the building footprint. Flood risk is defined as a combination of cumulative risk over 30 years and flood depth. Flood depth is calculated at the lowest elevation of the building footprint (largest if more than 1 exists, or property centroid where footprint does not exist). 5
riskDirection int The location's risk direction represented in a numeric value based on the change in risk for the location from 2020 to 2050 for the climate model realization of the RCP 4.5 mid emissions scenario. -1 = decreasing 0 = stationary 1 = increasing 1
historic int The total count of modeled historic events that inundated the location. Inundation is defined as having flood depth >0 for property queries or >1 property with >0 flood depth for higher-level locations. Flood depth is calculated at the lowest elevation of the building footprint (largest if more than 1 exists, or property centroid where footprint does not exist). 1
environmentalRisk int Denotes what environmental risks impact the location represented in a numeric value. 1 = precipitation 2 = precipitation and sea level rise 3 = precipitation, sea level rise and hurricane storm surge Coastal areas on the East Coast and Hawaii will return 3, other coastal areas will return 2 and all other locations will return 1. 1
adaptation int The total count of mapped adaptation projects where the area served for the project overlaps any area of the location. 2

Location Summary (Excluding Property Location Type)

Key Type Description Example
fsid int First Street ID (FSID) is a unique identifier assigned to each location. 19
riskDirection int The location's risk direction represented in a numeric value based on the change in risk for the location from 2020 to 2050 for the climate model realization of the RCP 4.5 mid emissions scenario. -1 = decreasing 0 = stationary 1 = increasing 1
historic int The total count of modeled historic events that inundated the location. Inundation is defined as having flood depth >0 for property queries or >1 property with >0 flood depth for higher-level locations. Flood depth is calculated at the lowest elevation of the building footprint (largest if more than 1 exists, or property centroid where footprint does not exist). 5
environmentalRisk int Denotes what environmental risks impact the location represented in a numeric value. 1 = precipitation 2 = precipitation and sea level rise 3 = precipitation, sea level rise and hurricane storm surge Coastal areas on the East Coast and Hawaii will return 3, other coastal areas will return 2 and all other locations will return 1. 1
adaptation int The total count of mapped adaptation projects where the area served for the project overlaps any area of the location. 184
properties object Total count of properties as a [PropertyCount] including the total count of properties within the location boundary and the properties at risk where risk is having a Flood Factor of 2 or higher. (Location Query Type: all excluding Property) {'total': 2423036, 'atRisk': 391150}

Clone this wiki locally