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 @@

pjutils 0.0.0.9006

diff --git a/docs/reference/fmt_gps_json.html b/docs/reference/fmt_gps_json.html new file mode 100644 index 0000000..246282c --- /dev/null +++ b/docs/reference/fmt_gps_json.html @@ -0,0 +1,187 @@ + + + + + + + + + + + + +Generate GPS lines data for echarts — fmt_gps_json • pjutils + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+ +
+
+ + +
+ +

Your can see the package/inst/misc files.

+ +
+ +
fmt_gps_json(df)
+ +

Arguments

+ + + + + + +
df

data.frame with starLon, starLat, endLon, endLat.

+ +

Value

+ +

json txt

+ + +

Examples

+
# 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])
+})))
+# }
+
+ +
+ + +
+ + + + + + diff --git a/docs/reference/index.html b/docs/reference/index.html index 2d7e141..155e937 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -230,6 +230,20 @@

+

Json format transform

+

+ + + + + +

fmt_gps_json()

+ +

Generate GPS lines data for echarts

+ @@ -257,6 +271,7 @@

Contents

  • Fill NA
  • Calculate AUC
  • Coordinate transform
  • +
  • Json format transform
  • Helper
  • diff --git a/docs/reference/reexports.html b/docs/reference/reexports.html new file mode 100644 index 0000000..ec678bf --- /dev/null +++ b/docs/reference/reexports.html @@ -0,0 +1,170 @@ + + + + + + + + + + + + +Objects exported from other packages — reexports • pjutils + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + +
    + +
    +
    + + +
    + +

    These objects are imported from other packages. Follow the links +below to see their documentation.

    +
    +
    magrittr

    %>%

    + +
    tibble

    data_frame, as_data_frame, add_row, glimpse, tibble, as_tibble

    +
    + +
    + + + +
    + +
    + + +
    + + + + + + diff --git a/man/fmt_gps_json.Rd b/man/fmt_gps_json.Rd index e484e64..36d4ab2 100644 --- a/man/fmt_gps_json.Rd +++ b/man/fmt_gps_json.Rd @@ -7,7 +7,7 @@ fmt_gps_json(df) } \arguments{ -\item{df}{data.frame with starLon, starLat, endLon, endLat} +\item{df}{data.frame with starLon, starLat, endLon, endLat.} } \value{ json txt