House Price Drop in Key West, Florida

Buy a vacation home? Or… maybe not

Djuwita Carney
Analytics Vidhya
5 min readDec 6, 2019

--

Photo by Tessa Wilson on Unsplash

Last October, a dear friend of mine showed me an article about a drop in real estate price in Key West, Florida. He really wants to move to Key West from Massachusetts, due to hard winter conditions that have been bothering him since he was retired a couple years ago.

As a hydrologist, the first thing that came to my mind was, how often is this area flooded every years? and how deep? To answer these questions, I went to NOAA (National Oceanography and Atmospheric Administration) website to pull up some extreme sea water levels. The highest recorded sea level was 4.47 feet, on September 2017, and the average maximum sea level for 2015 to 2019 period is 2.73 ft.

For my friend who lives in Massachusetts, it is not easy to imagine, what 4.47 ft sea water level means in association with buying a house in Key West. So, I created a map showing Key West under several sea water level conditions.

To do that, I collected the digital elevation model from NOAA for Key West, Florida. To speed up my programming process, I transform the DEM model into longitude-latitude format using my GIS (Geographic Information System) tool. Once I have the longitude-latitude format, I wrote the following code to create the maps.

The goal is to show the map of Key West under the normal sea water level of (0.0), under the average maximum sea water level of 2.73 ft, and under the highest recorded maximum sea water level of 4.47 ft.

## Import librariesimport numpy as np
import pandas as pd
import folium
import branca
from folium import plugins
import matplotlib.pyplot as plt
from scipy.interpolate import griddata
import geojsoncontour
import scipy as sp
import scipy.ndimage
%matplotlib inline# Read the digital elevation model in longitude, latitude and elevation format
data = pd.read_csv('./DEM/Key_West_DEM_LL.xyz', header = None, names = ['longitude','latitude','elevation'])
DEM = data.copy()
# Set all negative elevations to zero to show that they will be under the mean sea level of zero
for i in range(0,len(DEM)):
if DEM['elevation'][i] <= 0.:
DEM['elevation'][i] = 0.
# Setup minimum and maximum values for the contour lines (my DEM came in meter)
vmin = DEM['elevation'].min() * 3.280833
vmax = DEM['elevation'].max() * 3.280833
# Setup colormap
colors = ['blue','royalblue', 'navy','pink', 'mediumpurple', 'darkorchid', 'plum', 'm', 'mediumvioletred', 'palevioletred', 'crimson',
'magenta','pink','red','yellow','orange', 'brown','green', 'darkgreen']
levels = len(colors)
cm = branca.colormap.LinearColormap(colors, vmin=vmin, vmax=vmax).to_step(levels)
# Convertion dataframe to array
x_orig = np.asarray(DEM.longitude.tolist())
y_orig = np.asarray(DEM.latitude.tolist())
# convert elevation from m to ft
z_orig = np.asarray(DEM.elevation.tolist()) * 3.280833
# Make grids
x_arr = np.linspace(np.min(x_orig), np.max(x_orig), 500)
y_arr = np.linspace(np.min(y_orig), np.max(y_orig), 500)
x_mesh, y_mesh = np.meshgrid(x_arr, y_arr)

# Grid the elevation values
z_mesh = griddata((x_orig, y_orig), z_orig, (x_mesh, y_mesh), method='linear')

# Use Gaussian filter to smoothen the contour
sigma = [5, 5]
z_mesh = sp.ndimage.filters.gaussian_filter(z_mesh, sigma, mode='constant')

# Create the contour
contourf = plt.contourf(x_mesh, y_mesh, z_mesh, levels, alpha=0.5, colors=colors, linestyles='None', vmin=vmin, vmax=vmax)
# Convert matplotlib contourf to geojson
geojson = geojsoncontour.contourf_to_geojson(
contourf=contourf,
min_angle_deg=3.0,
ndigits=5,
stroke_width=1,
fill_opacity=0.1)

# Set up the folium plot
geomap1 = folium.Map([DEM.latitude.mean(), DEM.longitude.mean()], zoom_start=12, tiles="OpenStreetMap")
# Plot the contour plot on folium
folium.GeoJson(
geojson,
style_function=lambda x: {
'color': x['properties']['stroke'],
'weight': x['properties']['stroke-width'],
'fillColor': x['properties']['fill'],
'opacity': 0.5,
}).add_to(geomap1)

# Add the colormap to the folium map
cm.caption = 'Elevation in ft.'
geomap1.add_child(cm)

# Fullscreen mode
plugins.Fullscreen(position='topright', force_separate_button=True).add_to(geomap1)
geomap1
Key West under the normal sea water level condition, no water in-land.

To plot the average maximum sea water level on top of the map, we need to calculate the water depth relative to the ground elevation, and set all the water depth on elevation higher than the average maximum water level to zero. Following is the example codes for this calculation.

DEM = data.copy()
# Set all ground elevation below zero to zero to show that under mean sea level of zero, they are all inundated)
for i in range(0,len(DEM)):
if DEM['elevation'][i] <= 0.:
DEM['elevation'][i] = 0.
# Set the areas that are not flooded (zero water depth)
# Calculate water depth (in meter) in the flooded areas
for i in range(0,len(DEM)):
if DEM['elevation'][i] >= ((2.73-1.77)/3.280833):# set no flood area
DEM['elevation'][i] = 0.
else:# water depth calculation
DEM['elevation'][i] = ((2.73-1.77)/3.280833) - DEM['elevation'][i]# There is 1.77 ft difference in water surface and DEM datum, it needs correction
# We can create the water depth contour map using the same code as describe in the first set of codes.
Key West under the average maximum sea water level (with datum correction of 1.77ft.)

The code above is applicable for calculating water depth in any sea water level conditions, such as the maximum recorded sea water level of 4.47 ft. Just replace the number in the water depth calculation to the water level of interest.

Key West under the maximum sea water level on September 10, 2017 (with datum correction of 1.77ft.)

The highest recorded sea water level in 2019 is 3.43 feet, significantly higher than the average of 2.73. There is a persistent trend that sea water level will keep increasing in the future.

Even if you buy a house in the area where there is no flood history, it does not mean that it will always be like that. Other things to consider is the flood insurance that can cost up to $10,000 per year, and increasing tax. The city needs to increase tax due to the high cost of drainage system maintenance. Sea water intrusion has damaged some of the city drainage system.

So, my dear friend, do you still consider moving to Florida?

Reference:

  1. https://pypi.org/project/geojsoncontour/
  2. https://www.tjansson.dk/2018/10/contour-map-in-folium/
  3. https://tidesandcurrents.noaa.gov/waterlevels.html?id=8724580&units

--

--