Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the possibility to retrive data from iSCOUT #1

Open
agronomofiorentini opened this issue Sep 23, 2022 · 4 comments
Open

Add the possibility to retrive data from iSCOUT #1

agronomofiorentini opened this issue Sep 23, 2022 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@agronomofiorentini
Copy link

Dear creators,
I would like to know if it is possible to use this package to be able to get the data derived from iSCOUT, and if it is not possible I would like to ask if you could tell me how.

I am only interested in receiving a dataframe with data and images directly inside of shinyapp.

Thanks

@eduardszoecs
Copy link
Member

eduardszoecs commented Sep 23, 2022

Thanks @agronomofiorentini for your request.

We don't have an iSCOUT device for testing and do not provide a wrapper function for this endpoint.

But with fc_request() we have a workhorse in the package that could be used (and takes care of authorisation, error handling and parsing ).

The endpoint you're interested in is https://api.fieldclimate.com/v2/docs/#cameras-get-last-photos

So you could write a wrapper function along these lines (untested! so consider it as pseudocode):

get_image_url <- function(station_id = NULL, amount = 1L, camera = 1L, ...) {
  stopifnot(!is.null(station_id))
  stopifnot(is.integer(amount) && amount >= 1)
  stopifnot(is.integer(camera) && camera %in% c(0L, 1L, 2L))
  
  path <- file.path('/camera', station_id, "photos/last", amount, camera)
  fc_request(method = "GET", path = path, verbose = TRUE, ...)
}

If you have a working function / wrapper, we are happy to review a pull request.

@eduardszoecs eduardszoecs added enhancement New feature or request help wanted Extra attention is needed question Further information is requested and removed question Further information is requested labels Sep 23, 2022
@agronomofiorentini
Copy link
Author

I have tested your function and actually give me 404 error.

I have tried to use the /station/station-id and give me information about position and others informations.

Actually we can proceed by steps.

Firstly, i would get the data that contains:

  1. Date
  2. Number of insect

Then if it is possible get also the last image in order to be rendered in the web application.

@agronomofiorentini
Copy link
Author

Any news about this issue?

@eduardszoecs
Copy link
Member

No, as already mentioned we don't have an iSCOUT device for testing & development and cannot implement this without.
We are happy to review a pull request . if you can develop this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants