Skip to contents

See tibble::as_tibble for details.

After tuning a query, collect() is used to actually bring the data into memory. This will retrieve an sf object into R. The as_tibble() function can be used interchangeably with collect which matches dbplyr behaviour.

See dplyr::collect for details.

Usage

# S3 method for bcdc_promise
collect(x, ...)

# S3 method for bcdc_promise
as_tibble(x, ...)

Arguments

x

object of class bcdc_promise

Examples

# \donttest{
try(
  bcdc_query_geodata("bc-airports") %>%
    collect()
)
#> Error : There was an issue sending this WFS request
#> ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
#> Request:
#>   URL: https://openmaps.gov.bc.ca/geo/pub/wfs
#>   POST fields:
#>     resultType=hits&SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&outputFormat=application%2Fjson&typeNames=WHSE_IMAGERY_AND_BASE_MAPS.GSR_AIRPORTS_SVW&SRSNAME=EPSG%3A3005
#>   Content-Type: application/x-www-form-urlencoded
#>   Accept-Encoding: gzip, deflate
#>   Accept: application/json, text/xml, application/xml, */*
#>   User-Agent: https://github.com/bcgov/bcdata
#> Response:
#>   status: HTTP/1.1 503
#>   date: Tue, 05 Jul 2022 21:22:25 GMT
#>   server: Apache
#>   x-frame-options: allow-from (null)
#>   x-control-flow-delay-ms: 60001
#>   content-type: text/html;charset=utf-8
#>   content-language: en
#>   content-length: 1201
#>   access-control-allow-origin: (null)
#>   access-control-allow-credentials: true
#>   access-control-allow-methods: POST, GET, OPTIONS, HEAD
#>   access-control-allow-headers: X-Requested-With, Referer, Origin, Content-Type, SOAPAction, Authorization, Accept
#>   access-control-max-age: 1000
#>   connection: close
#> 

try(
  bcdc_query_geodata("bc-airports") %>%
    as_tibble()
)
#> Error : There was an issue sending this WFS request
#> ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
#> Request:
#>   URL: https://openmaps.gov.bc.ca/geo/pub/wfs
#>   POST fields:
#>     resultType=hits&SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&outputFormat=application%2Fjson&typeNames=WHSE_IMAGERY_AND_BASE_MAPS.GSR_AIRPORTS_SVW&SRSNAME=EPSG%3A3005
#>   Content-Type: application/x-www-form-urlencoded
#>   Accept-Encoding: gzip, deflate
#>   Accept: application/json, text/xml, application/xml, */*
#>   User-Agent: https://github.com/bcgov/bcdata
#> Response:
#>   status: HTTP/1.1 503
#>   date: Tue, 05 Jul 2022 21:23:26 GMT
#>   server: Apache
#>   x-frame-options: allow-from (null)
#>   x-control-flow-delay-ms: 60004
#>   content-type: text/html;charset=utf-8
#>   content-language: en
#>   content-length: 1201
#>   access-control-allow-origin: (null)
#>   access-control-allow-credentials: true
#>   access-control-allow-methods: POST, GET, OPTIONS, HEAD
#>   access-control-allow-headers: X-Requested-With, Referer, Origin, Content-Type, SOAPAction, Authorization, Accept
#>   access-control-max-age: 1000
#>   connection: close
#> 
# }