Skip to content

Commit

Permalink
fix h3 bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
temospena committed Jan 15, 2025
1 parent b7f04a6 commit 19739f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ make_grid = function(CITYlimit, CITY, cellsize_input, square_input, use_h3, h3_r
polygon_to_cells(res = h3_res, simple = FALSE) # res = 9 is 500m
grid = grid$h3_addresses |>
cell_to_polygon(simple = FALSE)
mutate(ID = seq(1:nrow(.))) # give an ID to each cell
# mutate(ID = seq(1:nrow(.))) # give an ID to each cell
grid = grid |>
mutate(ID = seq(1:nrow(grid))) # give an ID to each cell
h3_index = grid |> st_drop_geometry() # save h3_address for later
Expand Down
4 changes: 2 additions & 2 deletions _targets.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ square_input = TRUE # TRUE = squares, FALSE = hexagons
use_h3 = TRUE # use h3 to create universal grid?
h3_res = 9 # h3 resolution. default: 9 (400m diameter). 8 = 1060m diameter, 10 = 150m diameter
build_osm = FALSE # clean osm road network again?
analysis = TRUE # export input parameters and results to a xls file? default: FALSE
analysis = FALSE # export input parameters and results to a xls file? default: FALSE

# Thresholds
population_min = median # mean or median? default: mean
Expand Down Expand Up @@ -73,7 +73,7 @@ list(
command = get_citylimit(CITY, GEOJSON, GEOJSON_name = GEOJSON_input)),
tar_target(
name = grid,
command = make_grid(CITYlimit, CITY, cellsize = cellsize_input, square = square_input, h3_hex = use_h3, h3_res = h3_res)),
command = make_grid(CITYlimit, CITY, cellsize = cellsize_input, square = square_input, use_h3 = use_h3, h3_res = h3_res)),
tar_target(
name = road_network,
command = get_osm(CITYlimit, CITY)),
Expand Down

0 comments on commit 19739f8

Please sign in to comment.