Skip to contents

Display Web Feature Service query CQL

See dplyr::show_query for details.

Usage

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

# S3 method for bcdc_sf
show_query(x, ...)

Arguments

x

object of class bcdc_promise or bcdc_sf

Methods (by class)

  • bcdc_promise: show_query.bcdc_promise

  • bcdc_sf: show_query.bcdc_promise

Examples

# \donttest{
try(
  bcdc_query_geodata("bc-environmental-monitoring-locations") %>%
    filter(PERMIT_RELATIONSHIP == "DISCHARGE") %>%
    show_query()
)
#> <url>
#> <body>
#> SERVICE: WFS VERSION: 2.0.0 REQUEST: GetFeature
#>  outputFormat: application/json typeNames:
#>  WHSE_ENVIRONMENTAL_MONITORING.EMS_MONITORING_LOCN_TYPES_SVW
#>  SRSNAME: EPSG:3005 CQL_FILTER:
#>  ("PERMIT_RELATIONSHIP" = 'DISCHARGE')
#> 
#> <full query url>
#> https://openmaps.gov.bc.ca/geo/pub/wfs?SERVICE=WFS&VERSION=2.0.0&REQUEST=GetFeature&outputFormat=application%2Fjson&typeNames=WHSE_ENVIRONMENTAL_MONITORING.EMS_MONITORING_LOCN_TYPES_SVW&SRSNAME=EPSG%3A3005&CQL_FILTER=%28%22PERMIT_RELATIONSHIP%22%20%3D%20%27DISCHARGE%27%29
  # }

# \donttest{
try(
  air <- 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:25:44 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
#> 

try(
  show_query(air)
)
#> Error in show_query(air) : object 'air' not found
# }