ropensci / rppo

R package for accessing PPO data store
https://docs.ropensci.org/rppo
BSD 3-Clause "New" or "Revised" License
3 stars 5 forks source link

Fix bbox string to query conversion #17

Closed sverhoeven closed 1 year ago

sverhoeven commented 1 year ago

Fixes #16

Tested with

r2 <- ppo_data(bbox="37,-120,38,-119", limit=10,timeLimit = 4)
sending request for data ...
https://biscicol.org/api/v3/download/_search?q=+latitude:>=37+AND++latitude:<=38+AND++longitude:>=-120+AND++longitude:<=-119++AND+++source:USA-NPN&limit=10
> head(r2$data)
  dayOfYear year    genus    specificEpithet
1        54 1972 Lonicera korolkowii-zabelii
2       100 1971 Lonicera korolkowii-zabelii
3        92 1972 Lonicera korolkowii-zabelii
4       130 1973 Lonicera korolkowii-zabelii
5       108 1974 Lonicera korolkowii-zabelii
6       126 1980 Lonicera korolkowii-zabelii
                            eventRemarks latitude longitude
1 Full leaf (historic lilac/honeysuckle)    37.10   -119.48

The first point is within the bbox.