diff --git a/NEWS.md b/NEWS.md index efbd4a1..1c6f48f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ # pjutils 0.0.0.9006 * add coordinate transform funs +* add fun to transform df to gps echarts lines json data. # pjtuils 0.0.0.9005 diff --git a/R/coordinate_utils.R b/R/coordinate_utils.R index 7e44ad2..843bc49 100644 --- a/R/coordinate_utils.R +++ b/R/coordinate_utils.R @@ -186,7 +186,7 @@ bd2wgs <- function(bd_lon, bd_lat){ #' #' Your can see the package/inst/misc files. #' -#' @param df data.frame with starLon, starLat, endLon, endLat +#' @param df data.frame with starLon, starLat, endLon, endLat. #' #' @return json txt #' @export diff --git a/_pkgdown.yml b/_pkgdown.yml index 0c9a2d2..08c8152 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -69,6 +69,9 @@ reference: - gcj2bd - bd2gcj - bd2wgs + - title: Json format transform + contents: + - fmt_gps_json - title: Helper contents: - pjutils diff --git a/docs/news/index.html b/docs/news/index.html index fa2f68b..34522ef 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -126,6 +126,7 @@
Your can see the package/inst/misc files.
+ +fmt_gps_json(df)+ +
df | +data.frame with starLon, starLat, endLon, endLat. |
+
---|
json txt
+ + +# NOT RUN { +test <- select(df, startLon, startLat, endLon, endLat) +as_tibble(t(apply(test, 1, function(x) { + x <- as.numeric(x) + start_gps <- wgs2bd(x[1], x[2]) + end_gps <- wgs2bd(x[3], x[4]) + c(start_gps[1], start_gps[2], end_gps[1], end_gps[2]) +}))) +# }+
Generate GPS lines data for echarts
These objects are imported from other packages. Follow the links +below to see their documentation.
+%>%
data_frame
, as_data_frame
, add_row
, glimpse
, tibble
, as_tibble