knitr::opts_chunk$set(message = FALSE, warning = FALSE)

# Load the packages used in your analysis.
library(tidyverse)
library(sf)
library(tigris)
library(osmdata)
library(sfnetworks)
library(tidygraph)
library(tmap)
library(glue)
library(magrittr)

How to Use This Starter File

Complete the blank code chunks, provide explanations where requested, and add code comments where necessary. Keep the existing code chunks and section headings. Use methods from class and the course labs; code needed to preserve your inputs is supplied.

Work through the file in order:

  1. Fill in the data-preparation chunks marked eval=FALSE and run them manually in RStudio.
  2. Run save-inputs to save your sample, then complete image collection and Colab processing in Section 4.
  3. Complete the analysis and knit. Leave eval=FALSE in place: the report loads your saved inputs instead of resampling roads or downloading images again.

Save this Rmd, major2_inputs.rds, and the downloaded seg_output.csv in the same project folder. Use a downloaded_image subfolder for the JPG files. Open an RStudio project in that folder so relative paths work both interactively and when knitting. Do not include private credentials in the document.

Assignment Overview

Select two Census tracts that you expect to differ in walkability. Compare their streetscapes using images randomly sampled from each road network. Then compare the tracts within road classes represented in both samples. Does your interpretation change when you compare similar kinds of roads?

The labels “More walkable” and “Less walkable” describe your initial expectations, not a conclusion established by the model. Image composition captures only some aspects of walkability.

Analysis Settings and Sampling Rules

local_crs <- 32616 # PCS / WGS84 / UTM 16N
sampling_seed <- 2026

1. Select Two Tracts

Download tract geometry and choose one tract you expect to be more walkable and another you expect to be less walkable. Your choices can reflect personal experience, a preliminary map review, or another stated reason.

Create tracts, an sf object with two polygon features and columns GEOID and tract_label. GEOID identifies the tract; tract_label records your initial walkability expectation – use the labels "More walkable" and "Less walkable" throughout the analysis.

# Download the tract geometry and select the two tracts.
tracts <- tigris::tracts(
  state = "GA",
  county = "Fulton",
  year = 2024,
  cb = FALSE
) %>%
  filter(NAME %in% c("96.01", "96.04"))

# Assign tract labels and transform to local_crs for spatial calculations.
tracts <- tracts %>%
  mutate(
    tract_label = case_when(
      NAME == "96.04" ~ "More walkable",
      NAME == "96.01" ~ "Less walkable"
    )
  ) %>%
  st_transform(local_crs)

tracts %>%
  st_drop_geometry() %>%
  select(GEOID, NAME, tract_label)

Briefly explain your choices and what streetscape differences you expect to find (no more than 100 words).

Your explanation: I selected two census tracts in Buckhead that I am familiar with. I expect Tract 96.04 to be more walkable because it is closer to the Buckhead Village area, where there are shops and restaurants. In contrast, I find walking in Tract 96.01 tiring. It is an office area with construction, heavy and fast-moving traffic, limited shade, and streetscapes that feel less interesting. In summer, walking there can be especially hot. I expect the images to show differences in sidewalks, buildings, and vegetation between the two tracts.

2. Prepare and Sample the Road Networks

For each tract:

  1. Download the selected road classes using the tract’s bounding box and clean the network using the lab methods.
  2. Calculate segment lengths. Keep whole segments at least 91.44 meters long whose midpoints fall inside the tract.
  3. Inspect the number of eligible segments by road class.
  4. Use sampling_seed and a consistent row order to sample up to 100 segments across all eligible road classes. Use all segments if fewer than 100 are eligible.

Combine the two samples into edges, an sf object of LINESTRING features in local_crs. Keep tract_label, GEOID, highway, and length (meters). Assign a unique edge_id to each segment across the combined sample.

# Download and clean the road networks for the two tracts.
set_overpass_url("https://overpass-api.de/api/interpreter")

osm_roads <- lapply(seq_len(nrow(tracts)), function(i) {
  tract_bbox <- tracts[i, ] %>%
    st_transform(4326) %>%
    st_bbox()

  opq(bbox = tract_bbox, timeout = 180) %>%
    add_osm_feature(
      key = "highway",
      value = c("primary", "secondary", "tertiary", "residential")
    ) %>%
    osmdata_sf() %>%
    osm_poly2line()
})

# Calculate lengths and retain segments with eligible midpoints and lengths.

# Clean the road network for Tract 96.04.
net_9604 <- osm_roads[[1]]$osm_lines %>%
  st_transform(local_crs) %>%
  select(osm_id, highway) %>%
  sfnetworks::as_sfnetwork(directed = FALSE) %>%
  activate("edges") %>%
  filter(!edge_is_multiple()) %>%
  filter(!edge_is_loop()) %>%
  convert(to_spatial_subdivision) %>%
  convert(
    to_spatial_smooth,
    require_equal = "highway",
    summarise_attributes = "first"
  )

# Clean the road network for Tract 96.01.
net_9601 <- osm_roads[[2]]$osm_lines %>%
  st_transform(local_crs) %>%
  select(osm_id, highway) %>%
  sfnetworks::as_sfnetwork(directed = FALSE) %>%
  activate("edges") %>%
  filter(!edge_is_multiple()) %>%
  filter(!edge_is_loop()) %>%
  convert(to_spatial_subdivision) %>%
  convert(
    to_spatial_smooth,
    require_equal = "highway",
    summarise_attributes = "first"
  )

net_9604
net_9601

# Extract edges and calculate lengths.
edges_9604 <- net_9604 %>%
  st_as_sf("edges") %>%
  select(osm_id, highway) %>%
  mutate(length = as.numeric(st_length(.))) %>%
  filter(length >= 91.44)

edges_9601 <- net_9601 %>%
  st_as_sf("edges") %>%
  select(osm_id, highway) %>%
  mutate(length = as.numeric(st_length(.))) %>%
  filter(length >= 91.44)

# Find the midpoint of each whole segment.
midpoints_9604 <- st_line_sample(st_geometry(edges_9604), sample = 0.5)
midpoints_9601 <- st_line_sample(st_geometry(edges_9601), sample = 0.5)

# Keep whole segments whose midpoint falls within the matching tract.
edges_9604 <- edges_9604[
  lengths(st_intersects(midpoints_9604, tracts[tracts$NAME == "96.04", ])) > 0,
]

edges_9601 <- edges_9601[
  lengths(st_intersects(midpoints_9601, tracts[tracts$NAME == "96.01", ])) > 0,
]

# Inspect eligible counts before sampling.
table(edges_9604$highway)
table(edges_9601$highway)

# Use sampling_seed to randomly sample up to 100 segments per tract.

# Both tracts have fewer than 100 eligible segments, so keep all of them.

# Combine the samples and assign unique edge IDs.
edges_9604 <- edges_9604 %>%
  mutate(
    GEOID = "13121009604",
    tract_label = "More walkable"
  )

edges_9601 <- edges_9601 %>%
  mutate(
    GEOID = "13121009601",
    tract_label = "Less walkable"
  )

edges <- bind_rows(edges_9604, edges_9601) %>%
  mutate(edge_id = row_number())

3. Prepare the Image Locations and Headings

Adapt getHeading() from the GSV lab to take one projected LINESTRING and return two midpoint views. Sample points at 0.48, 0.50, and 0.52 along the segment. From the midpoint (0.50), calculate headings toward the other two points, looking toward each end of the segment.

Return two rows with type ("mid1" and "mid2"), X, Y, and heading. Use the midpoint coordinates for both rows and express headings from 0 to less than 360 degrees.

getHeading <- function(line) {
 # Locate the midpoint and the nearby points used for heading calculations.
mid_p3 <- line %>%
    st_line_sample(sample = c(0.48, 0.50, 0.52)) %>%
    st_cast("POINT") %>%
    st_coordinates()
 
# Calculate both viewing directions and return their locations and headings.
 mid_heading_1 <- atan2(
    mid_p3[1, "X"] - mid_p3[2, "X"],
    mid_p3[1, "Y"] - mid_p3[2, "Y"]
  ) * 180 / pi

  mid_heading_2 <- atan2(
    mid_p3[3, "X"] - mid_p3[2, "X"],
    mid_p3[3, "Y"] - mid_p3[2, "Y"]
  ) * 180 / pi

  tibble(
    type = c("mid1", "mid2"),
    X = mid_p3[2, "X"],
    Y = mid_p3[2, "Y"],
    heading = c(mid_heading_1, mid_heading_2) %% 360
  )
}

Apply the function to edges and create edges_heading. Create points using local_crs, and transform them to EPSG:4326. Update X and Y to longitude and latitude after transforming. Assign unique img_id values across both tracts. Colab extracts the image ID from the filename and preserves it in the CSV.

edges_heading must have two POINT rows per sampled segment and contain edge_id, img_id, tract_label, GEOID, highway, type, X, Y, and heading.

# Apply getHeading() and attach the segment attributes.
edges_heading <- edges %>%
  st_geometry() %>%
  map_df(getHeading) %>%
  bind_cols(
    edges %>%
      st_drop_geometry() %>%
      slice(rep(1:nrow(edges), each = 2))
  )
# Transform the points, update longitude/latitude, and assign image IDs.
edges_heading <- edges_heading %>%
  st_as_sf(coords = c("X", "Y"), crs = local_crs) %>%
  st_transform(4326) %>%
  mutate(
    X = st_coordinates(.)[, "X"],
    Y = st_coordinates(.)[, "Y"],
    heading = heading %% 360,
    img_id = seq_len(nrow(.))
  )

Run the supplied save chunk manually after preparing your sample. If you change the tracts or sampling before collecting images, regenerate and save the inputs together. Once image collection starts, keep the IDs fixed.

# Provided: run once after preparing your inputs.
saveRDS(
  list(tracts = tracts, edges = edges, edges_heading = edges_heading),
  "major2_inputs.rds"
)
# Provided: restore the same inputs when knitting.
saved_inputs <- readRDS("major2_inputs.rds")
tracts <- saved_inputs$tracts
edges <- saved_inputs$edges
edges_heading <- saved_inputs$edges_heading

stopifnot(nrow(tracts) == 2, !anyDuplicated(tracts$GEOID))
stopifnot(setequal(tracts$tract_label, c("More walkable", "Less walkable")))
stopifnot(!anyNA(edges$edge_id), !anyDuplicated(edges$edge_id))
stopifnot(nrow(edges_heading) == 2 * nrow(edges))
stopifnot(!anyNA(edges_heading$img_id), !anyDuplicated(edges_heading$img_id))
stopifnot(!anyNA(edges_heading$edge_id), !anyNA(edges_heading$type))
stopifnot(setequal(edges_heading$edge_id, edges$edge_id))

# Each sampled segment must have exactly one view of each type.
view_counts <- edges_heading %>%
  sf::st_drop_geometry() %>%
  dplyr::group_by(edge_id) %>%
  dplyr::summarise(
    n_views = dplyr::n(),
    n_mid1 = sum(type == "mid1"),
    n_mid2 = sum(type == "mid2"),
    .groups = "drop"
  )
stopifnot(all(view_counts$n_views == 2L),
          all(view_counts$n_mid1 == 1L),
          all(view_counts$n_mid2 == 1L))

Create an interactive map showing both selected tracts with clearly identified tract labels. Include this map in the knitted report.

# Map the selected tract polygons and identify the two tracts.
tmap_mode("view")

tm_basemap("OpenStreetMap") +
  tm_shape(tracts) +
  tm_polygons(
    fill = "tract_label",
    fill_alpha = 0.4,
    col = "black",
    lwd = 2
  ) +
  tm_text("NAME", size = 0.8)

4. Download Images and Run Colab

Adapt getImage() from the GSV lab to download one image from one row of edges_heading:

  1. Extract type, img_id, edge_id, and heading. Format location as latitude,longitude (Y,X).
  2. Read your Google API key from its environment variable and construct request using the lab’s Street View Static API endpoint and image settings.
  3. Set fpath to the supplied filename inside downloaded_image.

The filename and download commands are provided below.

getImage <- function(iterrow) {
  # Extract row values, format location and heading, and construct the request URL.
  type <- iterrow$type
  img_id <- iterrow$img_id
  edge_id <- iterrow$edge_id
  heading <- round(iterrow$heading, 1)

  location <- paste0(
    round(iterrow$Y, 5), ",",
    round(iterrow$X, 5)
  )

  key <- Sys.getenv("GOOGLE_API_KEY")
  endpoint <- "https://maps.googleapis.com/maps/api/streetview"

  request <- glue::glue(
    "{endpoint}?size=640x640&location={location}&heading={heading}&fov=90&pitch=0&key={key}"
  )

  # Provided filename: keep img_id as the first number in the filename.
  fname <- glue::glue("GSV-img_{img_id}-eid_{edge_id}-type_{type}.jpg")

  # Create fpath by combining the output folder with fname.
   fpath <- file.path("downloaded_image", fname)
  # Provided: skip an existing file rather than request it again.
  if (!file.exists(fpath)) {
    download.file(request, fpath, mode = "wb", quiet = TRUE)
    Sys.sleep(1)
  }
}

Run the supplied download chunk manually, keeping eval=FALSE. Inspect the images and remove gray “no imagery” placeholders or invalid files before running Colab. Do not change or reuse image IDs to fill gaps. Contact me if technical problems prevent you from completing collection or processing.

# Provided: run manually, not when knitting.
dir.create("downloaded_image", showWarnings = FALSE)
for (i in seq_len(nrow(edges_heading))) {
  getImage(edges_heading[i, ])
}

Zip the image folder as gsv_images.zip. Use the Colab notebook shared for the computer-vision lab (https://colab.research.google.com/drive/1s0HiZIwjke-xtmHwzFmFp6PJrNkysoy9), set the extracted image-folder path, run segmentation on all images, and download seg_output.csv to your project folder. Running the supplied Python is required; writing Python or changing the model is not assessed. Do not include the notebook’s demonstration outputs or individual image predictions in this report.

5. Join Results and Create Segment-Level Measures

Read seg_output.csv and join it to edges_heading using the shared img_id column. Create image_results, with one row per matching image and the original segment and tract attributes.

Determine the total number of pixels in the output mask from Colab or by summing all category counts for one image, as in the lab. Use that total to calculate these six image-level measures. As in the lab, the five pct_* measures are percentages from 0 to 100; multiply the pixel fractions by 100 and label their plots and tables accordingly. The building-to-street ratio is not a percentage:

# Read the CSV, join image IDs to locations, and calculate image-level measures.
seg_output <- read.csv("seg_output.csv")

image_results <- edges_heading %>%
  inner_join(seg_output, by = "img_id")

total_pixels <- 589824

image_results <- image_results %>%
  mutate(
    pct_building = building / total_pixels * 100,
    pct_sky = sky / total_pixels * 100,
    pct_road = road / total_pixels * 100,
    pct_sidewalk = sidewalk / total_pixels * 100,
    pct_greenness = (vegetation + terrain) / total_pixels * 100,
    street_pixels = road + sidewalk + car,
    b2s_ratio = if_else(
      street_pixels == 0 | building / street_pixels > 4,
      NA_real_,
      building / street_pixels
    )
  )

Create segment_results, an sf object with one midpoint POINT per segment. Keep only segments with both views (mid1 and mid2) and valid values for all six measures in each view (no missing or infinite values). Keep excluded images in image_results.

Average each image-level measure across the segment’s two views. In particular, average the two image-level building-to-street ratios rather than calculate a new ratio from pooled counts. Keep edge_id, GEOID, tract_label, highway, and the six measure names. Drop geometry before grouping and summarizing measurements, then join the summary back to one midpoint per segment.

# Identify complete pairs with valid measurements.
measure_names <- c(
  "pct_building", "pct_sky", "pct_road",
  "pct_sidewalk", "pct_greenness", "b2s_ratio"
)

valid_images <- image_results %>%
  st_drop_geometry() %>%
  filter(if_all(all_of(measure_names), is.finite))

# Average the two views within each segment and restore one midpoint geometry.
segment_summary <- valid_images %>%
  group_by(edge_id, GEOID, tract_label, highway) %>%
  filter(n() == 2, setequal(type, c("mid1", "mid2"))) %>%
  summarise(
    across(all_of(measure_names), mean),
    .groups = "drop"
  )

# Restore one midpoint geometry per segment.
segment_points <- edges_heading %>%
  filter(type == "mid1") %>%
  select(edge_id)

segment_results <- segment_points %>%
  inner_join(segment_summary, by = "edge_id")

6. Compare the Two Tracts Overall

Use segment_results to create:

  1. Interactive maps: Map sidewalk percentage, greenness percentage, and building-to-street ratio. For each measure, show both tracts together or in two separate maps. Use the same color scale for both tracts and include tract boundaries, labels, and legends.
  2. Boxplots: Create one figure with six panels, one per measure. Put tract_label on the x-axis and the measure on the y-axis, giving two boxes per panel. Use readable panel titles. Each panel may have its own y-axis scale, shared by both tracts.
  3. Summary table: Create and display tract_summary with one row per tract. Include the sampled segment count from edges, the included segment count from segment_results, and the mean of each of the six measures for included segments.

If a tract has no valid pairs, report zero included segments and NA means. Show the available results and explain any comparisons you cannot make. If neither tract has valid pairs, skip the measure maps and boxplots. Keep the code chunks and required columns in empty result objects.

# Map the three measures and make the two tracts easy to compare.
tmap_mode("view")

# 1. Sidewalk percentage
tm_basemap("OpenStreetMap") +
  tm_shape(tracts) +
  tm_borders(col = "black", lwd = 2) +
  tm_shape(segment_results) +
  tm_dots(
    size = 0.6,
    fill = "pct_sidewalk",
    fill.scale = tm_scale(
      values = c("#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
    ),
    fill.legend = tm_legend(title = "Sidewalk (%)")
  ) +
  tm_shape(tracts) +
  tm_text("tract_label", size = 0.8)
# 2. Greenness percentage
tm_basemap("OpenStreetMap") +
  tm_shape(tracts) +
  tm_borders(col = "black", lwd = 2) +
  tm_shape(segment_results) +
  tm_dots(
    size = 0.6,
    fill = "pct_greenness",
    fill.scale = tm_scale(
      values = c("#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
    ),
    fill.legend = tm_legend(title = "Greenness (%)")
  ) +
  tm_shape(tracts) +
  tm_text("tract_label", size = 0.8)
# 3. Building-to-street ratio
tm_basemap("OpenStreetMap") +
  tm_shape(tracts) +
  tm_borders(col = "black", lwd = 2) +
  tm_shape(segment_results) +
  tm_dots(
    size = 0.6,
    fill = "b2s_ratio",
    fill.scale = tm_scale(
      values = c("#2c7bb6", "#abd9e9", "#fdae61", "#d7191c")
    ),
    fill.legend = tm_legend(title = "Building-to-street ratio")
  ) +
  tm_shape(tracts) +
  tm_text("tract_label", size = 0.8)
# Compare all six segment-level measures between tracts.
segment_results %>%
  st_drop_geometry() %>%
  pivot_longer(
    cols = c(
      b2s_ratio, pct_building, pct_greenness,
      pct_road, pct_sidewalk, pct_sky
    ),
    names_to = "variable",
    values_to = "value"
  ) %>%
  ggplot(aes(x = tract_label, y = value)) +
  geom_boxplot(fill = "#c7ffd6") +
  theme_bw() +
  facet_wrap(
    ~ variable,
    scales = "free_y",
    nrow = 3,
    labeller = as_labeller(c(
      b2s_ratio = "Building-to-street ratio",
      pct_building = "Building (%)",
      pct_greenness = "Greenness (%)",
      pct_road = "Road (%)",
      pct_sidewalk = "Sidewalk (%)",
      pct_sky = "Sky (%)"
    ))
  ) +
  labs(
    x = "Tract",
    y = "Image percentage / building-to-street ratio"
  ) +
  theme(
    axis.text.x = element_text(angle = 25, hjust = 1)
  )

# Display sampled and included segment counts and mean measures by tract.

# Count sampled segments in each tract.
sampled_counts <- edges %>%
  st_drop_geometry() %>%
  count(GEOID, tract_label, name = "sampled_segments")

# Count included segments and calculate mean measures.
included_summary <- segment_results %>%
  st_drop_geometry() %>%
  group_by(GEOID, tract_label) %>%
  summarise(
    included_segments = n(),
    across(
      c(
        pct_building, pct_sky, pct_road,
        pct_sidewalk, pct_greenness, b2s_ratio
      ),
      mean
    ),
    .groups = "drop"
  )

# Combine counts and means into the required table.
tract_summary <- sampled_counts %>%
  left_join(included_summary, by = c("GEOID", "tract_label")) %>%
  mutate(included_segments = coalesce(included_segments, 0L))

tract_summary
## # A tibble: 2 × 10
##   GEOID      tract_label sampled_segments included_segments pct_building pct_sky
##   <chr>      <chr>                  <int>             <int>        <dbl>   <dbl>
## 1 131210096… Less walka…               22                21         9.00    20.1
## 2 131210096… More walka…               58                57         3.83    14.1
## # ℹ 4 more variables: pct_road <dbl>, pct_sidewalk <dbl>, pct_greenness <dbl>,
## #   b2s_ratio <dbl>

7. Examine Road Composition and Compare Shared Classes

Create and display road_composition from edges, using the original sample before exclusions. For each tract and road class, report the segment count and its proportion of that tract’s sampled segments. Note any of the four selected road classes missing from a tract’s sample; rows for absent classes are optional.

Using segment_results, keep road classes represented in both tracts. Create one figure with six panels, one for each measure. In each panel, put road class on the x-axis and the measure on the y-axis. For each road class, show side-by-side boxplots for “More walkable” and “Less walkable,” using different colors for tract_label. Each panel may use its own y-axis scale, but both tracts must share the same scale within that panel.

Also report the number of included segments by tract and road class in a table. Note any comparisons based on very few segments. If no road classes are shared, explain this and skip the figure.

# Summarize sampled road-class counts and proportions within each tract.
road_composition <- edges %>%
  st_drop_geometry() %>%
  count(GEOID, tract_label, highway, name = "n_segments") %>%
  group_by(GEOID, tract_label) %>%
  mutate(proportion = n_segments / sum(n_segments)) %>%
  ungroup()

road_composition
## # A tibble: 7 × 5
##   GEOID       tract_label   highway     n_segments proportion
##   <chr>       <chr>         <chr>            <int>      <dbl>
## 1 13121009601 Less walkable primary              6     0.273 
## 2 13121009601 Less walkable residential         14     0.636 
## 3 13121009601 Less walkable secondary            1     0.0455
## 4 13121009601 Less walkable tertiary             1     0.0455
## 5 13121009604 More walkable residential         54     0.931 
## 6 13121009604 More walkable secondary            2     0.0345
## 7 13121009604 More walkable tertiary             2     0.0345
# Identify shared classes in segment_results and report their included counts.
included_by_class <- segment_results %>%
  st_drop_geometry() %>%
  count(highway, tract_label, name = "included_segments")

shared_classes <- included_by_class %>%
  group_by(highway) %>%
  filter(n_distinct(tract_label) == 2) %>%
  pull(highway) %>%
  unique()

shared_counts <- included_by_class %>%
  filter(highway %in% shared_classes)

shared_counts
## # A tibble: 6 × 3
##   highway     tract_label   included_segments
##   <chr>       <chr>                     <int>
## 1 residential Less walkable                13
## 2 residential More walkable                53
## 3 secondary   Less walkable                 1
## 4 secondary   More walkable                 2
## 5 tertiary    Less walkable                 1
## 6 tertiary    More walkable                 2
# Compare the tracts within shared road classes for all six measures.
segment_results %>%
  st_drop_geometry() %>%
  filter(highway %in% shared_classes) %>%
  pivot_longer(
    cols = c(
      b2s_ratio, pct_building, pct_greenness,
      pct_road, pct_sidewalk, pct_sky
    ),
    names_to = "variable",
    values_to = "value"
  ) %>%
  ggplot(aes(x = highway, y = value, fill = tract_label)) +
  geom_boxplot(position = position_dodge(width = 0.8)) +
  theme_bw() +
  facet_wrap(
    ~ variable,
    scales = "free_y",
    nrow = 3,
    labeller = as_labeller(c(
      b2s_ratio = "Building-to-street ratio",
      pct_building = "Building (%)",
      pct_greenness = "Greenness (%)",
      pct_road = "Road (%)",
      pct_sidewalk = "Sidewalk (%)",
      pct_sky = "Sky (%)"
    ))
  ) +
  labs(
    x = "Road class",
    y = "Image percentage / building-to-street ratio",
    fill = "Tract"
  ) +
  theme(axis.text.x = element_text(angle = 25, hjust = 1))

Findings

In no more than 200 words, answer:

  • Do the overall results support your initial walkability expectations?
  • How does the mix of sampled road classes differ between the tracts?
  • Does comparing the tracts within the same road classes change your interpretation?

If a comparison is unavailable, explain why and what you can conclude from the available results.

Your findings: Overall, the results partly supported my initial expectations. The more walkable tract had higher average greenness, but the less walkable tract had a slightly higher average sidewalk percentage. The sampled road mix was also different: 93% of segments in the more walkable tract were residential, compared with 64% in the less walkable tract, which also included primary roads.

When comparing residential roads only, greenness appeared more similar between the tracts than in the overall comparison. This suggests that road composition may contribute to the overall difference. Comparisons for secondary and tertiary roads are limited because each tract had only one or two valid segments per class.

Based on my personal experience, walking in the less walkable tract can feel tiring because of fast traffic, construction, limited shade, and a less engaging streetscape. The more walkable tract also has challenges, including short crossing times, utility poles obstructing sidewalks, and fast traffic. These experiences are not fully captured by the sampled images or the six image-based measures.