-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Milestone
Description
encode()
Example 1:
NA inputs round-tripped through encode/decode return numeric lat/lon coordinates.
df <- data.frame(lat = c(NA_real_), lon = c(NA_real_))
(res <- googlePolylines::encode(df))
#> [1] ">>"
googlePolylines::decode(res)
#> [[1]]
#> lat lon
#> 1 -0.00016 -0.00016Example 2:
Data frame with four observations round-tripped through encode/decode returns a data frame with only three observations.
df <- data.frame(lat = c(38.5, 40.7, NA_real_, 43.252),
lon = c(-120.2, -120.95, NA_real_, -126.453))
(res <- googlePolylines::encode(df))
#> [1] "_p~iF~ps|U_ulLnnqC_\016\x9e\xd7"
googlePolylines::decode(res)
#> [[1]]
#> lat lon
#> 1 38.5000 -120.200
#> 2 40.7000 -120.950
#> 3 40.7024 -120.954Metadata
Metadata
Assignees
Labels
No labels