This is great. You are trying to get the output of a query right? I think it would be great to access the data themselves and be able to create summaries from raw.
I added library(jsonlite) and replaced the last chunk
library(httr)
library(rvest)
library(jsonlite)
#add your SMART Connect sign in page URL here
url<- âhttps://your_connect_url:8443/serverâ
#run this to log in to your SMART Connect server
session â session(url)
form â html_form(session)[[1]]
fl_fm â html_form_set(form,
j_username = âyour usernameâ,
j_password = âyour passwordâ)
main_page â session_submit(session, fl_fm)
#in SMART Connect, when you run a query, copy and paste the link
query_url <-session_jump_to(main_page, âyour_link_in_connect_to_a_fileâ) # ends in /file
data<- httr::content(query_url$response, as = âtextâ) %>% parse_json()
I did this quickly. the structure of the data output makes sense but I have not checked its content (but I got lat lon values at least)! This is how it looks:
$features
$features[[1]]
$features[[1]]$geometry
$features[[1]]$geometry$coordinates
$features[[1]]$geometry$coordinates[[1]]
[1] 11.5724
$features[[1]]$geometry$coordinates[[2]]
[1] -0.7248667
$features[[1]]$geometry$type
[1] âPointâ
$features[[1]]$properties
$features[[1]]$properties$altitude
[1] 0
$features[[1]]$properties$appName
[1] âMonitoreo Karukinkaâ
$features[[1]]$properties$ctVersion
[1] â1.0.433â
$features[[1]]$properties$dateTime
[1] â2022-11-11T12:01:22.888+01:00â
$features[[1]]$properties$deviceId
[1] â12210a5fe0a745a18f09a60ddd5a5279â
$features[[1]]$properties$id
[1] âae25a3a3ff934fa38ea70356588d57edâ
$features[[1]]$properties$latitude
[1] -0.7248667
$features[[1]]$properties$longitude
[1] 11.5724
$features[[1]]$properties$rootId
[1] âae25a3a3ff934fa38ea70356588d57edâ
$features[[1]]$properties$sighting
$features[[1]]$properties$sighting$SMART_3b27559ad9c545838f17fa2cb18b3833
[1] â6334d315768f4d04a4e482c50239d009â
$features[[1]]$properties$sighting$SMART_51c60fc7db4b4a28aa01cca596bbc359
[1] âc84e5ef2da2a40a09587c5ae7376999câ
$features[[1]]$properties$sighting$SMART_DataType
[1] âpatrolâ
$features[[1]]$properties$sighting$SMART_DefaultAttributeValues
[1] â{}â
$features[[1]]$properties$sighting$SMART_DefaultPatrolValues
[1] â{}â
$features[[1]]$properties$sighting$SMART_Leader
[1] âe:b99744b6eb214da182095afb66f73c06â
$features[[1]]$properties$sighting$SMART_Mandate
[1] âpm:35e1311ae48742a4acfbcde8fe246fd9â
$features[[1]]$properties$sighting$SMART_NewWaypoint
[1] TRUE
$features[[1]]$properties$sighting$SMART_ObsCounter
[1] 1
$features[[1]]$properties$sighting$SMART_ObservationType
[1] âNewPatrolâ
$features[[1]]$properties$sighting$SMART_PatrolID
[1] â03e41caf13654f449d587d123fc6323eâ
$features[[1]]$properties$sighting$SMART_PatrolStartDate
[1] â2022/11/11â
$features[[1]]$properties$sighting$SMART_PatrolStartTime
[1] â12:01:22â
$features[[1]]$properties$sighting$SMART_PatrolTransport
[1] âtt:58158398a8ff4c7dbc867f9e723c8a4câ
$features[[1]]$properties$sighting$SMART_Team
[1] âpt:2213a07880da4e3ca30b121bbd1b1a8câ
$features[[1]]$properties$sighting$e:b99744b6eb214da182095afb66f73c06
[1] TRUE
$features[[1]]$type
[1] âFeatureâ
$type
[1] âFeatureCollectionâ
I know patrols have at least 5 files so how to get the corresponding files into a consistent patrol data ⌠I donât know yet.
How to get the actual /files links wished by the user? I dunno yet.