Skip to content

Commit

Permalink
Merge pull request #102 from pedro-andrade-inpe/master
Browse files Browse the repository at this point in the history
More updates related to CRAN submission
  • Loading branch information
rafapereirabr authored Mar 6, 2020
2 parents 0c3be33 + 02454da commit f2cecd7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Type: Package
Package: gtfs2gps
Title: Converting Transport Data from GTFS Format to GPS-Like Records
Version: 1.0-4
Version: 1.0-5
Authors@R: c(person(given="Rafael H. M.", family="Pereira", email="[email protected]", role="aut", comment = c(ORCID = "0000-0003-2125-7465")),
person(given="Pedro R.", family="Andrade", email="[email protected]", role=c("aut", "cre"), comment = c(ORCID = "0000-0001-8675-4046")),
person(given="Joao", family="Bazzo", role="aut", comment = c(ORCID = "0000-0003-4536-5006")),
person("Ipea - Institue for Applied Economic Research", role = c("cph", "fnd")))
Date: 2020-02-27
Date: 2020-03-06
URL: https://github.com/ipeaGIT/gtfs2gps
BugReports: https://github.com/ipeaGIT/gtfs2gps/issues
Description: Convert General Transit Feed Specification (GTFS) data to Global Positioning System (GPS) records in 'data.table' format. It also has some functions to subset GTFS data in time and space and to convert both representations to simple feature format.
Description: Convert general transit feed specification (GTFS) data to global positioning system (GPS) records in 'data.table' format. It also has some functions to subset GTFS data in time and space and to convert both representations to simple feature format.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: TRUE
Expand Down
4 changes: 1 addition & 3 deletions R/gtfs_as_sf.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#' @param gtfs A GTFS data.
#' @param crs The coordinate reference system represented as an EPSG code.
#' The default value is 4326 (latlong WGS84)
#' @return A simple feature (sf) object.
#' @export
#' @examples
#' poa <- read_gtfs(system.file("extdata/saopaulo.zip", package = "gtfs2gps"))
#' poa_sf <- gtfs_shapes_as_sf(poa)
#' # plot(sf::st_geometry(poa_sf), lwd = 2)
gtfs_shapes_as_sf <- function(gtfs, crs = 4326){
# sort data
temp_shapes <- data.table::setDT(gtfs$shapes)[order(shape_id, shape_pt_sequence)]
Expand Down Expand Up @@ -40,8 +40,6 @@ gtfs_shapes_as_sf <- function(gtfs, crs = 4326){
#' poa <- read_gtfs(system.file("extdata/poa.zip", package = "gtfs2gps"))
#' poa_shapes <- gtfs_shapes_as_sf(poa)
#' poa_stops <- gtfs_stops_as_sf(poa)
#' # plot(sf::st_geometry(poa_shapes), lwd = 2)
#' # plot(sf::st_geometry(poa_stops), pch = 20, col = "blue", add = TRUE)
gtfs_stops_as_sf <- function(gtfs, crs = 4326){
temp_stops_sf <- sfheaders::sf_point(gtfs$stops, x = "stop_lon", y = "stop_lat", keep = TRUE)
sf::st_crs(temp_stops_sf) <- crs
Expand Down
4 changes: 3 additions & 1 deletion man/gtfs_shapes_as_sf.Rd

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

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

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

0 comments on commit f2cecd7

Please sign in to comment.