Skip to content

Commit

Permalink
od data for Lisbon update for od2net
Browse files Browse the repository at this point in the history
  • Loading branch information
temospena committed Feb 26, 2024
1 parent e54d0b1 commit 7473eed
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion code/test-code/od_data_lisbon.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,26 @@ TRIPSmode_Lisbon = TRIPSmode_Lisbon |>
saveRDS(TRIPSmode_Lisbon, "TRIPSmode_Lisbon.Rds")
piggyback::pb_upload("TRIPSmode_Lisbon.Rds")


TRIPSmode_Lisbon = TRIPSmode_Lisbon |>
sf::st_drop_geometry() |>
select(DICOFREor11, DICOFREde11, Total) |>
rename(from = DICOFREor11, to = DICOFREde11, count = Total) |>
mutate(count = round(count))

write.csv(TRIPSmode_Lisbon, "od.csv", row.names = FALSE)
piggyback::pb_upload("od.csv")

# zones data
ZONESgeo_Lisbon = readRDS(url("https://github.com/U-Shift/biclar/releases/download/0.0.1/FREGUESIASgeo.Rds"))
ZONESgeo_Lisbon = ZONESgeo_Lisbon |>
filter(Concelho == "Lisboa")
filter(Concelho == "Lisboa") |>
select(Dicofre, geom) |>
rename(name = Dicofre)

saveRDS(ZONESgeo_Lisbon, "ZONESgeo_Lisbon.Rds")
piggyback::pb_upload("ZONESgeo_Lisbon.Rds")
sf::st_write(ZONESgeo_Lisbon, "zones.geojson")
piggyback::pb_upload("zones.geojson")


0 comments on commit 7473eed

Please sign in to comment.