Hui Jeong(Hailyee) Ha

Human Mobility, Transportation & Spatial Data Science

All software

SSIMmap vignette

Compare two maps of Toronto and see where their patterns agree.

Compare two maps of Toronto

The package includes Toronto census areas with two measures of neighbourhood conditions. CIMD represents residential instability and PP represents social deprivation. Here, each measure is converted to percentiles, and each local comparison uses a window of 87 neighbours.

install.packages("SSIMmap")
library(SSIMmap)
data("Toronto_SSIM")

local <- ssim_polygon(
  Toronto_SSIM,
  map1 = "CIMD",
  map2 = "PP",
  global = FALSE,
  bandwidth = 87,
  transform = "percentile"
)
plot(local["SSIM"], main = "Local similarity across Toronto")

Read the similarity map

Higher SSIM scores indicate closer agreement. The package also reports three components so you can check whether the maps agree in local averages (SIM), how values vary (SIV), or which areas have high and low values (SIP).

Compare a different kind of map

Use ssim_raster() when the inputs are aligned rasters. The figure below compares British Columbia fire-weather conditions across days. The full vignette walks through both raster and polygon comparisons, including how to choose the size of a local window and run a permutation test.

Two maps compare the similarity of fire weather patterns in British Columbia.
Local agreement in fire-weather conditions across British Columbia. Open the figure for the full-size map.