Skip to content

Commit

Permalink
Resolving conflicts
Browse files Browse the repository at this point in the history
Merge branch 'dev' into bikeAccessibility

# Conflicts:
#	NetworkGenerator.R
#	functions/addDestinations.R
#	functions/addNDVI.R
#	functions/getDestinationTypes.R
  • Loading branch information
StevePem committed Jan 10, 2024
2 parents 93696a3 + 6cdc3e5 commit ba85294
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
7 changes: 3 additions & 4 deletions NetworkGenerator.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ makeNetwork<-function(outputFileName="test"){
city = "Melbourne"
# city = "Brisbane"
# city = "Munich"

# City parameters to be set
# • outputCrs: desired coordinate system for network
# • osmExtract: if 'processOsm=T', OSM extract file in .osm format (.osm.pbf
Expand All @@ -24,7 +24,7 @@ makeNetwork<-function(outputFileName="test"){
# coordinate system as network)
# • gtfs_feed: if 'addGtfs=T' or 'addDestinationLayer=T, zip file containing
# GTFS data (and, if 'addGtfs=T', also set start and end dates in GTFS section)

if (city == "Melbourne") {
outputCrs = 28355
osmExtract = "./data/melbourne.osm"
Expand All @@ -34,7 +34,7 @@ makeNetwork<-function(outputFileName="test"){
osmPbfExtract = "./data/melbourne_australia.osm.pbf"
ndviFile = "./data/NDVI_1600mBuffer_Melbourne_reprojected.tif"
gtfs_feed = "./data/gtfs.zip"

} else if (city == "Brisbane") {
outputCrs = 28356
osmExtract = "" # must set 'processOsm=F'
Expand All @@ -54,7 +54,6 @@ makeNetwork<-function(outputFileName="test"){
osmPbfExtract = "./data/munich_germany.osm.pbf"
ndviFile = "" # must set 'addNDVI=F'
gtfs_feed = "./data/mvv_gtfs.zip" # to test; if not then >> # must set 'addGtfs=F' and 'addDestinationLayer=F'

}

# INPUT NETWORK
Expand Down
7 changes: 5 additions & 2 deletions functions/addDestinations.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ addDestinations <- function(nodes_current,
city,
gtfs_feed,
outputCrs) {

# nodes_current = networkDensified[[1]]
# edges_current = networkDensified[[2]]
# osmPbfExtract = "./data/melbourne_australia.osm.pbf"
Expand Down Expand Up @@ -103,7 +103,7 @@ addDestinations <- function(nodes_current,
# and store area and location details
destination.pt <-
bind_rows(destination.layer(points),

# # add stations (from point, polygons and lines) to point table
# getStation(points, polygons, lines) %>%
# mutate(dest_type = "railway_station")) %>%
Expand All @@ -127,6 +127,9 @@ addDestinations <- function(nodes_current,
# Remove any invalid polygons as they may cause errors
destination.poly <- destination.poly[which(st_is_valid(destination.poly$geometry)), ]

# Remove any invalid polygons as they may cause errors
destination.poly <- destination.poly[which(st_is_valid(destination.poly$geometry)), ]

# # check numbers of each destination type
# chk <- full_join(destination.poly %>%
# st_drop_geometry() %>%
Expand Down
2 changes: 1 addition & 1 deletion functions/addNDVI.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ addNDVI2Links <- function(links, ndviFile, ndviBuffDist) {
mutate(row_no = row_number()) %>%
left_join(., ndvi_values_mean, by = c("row_no" = "ID")) %>%
dplyr::select(-row_no)

# st_write(links.with.ndvi, "./SP_working/links_with_NDVI.sqlite", delete_layer = TRUE)

return(links.with.ndvi)
Expand Down
1 change: 0 additions & 1 deletion functions/getDestinationTypes.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ getCafe <- function(layer) {
return(layer %>% filter(amenity == "cafe"))
}


# 8 parking ----
getParking <- function(layer) {
return(layer %>% filter(amenity == "parking" &
Expand Down

0 comments on commit ba85294

Please sign in to comment.