Skip to content
Merged

v1.0 #99

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
(^|/)venv(/.*)?$
LICENSE.md
CITATION.cff
^doc$
^Meta$
^scratch$
cache
(^|/)[^/]*cache[^/]*(/.*)?$
Expand Down
4 changes: 4 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ authors:
- family-names: Félix
given-names: Rosa
orcid: 'https://orcid.org/0000-0002-5642-6006'
dentifiers:
- type: doi
value: 10.32614/CRAN.package.GTFShift
description: CRAN
repository-code: 'https://github.com/U-Shift/GTFShift'
url: 'https://u-shift.github.io/GTFShift/'
abstract: 'GTFShift encompasses a complete bundle of methods to harmonize GTFS and OSM data, enabling the integration and exploration of different layers of transit data, starting with the planned operations (GTFS), but also the infrastructure topology (OSM) and real-time information (GTFS-RT).'
Expand Down
5 changes: 2 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Type: Package
Package: GTFShift
Title: Explore and Analyse General Transit Feed Specification (GTFS) Files
with a Focus on Urban Mobility
Version: 0.12.0
Version: 1.0.0
Authors@R: c(
person(c("Gonçalo", "F."), "Matos", , "goncaloafmatos@tecnico.pt", role = c("aut", "cre"),
comment = c(ORCID = "0009-0001-3489-1732")),
Expand Down Expand Up @@ -57,7 +57,6 @@ Suggests:
VignetteBuilder:
knitr
Config/Needs/website: rmarkdown
Config/roxygen2/version: 8.0.0
Config/roxygen2/version: 8.1.0
Encoding: UTF-8
Language: en-US
RoxygenNote: 7.3.3
56 changes: 35 additions & 21 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,42 @@ import(rlang)
import(sf)
import(tidytransit)
importFrom(callr,r_bg)
importFrom(gtfstools,convert_sf_to_shapes)
importFrom(gtfstools,merge_gtfs)
importFrom(httr,GET)
importFrom(httr,POST)
importFrom(httr,add_headers)
importFrom(httr,content)
importFrom(httr,http_error)
importFrom(httr,http_status)
importFrom(httr,status_code)
importFrom(jsonlite,fromJSON)
importFrom(jsonlite,write_json)
importFrom(gtfstools,
convert_sf_to_shapes,
merge_gtfs
)
importFrom(httr,
GET,
POST,
add_headers,
content,
http_error,
http_status,
status_code
)
importFrom(jsonlite,
fromJSON,
write_json
)
importFrom(purrr,map_dfr)
importFrom(rlang,.data)
importFrom(stats,setNames)
importFrom(stats,weighted.mean)
importFrom(stringr,regex)
importFrom(stringr,str_detect)
importFrom(stats,
setNames,
weighted.mean
)
importFrom(stringr,
regex,
str_detect
)
importFrom(tidyr,unnest)
importFrom(tidyselect,any_of)
importFrom(utils,head)
importFrom(utils,tail)
importFrom(utils,write.table)
importFrom(xml2,read_xml)
importFrom(xml2,xml_attr)
importFrom(xml2,xml_find_all)
importFrom(utils,
head,
tail,
write.table
)
importFrom(xml2,
read_xml,
xml_attr,
xml_find_all
)
2 changes: 2 additions & 0 deletions R/create_shapes_from_sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#' \code{shape_dist_traveled} if \code{shape_dist_traveled = TRUE}.
#'
#' @examples
#' \donttest{
#' # Load sample GTFS
#' gtfs <- GTFShift::load_feed(system.file("extdata/samples",
#' "gtfs_tcb_sample.zip", package = "GTFShift")
Expand All @@ -49,6 +50,7 @@
#' )
#'
#' head(shapes_txt)
#' }
#'
#' @import sf
#' @importFrom gtfstools convert_sf_to_shapes
Expand Down
2 changes: 2 additions & 0 deletions R/multiline_to_sorted_linestring.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#' @returns sfc. LINESTRING geometry object.
#'
#' @examples
#' \donttest{
#' # Get OSM route geometries (MULTILINESTRING)
#' osm_routes <- sf::st_read(
#' system.file("extdata/samples", "osm_routes_tcb.gpkg", package = "GTFShift"),
Expand All @@ -73,6 +74,7 @@
#' )
#'
#' head(osm_routes)
#' }
#'
#' @import dplyr
#' @import sf
Expand Down
2 changes: 2 additions & 0 deletions R/network_overline.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#' @returns sf. Spatial network object extended with aggregated values.
#'
#' @examples
#' \donttest{
#' # Subset GTFS for one route only, for demo purposes
#' gtfs <- GTFShift::load_feed(system.file("extdata/samples",
#' "gtfs_tcb_sample.zip", package = "GTFShift")
Expand Down Expand Up @@ -55,6 +56,7 @@
#' })
#'
#' head(overline |> st_drop_geometry())
#' }
#'
#' @seealso \code{stplanr::rnet_join()}
#'
Expand Down
6 changes: 4 additions & 2 deletions R/query_osm_centerlines.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
#' This method was adapted from \href{https://uscuni.org/neatnet/intro.html}{uscuni.org/neatnet}
#' by \href{https://github.com/miguelrelvaspires}{Miguel Relvas Pires} in the scope of
#' his \href{https://scholar.tecnico.ulisboa.pt/records/DhKWeFU5YLpMDcOhQbKR4f7ul05HCQnZr7ND}{master's thesis}.
#' The full code (Python) of his work is openly available at
#' The full code (Python) of his work is openly available at
#' \href{https://github.com/U-Shift/lp_streets}{GitHub}.
#'
#' @returns sf data.frame. OSM centerlines.
#'
#' @examplesIf reticulate::py_module_available("neatnet")
#' @examples
#' \dontrun{
#' # Get sample OSM extract
#' osm_file <- system.file("extdata/samples", "relation_6384187.pbf", package = "GTFShift")
#'
Expand All @@ -35,6 +36,7 @@
#' head(network)
#'
#' table(network$X_status)
#' }
#'
#' @author \href{https://github.com/miguelrelvaspires}{Miguel Relvas Pires}
#'
Expand Down
3 changes: 3 additions & 0 deletions R/rt_average_speed.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
#' }
#'
#' @examples
#' \donttest{
#' # Get GTFS-RT data collection
#' rt_collect_file <- system.file(
#' "extdata/samples", "gtfs_rt_sample_tcb_4_4-CS-TERM.csv", package = "GTFShift"
Expand Down Expand Up @@ -112,6 +113,8 @@
#' )
#'
#' nrow(speed)
#' }
#'
#'
#' @seealso \code{GTFShift::project_points_along_geometry()}
#' @seealso \code{GTFShift::multiline_to_sorted_linestring()}
Expand Down
2 changes: 2 additions & 0 deletions R/rt_collect_protobuf.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#' @returns String. The location of the file where data was collected.
#'
#' @examples
#' \dontrun{
#' # Create file
#' destination_file <- withr::local_tempfile(fileext = ".csv")
#'
Expand All @@ -35,6 +36,7 @@
#' collection |>
#' dplyr::select("vehicle.trip.trip_id", "vehicle.position.latitude", "vehicle.position.longitude")
#' )
#' }
#'
#' @importFrom jsonlite write_json
#' @importFrom stats setNames
Expand Down
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
# GTFShift <img align="right" src="man/figures/logo.png" alt="logo" width="180">

<!-- badges: start -->
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.21292010.svg)](https://doi.org/10.5281/zenodo.21292010) [![](https://github.com/U-Shift/GTFShift/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/U-Shift/GTFShift/actions/workflows/R-CMD-check.yaml) [![codecov](https://codecov.io/gh/U-Shift/GTFShift/graph/badge.svg?token=RWVWEGGOF8)](https://codecov.io/gh/U-Shift/GTFShift)
[![CRAN status](https://www.r-pkg.org/badges/version/GTFShift)](https://cran.r-project.org/package=GTFShift/)
[![Project Status: Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![CRAN downloads total](https://cranlogs.r-pkg.org/badges/grand-total/GTFShift?color=lightgrey)](https://cran.r-project.org/package=GTFShift)
[![](https://github.com/U-Shift/GTFShift/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/U-Shift/GTFShift/actions/workflows/R-CMD-check.yaml)
[![codecov](https://codecov.io/gh/U-Shift/GTFShift/graph/badge.svg?token=RWVWEGGOF8)](https://codecov.io/gh/U-Shift/GTFShift)
<!-- badges: end -->

**GTFShift** encompasses a complete bundle of methods to harmonize GTFS and OSM data, enabling the integration and exploration of different layers of transit data, starting with the planned operations (GTFS), but also the infrastructure topology (OSM) and real-time information (GTFS-RT).

## Installation

You can install the development version of **GTFShift** from
[GitHub](https://github.com/) with:
You can install the stable version of **GTFShift** from CRAN:

``` r
install.packages('GTFShift')
```

For the development version, fetch from GitHub:

``` r
# install.packages("remotes")
Expand All @@ -33,7 +42,7 @@ For more details on the package and how to get started, please visit the [Get st

The lack of standardization on GTFS shape geometries hampers aggregated analysis of different feeds and the association of planned service information with other urban dimensions such as the infrastructure topology.

To solve this problem, **GTFShift** provides a bundle of methods to harmonize GTFS shapes with OSM road network geometries. Refer to [Get OSM data for bus routes](articles/osm.html#get-osm-data-for-bus-routes) and [Generate GTFS with OSM geometries](articles/gtfs_from_osm.html) for more details.
To solve this problem, **GTFShift** provides a bundle of methods to harmonize GTFS shapes with OSM road network geometries. Refer to [Get OSM data for bus routes](https://u-shift.github.io/GTFShift/articles/osm.html#get-osm-data-for-bus-routes) and [Generate GTFS with OSM geometries](https://u-shift.github.io/GTFShift/articles/gtfs_from_osm.html) for more details.

![](man/figures/geometry_harmonization_barreiro.png)

Expand Down Expand Up @@ -67,9 +76,9 @@ a minimum frequency of 10 buses/hour, average speed below 9.7 km/h and more than
**GTFShift** provides an interactive dashboard that allows users to explore and visualize results for real case studies,
aiming to illustrate its potential and capabilities to a non-technical audience, while disseminating the outputs of these real world scenarios.

Visit it at [ushift.pt/apps/gtfshift](https://ushift.pt/apps/gtfshift).
Visit it at [ushift.pt/apps/gtfshift](https://ushift.tecnico.ulisboa.pt/apps/gtfshift/).

[![](man/figures/web.png)](https://ushift.pt/apps/gtfshift)
[![](man/figures/web.png)](https://ushift.tecnico.ulisboa.pt/apps/gtfshift/)

## Related packages

Expand Down
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ navbar:
components:
dashboard:
text: "Bus lane prioritisation dashboard"
href: "https://ushift.pt/apps/gtfshift"
href: "https://ushift.tecnico.ulisboa.pt/apps/gtfshift/"
target: "_blank"


Expand Down
2 changes: 2 additions & 0 deletions man/create_shapes_from_sf.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/multiline_to_sorted_linestring.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/network_overline.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions man/osm_centerlines.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/rt_average_speed.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion man/rt_collect_protobuf.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading