Giter Site home page Giter Site logo

abstr's People

Contributors

dabreegster avatar lucasccdias avatar natesheehan avatar robinlovelace avatar tnederlof avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

abstr's Issues

Bug or user error in attempt to generate scenario file?

I'm hitting this issue when trying to generate a simple scenario. I guess it's a small mistake in my input. However, the error message could certainly be less cryptic:

# Notes for seminar


# Set-up ------------------------------------------------------------------

remotes::install_github("a-b-street/abstr")
#> Using github PAT from envvar GITHUB_PAT
#> Skipping install of 'abstr' from a github remote, the SHA1 (24baec9c) has not changed since last install.
#>   Use `force = TRUE` to force installation
library(tidyverse)
library(tmap)
library(pct)
tmap_mode("view")
#> tmap mode set to interactive viewing
sf::sf_use_s2(FALSE)
#> Spherical geometry (s2) switched off

u = "https://github.com/ITSLeeds/TDS/raw/master/messages/leeds-north.geojson"
study_region = sf::read_sf(u)
pct_region = pct::pct_regions[study_region, ]
#> old-style crs object detected; please recreate object with a recent sf::st_crs()
#> old-style crs object detected; please recreate object with a recent sf::st_crs()
#> old-style crs object detected; please recreate object with a recent sf::st_crs()
#> although coordinates are longitude/latitude, st_intersects assumes that they are planar
#> old-style crs object detected; please recreate object with a recent sf::st_crs()
#> old-style crs object detected; please recreate object with a recent sf::st_crs()
zones_all = pct::get_pct_zones(region = pct_region$region_name, geography = "msoa")
zones = zones_all[study_region, ]
#> although coordinates are longitude/latitude, st_intersects assumes that they are planar
plot(zones$geometry)
plot(study_region$geometry, add = TRUE, lwd = 5)

od_all = pct::get_od()
#> No region provided. Returning national OD data.
#> Rows: 2402201 Columns: 14
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr  (2): Area of residence, Area of workplace
#> dbl (12): All categories: Method of travel to work, Work mainly at or from h...
#> 
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
#> Rows: 7201 Columns: 6
#> ── Column specification ────────────────────────────────────────────────────────
#> Delimiter: ","
#> chr (2): MSOA11CD, MSOA11NM
#> dbl (4): BNGEAST, BNGNORTH, LONGITUDE, LATITUDE
#> 
#> ℹ Use `spec()` to retrieve the full column specification for this data.
#> ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.

od_study_region = od_all %>% 
  filter(geo_code1 %in% zones$geo_code) %>% 
  filter(geo_code2 %in% zones$geo_code) 

nrow(od_study_region) # 254k od pairs
#> [1] 254
sum(od_study_region$all) # 22k
#> [1] 22224

osm_region = osmextract::oe_get(zones, boundary = zones, layer = "multipolygons")
#> although coordinates are longitude/latitude, st_contains assumes that they are planar
#> The input place was matched with West Yorkshire. 
#> The chosen file was already detected in the download directory. Skip downloading.
#> Warning: The boundary is composed by more than one features. Selecting the
#> first.
#> Start with the vectortranslate operations on the input file!
#> 0...10...20...30...40...50...60...70...80...90...100 - done.
#> Finished the vectortranslate operations on the input file!
#> Reading layer `multipolygons' from data source 
#>   `/mnt/57982e2a-2874-4246-a6fe-115c199bc6bd/data/osm/geofabrik_west-yorkshire-latest.gpkg' 
#>   using driver `GPKG'
#> Simple feature collection with 5365 features and 25 fields
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -2.173294 ymin: 53.51973 xmax: -1.198814 ymax: 53.96315
#> Geodetic CRS:  WGS 84
osm_region %>% 
  sample_n(100) %>% 
  qtm()
#> Linking to GEOS 3.10.1, GDAL 3.4.0, PROJ 8.2.0; sf_use_s2() is FALSE

desire_lines = od::od_to_sf(od_study_region, zones)
#> 0 origins with no match in zone ids
#> 0 destinations with no match in zone ids
#>  points not in od data removed.

names(desire_lines)
#>  [1] "geo_code1"     "geo_code2"     "all"           "from_home"    
#>  [5] "light_rail"    "train"         "bus"           "taxi"         
#>  [9] "motorbike"     "car_driver"    "car_passenger" "bicycle"      
#> [13] "foot"          "other"         "geo_name1"     "geo_name2"    
#> [17] "la_1"          "la_2"          "geometry"
names(desire_lines_leeds)
#>  [1] "area_of_residence" "area_of_workplace" "all"              
#>  [4] "home"              "metro"             "train"            
#>  [7] "bus"               "taxi"              "motorcycle"       
#> [10] "drive"             "passenger"         "bicycle"          
#> [13] "on_foot"           "other"             "geometry"

desire_lines = desire_lines %>%
  select(geo_code1, geo_code2, Walk = foot, Bike = bicycle, Drive = car_driver, all)
desire_lines_small = desire_lines %>% 
  filter(geo_code1 != geo_code2) %>% 
  top_n(n = 10, wt = all)
plot(desire_lines_small)

sum(desire_lines_small$all)
#> [1] 7574

# A/B Street scenario -----------------------------------------------------



ablines = abstr::ab_scenario(od = desire_lines_small, zones = zones, 
                             origin_buildings = osm_region,
                             destination_buildings = osm_region,
                             pop_var = "all")
#> Warning in st_centroid.sf(origin_buildings): st_centroid assumes attributes are
#> constant over geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in st_centroid.sf(destination_buildings): st_centroid assumes attributes
#> are constant over geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> 0 origins with no match in zone ids
#> 0 destinations with no match in zone ids
#>  points not in od data removed.
#> although coordinates are longitude/latitude, st_intersects assumes that they are planar
#> although coordinates are longitude/latitude, st_intersects assumes that they are planar
#> Error in odc_new[od[[1]] == i, "ox"] <- sj_df$x[sel_sj_o]: replacement has length zero

Created on 2022-03-10 by the reprex package (v2.0.1)

Exeter example

Already done in #65 with tweaks in #66. Opening this issue for to track progress and share info, learned lots in the process.

Update input data

So the number of trips in each scenario is the same, further reducing the noisy nature of the examples shown in #7.

Update new version of ab_scenario to work with ActDev

Heads-up @natesheehan, after #16 was merged I think the latest version of abstr will no longer work with ActDev code. No big issue because we can use abstr 0.1.1: https://github.com/a-b-street/abstr/releases/tag/v0.1.1 with

remotes::install_github("a-b-street/abstr", ref = "v0.1.1")

Ideally the codebase of the latest version should work with our codebase but that will require allowing origin and destination zone arguments. The best way to fix that is upstream in ITSLeeds/od#33 I think. Let me know Nathanael/anyone if you fancy a coding challenge, this is a big one so just asking questions and testing things will help here.

Cran urls

URL fixes to make for cran rerelease

  • Description file
  • ReadMe.html

Vignette: Walking only city

A more playful vignette detailing the range of scenarios you can build using abstr.

Thoughts: it would be nice to have an example not from the UK or US

Finish the 'Activity models' vignette

After #23 and #75 I'm pretty happy with how this is looking: https://a-b-street.github.io/abstr/articles/activity.html

It shows a simple example of someone travelling from home to work, and then walking for lunch and leisure, and then cycling back home again.

It imports great into A/B Street 🎉

Peek 2021-09-13 21-22

But I think there are a few unfinished things with this vignette, e.g.:

  • Show an example with more agents, e.g. with the Sao Paulo data produced by @lucasccdias (let me know if you're up for giving that a go Lucas)
  • Add commands in A/B Street to load the data
  • Visualising activity patterns dynamically before A/B Street import, e.g. with ab_animate() and ab_interactive() functions, as discussed with @natesheehan and as touched on here: geocompx/geocompkg#29
  • Anything else

Reduce dependencies

Currently the package has many dependencies. There are advantages of depending on fewer things so will aim to follow the 'tinyverse' principles: http://www.tinyverse.org/

First package on the hit list: dplyr which is big, has many sub-dependencies and takes a long time to install.

Too many warnings

Although these are relatively harmlessly warning of potential issues associated with geographic data on unprojected data they massively detract from the user experience and have no bearing on the operations being undertaken so suggest suppressing them.

Example from the docs:

remotes::install_github("a-b-street/abstr")
#> Using github PAT from envvar GITHUB_PAT
#> Skipping install of 'abstr' from a github remote, the SHA1 (060b8991) has not changed since last install.
#>   Use `force = TRUE` to force installation
library(abstr)
dslines = leeds_desire_lines
ablines = ab_scenario(
  leeds_houses,
  leeds_buildings,
  dslines,
  leeds_zones,
  output_format = "sf"
)
#> although coordinates are longitude/latitude, st_within assumes that they are planar
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in ab_scenario(leeds_houses, leeds_buildings, dslines, leeds_zones, :
#> Mismatch between n. trips and population. Check your data
#> although coordinates are longitude/latitude, st_within assumes that they are planar
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in ab_scenario(leeds_houses, leeds_buildings, dslines, leeds_zones, :
#> Mismatch between n. trips and population. Check your data
#> although coordinates are longitude/latitude, st_within assumes that they are planar
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in ab_scenario(leeds_houses, leeds_buildings, dslines, leeds_zones, :
#> Mismatch between n. trips and population. Check your data
#> although coordinates are longitude/latitude, st_within assumes that they are planar
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in ab_scenario(leeds_houses, leeds_buildings, dslines, leeds_zones, :
#> Mismatch between n. trips and population. Check your data
#> although coordinates are longitude/latitude, st_within assumes that they are planar
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in ab_scenario(leeds_houses, leeds_buildings, dslines, leeds_zones, :
#> Mismatch between n. trips and population. Check your data
#> although coordinates are longitude/latitude, st_within assumes that they are planar
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in ab_scenario(leeds_houses, leeds_buildings, dslines, leeds_zones, :
#> Mismatch between n. trips and population. Check your data
#> although coordinates are longitude/latitude, st_within assumes that they are planar
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in ab_scenario(leeds_houses, leeds_buildings, dslines, leeds_zones, :
#> Mismatch between n. trips and population. Check your data
#> although coordinates are longitude/latitude, st_within assumes that they are planar
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in ab_scenario(leeds_houses, leeds_buildings, dslines, leeds_zones, :
#> Mismatch between n. trips and population. Check your data
#> although coordinates are longitude/latitude, st_within assumes that they are planar
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in ab_scenario(leeds_houses, leeds_buildings, dslines, leeds_zones, :
#> Mismatch between n. trips and population. Check your data
ablines_dutch = ab_scenario(
  leeds_houses,
  leeds_buildings,
  dslines,
  leeds_zones,
  scenario = "dutch",
  output_format = "sf"
)
#> although coordinates are longitude/latitude, st_within assumes that they are planar
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in ab_scenario(leeds_houses, leeds_buildings, dslines, leeds_zones, :
#> Mismatch between n. trips and population. Check your data
#> although coordinates are longitude/latitude, st_within assumes that they are planar
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> although coordinates are longitude/latitude, st_within assumes that they are planar
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x

#> Warning in st_centroid.sf(.): st_centroid does not give correct centroids for
#> longitude/latitude data
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> although coordinates are longitude/latitude, st_within assumes that they are planar
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x

#> Warning in st_centroid.sf(.): st_centroid does not give correct centroids for
#> longitude/latitude data
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> although coordinates are longitude/latitude, st_within assumes that they are planar
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x

#> Warning in st_centroid.sf(.): st_centroid does not give correct centroids for
#> longitude/latitude data
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in ab_scenario(leeds_houses, leeds_buildings, dslines, leeds_zones, :
#> Mismatch between n. trips and population. Check your data
#> although coordinates are longitude/latitude, st_within assumes that they are planar
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in ab_scenario(leeds_houses, leeds_buildings, dslines, leeds_zones, :
#> Mismatch between n. trips and population. Check your data
#> although coordinates are longitude/latitude, st_within assumes that they are planar
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> although coordinates are longitude/latitude, st_within assumes that they are planar
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x

#> Warning in st_centroid.sf(.): st_centroid does not give correct centroids for
#> longitude/latitude data
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in ab_scenario(leeds_houses, leeds_buildings, dslines, leeds_zones, :
#> Mismatch between n. trips and population. Check your data
#> although coordinates are longitude/latitude, st_within assumes that they are planar
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
#> Warning in st_centroid.sfc(st_geometry(x), of_largest_polygon =
#> of_largest_polygon): st_centroid does not give correct centroids for longitude/
#> latitude data
#> Warning in ab_scenario(leeds_houses, leeds_buildings, dslines, leeds_zones, :
#> Mismatch between n. trips and population. Check your data
library(sf)
#> Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 7.0.0
plot(ablines["mode_base"], key.pos = 1, reset = FALSE)
plot(dslines$geometry, lwd = dslines[[3]] / 30, add = TRUE)
plot(leeds_site_area$geometry, add = TRUE)
plot(leeds_buildings$geometry, add = TRUE)

plot(ablines_dutch["mode_dutch"], key.pos = 1)

Created on 2021-02-10 by the reprex package (v1.0.0)

New example

The default place that you go to in the A/B Street sandbox is Montlake and Eastlake. I think it would be cool to have OD data from there in the reproducible demo so it's easy to see the translation from geographic desire lines in R/GIS to agents in A/B Street without custom maps like Leeds.

Only question: where to get OD data for the study area?

Example for ab_sf_to_json() not working (lacking mode)

remotes::install_github("a-b-street/abstr")
#> Using github PAT from envvar GITHUB_PAT
#> Skipping install of 'abstr' from a github remote, the SHA1 (26af649c) has not changed since last install.
#>   Use `force = TRUE` to force installation
library(abstr)
ablines = ab_scenario(
  leeds_houses,
  leeds_buildings,
  leeds_desire_lines,
  leeds_zones,
  output_format = "sf"
)
ab_list = ab_sf_to_json(ablines, mode_column = "mode_base")
#> Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 7.0.0
ab_list$scenario
#> [1] "base"
ab_list$people$trips[[1]]
#> # A tibble: 1 x 4
#>   departure destination$Position$longitude destination$$latitude mode  purpose 
#>       <dbl>                          <dbl>                 <dbl> <chr> <chr>   
#> 1     30933                          -1.57                  53.8 Drive Shopping
dutch = ab_scenario(
  leeds_houses,
  leeds_buildings,
  leeds_desire_lines,
  leeds_zones,
  scenario = "godutch",
  output_format = "sf"
)
ab_list = ab_sf_to_json(dutch, mode_column = "mode_godutch")
ab_list$scenario
#> [1] "godutch"
str(ab_list$people$trips[[9]])
#> tibble [1 × 4] (S3: tbl_df/tbl/data.frame)
#>  $ departure  : num 29288
#>  $ destination: tibble [1 × 1] (S3: tbl_df/tbl/data.frame)
#>   ..$ Position:'data.frame': 1 obs. of  2 variables:
#>   .. ..$ longitude: num -1.56
#>   .. ..$ latitude : num 53.8
#>  $ mode       : chr "Walk"
#>  $ purpose    : chr "Shopping"
# add times
dutch$departure = ab_time_normal(hr = 1, sd = 0, n = nrow(dutch))
ab_list_times = ab_sf_to_json(dutch)
str(ab_list_times$people$trips[[9]])
#> tibble [1 × 4] (S3: tbl_df/tbl/data.frame)
#>  $ departure  : num 3600
#>  $ destination: tibble [1 × 1] (S3: tbl_df/tbl/data.frame)
#>   ..$ Position:'data.frame': 1 obs. of  2 variables:
#>   .. ..$ longitude: num -1.56
#>   .. ..$ latitude : num 53.8
#>  $ mode       : NULL
#>  $ purpose    : chr "Shopping"

Created on 2021-02-25 by the reprex package (v1.0.0)

Create demo video

  • Make streaming service account
  • Record video of import process
  • Add link to README and getting started

Update readme map plot

  • Find the best OD pairs to provide a wider map plot for the README example.
  • Make pretty using tmap

Multi-destination trips

Currently only single desire lines to single trips are supported. You can work around this by creating multiple desire lines but would be good to be able to represent a full day of activity, e.g. home -> work -> lunch in a cafe -> work -> home in an sf -> json object. Not sure best way of implementing it but sure it's possible.

Regenerate actdev scenarios

As a followup to #19, we need to regenerate the scenario JSON files for actdev -- https://github.com/cyipt/actdev/blob/main/data-small/allerton-bywater/scenario_base.json and the others. Wasn't sure whether to file that issue here or in the actdev repo. Until then, the base & go active scenarios in A/B Street will disappear, because I also made an internal binary format change that requires me to regenerate from the actdev repo's JSON. (This won't affect the live actdev deployment, of course, but it blocks updating it.)

Move to a-b-street org

Heads-up @dabreegster, we have a working package!

Not ready yet but shouldn't take too much work and I'm up for porting it when it gets to a point that it could be useful for others.

Montlake json file is leftover

From CRAN checks:

Non-standard file/directory found at top level:
  'montlake_scenarios.json'

Solution:

file.remove("montlake_scenarios.json

or similar...

Release to CRAN

Get abstr released to CRAN 🎉

  • Run R CMD check and fix any issues
  • Test for all environments
  • Update documentation
  • Define release version
  • Create badge?
  • Update news.md
  • Update cran-comments.md
  • Send to CRAN

@Robinlovelace anything else we should add to this checklist?

ab_scenario does not work with leeds_ data

This issue is effecting cyipt/actdev#177 to rebuild abstreet json file from actdev.

It can be reporduced by the example method :

library(abstr)
ab_scenario_list = ab_scenario(
 leeds_houses,
 leeds_buildings,
 leeds_desire_lines,
 leeds_zones,
 output_format = "json_list"
)
#> Error in `[.data.frame`(od, c(names(od)[1:2], modes)): undefined columns selected
Created on 2021-07-09 by the reprex package

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.