Huh / collar

Utilities for exploring telemetry data
Other
7 stars 9 forks source link

Vectronics data_after_id and start_date options don't work #34

Closed foresthayes closed 5 years ago

foresthayes commented 5 years ago

The fetch_vectronics function returns a data frame of errors when using either the after_data_id or start_date options.

Example output using either option:

df$timestamp = 2019-05-16T03:26:38.404+0000 df$status = 400 df$error = Bad Request df$message = "Failed to convert value of type 'java.lang.String' to required type 'java.lang.Long'; nested exception is java.lang.NumberFormatException: For input string: \"4e06\"" df$path = /collar/*****/gps

Due to the length of time (often) required to download all locations from Vectronics' servers this should be a high priority to resolve.

Huh commented 5 years ago

Is this resolved?

The java.lang.String basically reflects the fact that they changed how they want dates formatted. I changed the function in the package in the last pull request and documented it in the vignette as well.

I think this works, but if @foresthayes could verify that would be great.

foresthayes commented 5 years ago

The after_data_id option now works as intended.

The start_date and which_date arguments do not appear to actually do anything.

For example, in my test:

after <- format(Sys.Date() - 10, "%Y-%m-%dT%H:%M:%S")

tmp1 <- collar::fetch_vectronics(key_dir = "./CollarKeyFiles/test")
tmp2 <- collar::fetch_vectronics(key_dir = "./CollarKeyFiles/test",
                                 start_date = after,
                                 which_date = "acquisition")
identical(
  dplyr::arrange(tmp1, idPosition),
  dplyr::arrange(tmp2, idPosition),
)

The two data sets produced are identical (although the initial row order is different).

Huh commented 5 years ago

Ok, I will revisit, but I am not sure this is our error.

Huh commented 5 years ago

Vectronics changed the URL and added /v2/ before collar. The package now uses the v2 version.

The identical() function won't work for this situation. I can't tell you why exactly, but the data are the "same". We can explore that more later.