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

Bbox not working as documented #16

Closed sverhoeven closed 1 year ago

sverhoeven commented 1 year ago

I am trying to download data for a certain bounding box.

I installed the latest version of rppo and tried to run the following code:

r2 <- ppo_data(fromDay = 1, toDay = 100, bbox="37,-120,38,-119", limit=10,
+ timeLimit = 4)
sending request for data ...
https://biscicol.org/api/v3/download/_search?q=+dayOfYear:<=1++AND+++dayOfYear:<=100++AND+++latitude:>=-120+AND++latitude:<=37+AND++longitude:>=-120+AND++longitude:<=-119++AND+++source:USA-NPN&limit=10
> r2
$data
   dayOfYear year    genus specificEpithet              eventRemarks latitude
1          1 2016  Quercus       agrifolia        Breaking leaf buds 36.20301

This first data point is outside my bbox.

The spatial query seems wrong, I expected:

latitude:>=37+AND++latitude:<=38+AND++longitude:>=-120+AND++longitude:<=-119