validate_shape_geometry: Function to quickly validate whether an input shape_geometry...

View source: R/gtfs_validation.R

validate_shape_geometryR Documentation

Function to quickly validate whether an input shape_geometry meets needs

Description

Checks:

  • Class (should be SF, not SFC)

  • Geometry type (i.e., is multilinestring)

  • Presence of shape_id column, if desired

  • Number of shapes present, if desired

  • Correct CRS, if desired

Usage

validate_shape_geometry(
  shape_geometry,
  max_length = Inf,
  require_shape_id = TRUE,
  match_crs = NULL
)

Arguments

shape_geometry

SF multilinestring

max_length

numeric of max number of objects in SF

require_shape_id

should shape ID be required in SF?

match_crs

CRS that SF should have

Details

Not intended for external use.

Value

Throws error if not satisfied


transittraj documentation built on Nov. 2, 2026, 1:10 a.m.