gps_as_sfpoints: Convert GPS-like data.table to a Simple Feature points object

View source: R/gps_as_sfpoints.R

gps_as_sfpointsR Documentation

Convert GPS-like data.table to a Simple Feature points object

Description

Convert a GPS data stored in a data.table into Simple Feature points.

Usage

gps_as_sfpoints(gps, crs = 4326)

Arguments

gps

A data.table with timestamp data.

crs

A Coordinate Reference System. The default value is 4326 (latlong WGS84).

Value

A simple feature (sf) object with point data.

Examples

library(gtfs2gps)

fortaleza <- read_gtfs(system.file("extdata/fortaleza.zip", package = "gtfs2gps"))
srtmfile <- system.file("extdata/fortaleza-srtm.tif", package="gtfs2gps")

subset <- fortaleza |>
  gtfstools::filter_by_weekday(c("monday", "wednesday")) |>
  filter_single_trip() |>
  gtfstools::filter_by_shape_id("shape806-I")

for_gps <- gtfs2gps(subset)
for_gps_sf_points <- gps_as_sfpoints(for_gps)

ipeaGIT/gtfs2gps documentation built on Oct. 13, 2024, 6:34 p.m.