The US Distance to Wild Fire
API by GeoRiskServices.com allows you to calculate the distance of a given location to the nearest U.S. watches & warnings. Whether you are using geographic coordinates (latitude and longitude) or a physical address, this API provides flexibility and precision. Here’s how to use it effectively.
API Endpoint
The API can be accessed via the following endpoint:
https://www.allthingsdev.co/apimarketplace/endpoints/geo-risk-services/67b9249d563cbd684a8bf1fc
The API accepts input as a JSON object with the following schema:
Required Parameters
The API requires one of the following sets of parameters:
- Latitude and Longitude:
lat
: Latitude (number, between -90 and 90)lon
: Longitude (number, between -180 and 180)
- Address:
address
: A string representing a physical address (e.g., “1600 Pennsylvania Ave NW, Washington, DC 20500”).
Optional Parameters
perf
: Boolean – Enables performance metrics. Default:false
.lines
: Boolean – Returns additional line information. Default:false
.anno
: Boolean – Includes annotations in the response. Default:true
.
Schema Example
{
"lat": 34.052235,
"lon": -118.243683,
"perf": true,
"lines": false,
"anno": true
}
Or using an address:
{
"address": "235 2nd St, San Francisco, CA 94105",
"perf": false,
"lines": true,
"anno": false
}
Step-by-Step Guide to Using the API
Step 1: Prepare Your Request
Choose the method of input:
- Use
lat
andlon
if you have geographic coordinates. - Use
address
if you have a street address. - use
lines
to return the geojson straight line represenation. - use
perf
to return the api and database performance metrics. - use
anno
to return the sources used in the api
Step 2: Send a POST Request
Make a POST request to the API endpoint with the prepared JSON payload. Here’s an example using curl
:
Using Latitude and Longitude:
curl --location 'https://Geo-Risk-Services.proxy-production.allthingsdev.co/usdistance2ww' \
--header 'Content-Type: application/json' \
--header 'x-apihub-key: fj1jXaBtgygVVeOXYx6F1mNcd70F00XmnLnbEvGnNr831j-t5f' \
--header 'x-apihub-host: Geo-Risk-Services.allthingsdev.co' \
--header 'x-apihub-endpoint: c85e47e3-cf48-463b-939b-3663eaf864b7' \
--header 'Content-Type: application/json' \
--data '{
"lat": 34.052235,
"lon": -118.243683,
"perf" : true,
"lines" : true,
"anno" : true
}'
Using an Address:
curl --location 'https://Geo-Risk-Services.proxy-production.allthingsdev.co/usdistance2ww' \
--header 'Content-Type: application/json' \
--header 'x-apihub-key: fj1jXaBtgygVVeOXYx6F1mNcd70F00XmnLnbEvGnNr831j-t5f' \
--header 'x-apihub-host: Geo-Risk-Services.allthingsdev.co' \
--header 'x-apihub-endpoint: c85e47e3-cf48-463b-939b-3663eaf864b7' \
--header 'Content-Type: application/json' \
--data '{
"address": "497 W Henderson Ave, Porterville, CA, 93257",
"perf": true,
"lines": true,
"anno": true,
"src_miles": 200
}'
Step 3: Interpret the Response
The API will return a JSON response. For example:
{
“status”: “success”,
“db_perf_ms”: 8853,
“api_perf_ms”: 9736,
“error”: “”,
“input_params”: {
“lat”: 37.786045080005515,
“lon”: -122.3972321615382,
“address”: “235 2nd St, San Francisco, CA 94105”,
“perf”: true,
“lines”: true,
“anno”: true
},
“results”: [
{
“src”: “CALFIRE”,
“acres”: 6.789666,
“agency”: “CDF”,
“dist_m”: 9687.11,
“dist_km”: 9.69,
“fire_yr”: “2020”,
“wf_name”: “BRUNO”,
“ln_to_wf”: {
“type”: “LineString”,
“coordinates”: [
[
-122.397232162,
37.78604508
],
[
-122.432074467,
37.703498678
]
]
},
“dist_miles”: 6.02
},
{
“src”: “CALFIRE”,
“acres”: 8.221602,
“agency”: “CDF”,
“dist_m”: 12099.78,
“dist_km”: 12.1,
“fire_yr”: “2019”,
“wf_name”: “KING”,
“ln_to_wf”: {
“type”: “LineString”,
“coordinates”: [
[
-122.397232162,
37.78604508
],
[
-122.408576532,
37.677722488
]
]
},
“dist_miles”: 7.52
},
{
“src”: “CALFIRE”,
“acres”: 28.68488,
“agency”: “CDF”,
“dist_m”: 12429.75,
“dist_km”: 12.43,
“fire_yr”: “2022”,
“wf_name”: “TOWER”,
“ln_to_wf”: {
“type”: “LineString”,
“coordinates”: [
[
-122.397232162,
37.78604508
],
[
-122.399571744,
37.674399895
]
]
},
“dist_miles”: 7.72
},
{
“src”: “NPS”,
“acres”: 55.8,
“agency”: “NPS”,
“dist_m”: 20852.45,
“dist_km”: 20.85,
“fire_yr”: “2019”,
“wf_name”: “Muir 2”,
“ln_to_wf”: {
“type”: “LineString”,
“coordinates”: [
[
-122.397232162,
37.78604508
],
[
-122.604526073,
37.875859106
]
]
},
“dist_miles”: 12.96
},
{
“src”: “CALFIRE”,
“acres”: 4.482058,
“agency”: “LRA”,
“dist_m”: 20906.81,
“dist_km”: 20.91,
“fire_yr”: “2019”,
“wf_name”: “N-05-19 North Orinda Duffle Div X”,
“ln_to_wf”: {
“type”: “LineString”,
“coordinates”: [
[
-122.397232162,
37.78604508
],
[
-122.212254727,
37.903519332
]
]
},
“dist_miles”: 12.99
},
{
“src”: “CALFIRE”,
“acres”: 4.958377,
“agency”: “LRA”,
“dist_m”: 21053.81,
“dist_km”: 21.05,
“fire_yr”: “2019”,
“wf_name”: “N-05-19 North Orinda Duffle Div A”,
“ln_to_wf”: {
“type”: “LineString”,
“coordinates”: [
[
-122.397232162,
37.78604508
],
[
-122.211198748,
37.904442273
]
]
},
“dist_miles”: 13.08
},
{
“src”: “CALFIRE”,
“acres”: 6.619492,
“agency”: “CDF”,
“dist_m”: 22899.1,
“dist_km”: 22.9,
“fire_yr”: “2017”,
“wf_name”: “SAN ANDREAS DAM FACE”,
“ln_to_wf”: {
“type”: “LineString”,
“coordinates”: [
[
-122.397232162,
37.78604508
],
[
-122.410206121,
37.580604509
]
]
},
“dist_miles”: 14.23
},
{
“src”: “CALFIRE”,
“acres”: 6.619492,
“agency”: “CDF”,
“dist_m”: 22899.59,
“dist_km”: 22.9,
“fire_yr”: “2021”,
“wf_name”: “San Andreas Dam Face”,
“ln_to_wf”: {
“type”: “LineString”,
“coordinates”: [
[
-122.397232162,
37.78604508
],
[
-122.41019293,
37.580599578
]
]
},
“dist_miles”: 14.23
},
{
“src”: “CALFIRE”,
“acres”: 4.502656,
“agency”: “CDF”,
“dist_m”: 22908.46,
“dist_km”: 22.91,
“fire_yr”: “2022”,
“wf_name”: “San Andreas Dam Face 2022”,
“ln_to_wf”: {
“type”: “LineString”,
“coordinates”: [
[
-122.397232162,
37.78604508
],
[
-122.410237957,
37.580521586
]
]
},
“dist_miles”: 14.23
},
{
“src”: “CALFIRE”,
“acres”: 33.98037,
“agency”: “OTH”,
“dist_m”: 23564.91,
“dist_km”: 23.56,
“fire_yr”: “2022”,
“wf_name”: “02 – Watershed Prescribed Fire”,
“ln_to_wf”: {
“type”: “LineString”,
“coordinates”: [
[
-122.397232162,
37.78604508
],
[
-122.612822337,
37.910955891
]
]
},
“dist_miles”: 14.64
}
],
“annotations”: {
“annotations”: [
{
“org”: “US Census”,
“org_link”: “https://www.census.gov/”,
“data_service”: “https://geocoding.geo.census.gov/geocoder/”,
“grs_last_udpate”: “2024-08-17T22:22:32.631807+00:00”
},
{
“org”: “USGS”,
“org_link”: “https://www.usgs.gov”,
“data_service”: “https://apps.nationalmap.gov/epqs/”,
“grs_last_udpate”: “2024-09-01T01:25:43.77738+00:00”
}
]
}
}
Common Use Cases
- Real Estate Applications: Determine how close properties are to the coast.
- Environmental Analysis: Assess vulnerability to coastal hazards.
- Insurance Risk Analysis: Determine physical property risks.
- Travel and Logistics: Plan routes or stops based on proximity to the coast.
Tips for Efficient Use
- Use geographic coordinates (
lat
,lon
) for more accurate results. - Enable
perf
only if you need performance metrics. - Test queries with different configurations of
lines
andanno
to customize the response.
This API is an excellent tool for various geospatial analysis needs. With its simple input structure and detailed response, it’s easy to integrate into your applications or workflow