Queries ScienceBase based on a spatial bounding box. Accepts either an sp spatial data object (uses the spatial object's bounding box) or long/lat coordinates defining the bounding box limits.
Arguments
- bbox
An sf spatial data object. The bounding box of the object is used for the query.
- long
A vector of longitude values that will define the boundaries of a bounding box. Min and Max of supplied longitudes are used. (alternate option to bbox).
- lat
A vector of latitude values that will define the boundaries of a bounding box. Min and Max of supplied latitude are used. (alternate option to bbox).
- bb_wkt
A character string using the Well Known Text (WKT) standard for defining spatial data. Must be a POLYGON WKT object.
- ...
Additional parameters are passed on to
GET
- limit
Maximum number of returned items. Will do paging to retrieve results when limit is over 1000. Use with caution, queries 10k results are slow.
Examples
# \donttest{
#specify the latitude and longitude points to define the bounding box range.
# This is simply bottom left and top right points
query_sb_spatial(long=c(-104.4, -95.1), lat=c(37.5, 41.0), limit=3)
#> [[1]]
#> <ScienceBase Item>
#> Title: Rock Cuttings for HEIN 1 by HEATHMAN and SEELIGSON DRILLING CO.
#> Creator/LastUpdatedBy: /
#> Provenance (Created / Updated): /
#> Children:
#> Item ID: 5bdcb55ce4b0b3fc5cf09147
#> Parent ID: 4f4e49cce4b07f02db5d8ee6
#>
#> [[2]]
#> <ScienceBase Item>
#> Title: Rock Cuttings for TERRELL 1 by BROOKS HALL and JONES, SHELBURNE, and FARMER
#> Creator/LastUpdatedBy: /
#> Provenance (Created / Updated): /
#> Children:
#> Item ID: 5bdcb679e4b0b3fc5cf0b558
#> Parent ID: 4f4e49cce4b07f02db5d8ee6
#>
#> [[3]]
#> <ScienceBase Item>
#> Title: Drilling/Completion Reports for water well owned by Green, Michael; Kansas WWC5 form
#> Creator/LastUpdatedBy: /
#> Provenance (Created / Updated): /
#> Children:
#> Item ID: 5b1163dbe4b092d9651b5883
#> Parent ID: 4f4e49d8e4b07f02db5df2a1
#>
#use a pre-formatted WKT polygon to grab data
query_sb_spatial(bb_wkt="POLYGON((-104.4 41.0,-95.1 41.0,-95.1 37.5,-104.4 37.5,-104.4 41.0))",
limit=3)
#> [[1]]
#> <ScienceBase Item>
#> Title: Rock Cuttings for HEIN 1 by HEATHMAN and SEELIGSON DRILLING CO.
#> Creator/LastUpdatedBy: /
#> Provenance (Created / Updated): /
#> Children:
#> Item ID: 5bdcb55ce4b0b3fc5cf09147
#> Parent ID: 4f4e49cce4b07f02db5d8ee6
#>
#> [[2]]
#> <ScienceBase Item>
#> Title: Rock Cuttings for TERRELL 1 by BROOKS HALL and JONES, SHELBURNE, and FARMER
#> Creator/LastUpdatedBy: /
#> Provenance (Created / Updated): /
#> Children:
#> Item ID: 5bdcb679e4b0b3fc5cf0b558
#> Parent ID: 4f4e49cce4b07f02db5d8ee6
#>
#> [[3]]
#> <ScienceBase Item>
#> Title: Drilling/Completion Reports for water well owned by Green, Michael; Kansas WWC5 form
#> Creator/LastUpdatedBy: /
#> Provenance (Created / Updated): /
#> Children:
#> Item ID: 5b1163dbe4b092d9651b5883
#> Parent ID: 4f4e49d8e4b07f02db5df2a1
#>
# }