Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add full XML get capabilities into pkg env to access object description #259

Merged
merged 15 commits into from
Apr 2, 2021

Conversation

boshek
Copy link
Collaborator

@boshek boshek commented Mar 31, 2021

This could be useful for many things. What we now have access to is a list of all warehouse layers available at package load. @ateucher wrote the xml parsing code.

This will close #144 and #241

@boshek
Copy link
Collaborator Author

boshek commented Mar 31, 2021

So now this works:

library(bcdata)
#> 
#> Attaching package: 'bcdata'
#> The following object is masked from 'package:stats':
#> 
#>     filter

bcdc_describe_feature("regional-districts-legally-defined-administrative-areas-of-bc")
#> Warning: It is advised to use the permanent id ('d1aff64e-dbfe-45a6-af97-582b7f6418b9') rather than the name of the record ('regional-districts-legally-defined-administrative-areas-of-bc') to guard against future name changes.
#> # A tibble: 21 x 5
#>    col_name     sticky remote_col_type local_col_type column_comments           
#>    <chr>        <lgl>  <chr>           <chr>          <chr>                     
#>  1 id           FALSE  xsd:string      character       <NA>                     
#>  2 LGL_ADMIN_A~ FALSE  xsd:decimal     numeric        "An operationally-generat~
#>  3 ADMIN_AREA_~ TRUE   xsd:string      character      "The authoritative, offic~
#>  4 ADMIN_AREA_~ TRUE   xsd:string      character      "A short form or commonly~
#>  5 ADMIN_AREA_~ TRUE   xsd:string      character      "BOUNDARY TYPE is a high-~
#>  6 ADMIN_AREA_~ TRUE   xsd:string      character      "The name given to the la~
#>  7 CHANGE_REQU~ TRUE   xsd:string      character      "The government acronym o~
#>  8 UPDATE_TYPE  TRUE   xsd:string      character      "A short description of t~
#>  9 WHEN_UPDATED TRUE   xsd:date        date           "The date and time the re~
#> 10 MAP_STATUS   TRUE   xsd:string      character      "That the digital map has~
#> # ... with 11 more rows
bcdc_describe_feature("76b1b7a3-2112-4444-857a-afccf7b20da8")
#> # A tibble: 42 x 5
#>    col_name     sticky remote_col_type local_col_type column_comments           
#>    <chr>        <lgl>  <chr>           <chr>          <chr>                     
#>  1 id           FALSE  xsd:string      character      <NA>                      
#>  2 CUSTODIAN_O~ FALSE  xsd:string      character      CUSTODIAN_ORG_DESCRIPTION~
#>  3 BUSINESS_CA~ FALSE  xsd:string      character      BUSINESS_CATEGORY_CLASS d~
#>  4 BUSINESS_CA~ FALSE  xsd:string      character      BUSINESS_CATEGORY_DESCRIP~
#>  5 OCCUPANT_TY~ FALSE  xsd:string      character      OCCUPANT_TYPE_DESCRIPTION~
#>  6 SOURCE_DATA~ FALSE  xsd:string      character      SOURCE_DATA_ID is a uniqu~
#>  7 SUPPLIED_SO~ FALSE  xsd:string      character      SUPPLIED_SOURCE_ID_IND is~
#>  8 AIRPORT_NAME FALSE  xsd:string      character      AIRPORT_NAME is a busines~
#>  9 DESCRIPTION  TRUE   xsd:string      character      DESCRIPTION describes the~
#> 10 PHYSICAL_AD~ TRUE   xsd:string      character      PHYSICAL_ADDRESS contains~
#> # ... with 32 more rows
bcdc_describe_feature("WHSE_IMAGERY_AND_BASE_MAPS.GSR_AIRPORTS_SVW")
#> # A tibble: 42 x 5
#>    col_name     sticky remote_col_type local_col_type column_comments           
#>    <chr>        <lgl>  <chr>           <chr>          <chr>                     
#>  1 id           FALSE  xsd:string      character      <NA>                      
#>  2 CUSTODIAN_O~ FALSE  xsd:string      character      CUSTODIAN_ORG_DESCRIPTION~
#>  3 BUSINESS_CA~ FALSE  xsd:string      character      BUSINESS_CATEGORY_CLASS d~
#>  4 BUSINESS_CA~ FALSE  xsd:string      character      BUSINESS_CATEGORY_DESCRIP~
#>  5 OCCUPANT_TY~ FALSE  xsd:string      character      OCCUPANT_TYPE_DESCRIPTION~
#>  6 SOURCE_DATA~ FALSE  xsd:string      character      SOURCE_DATA_ID is a uniqu~
#>  7 SUPPLIED_SO~ FALSE  xsd:string      character      SUPPLIED_SOURCE_ID_IND is~
#>  8 AIRPORT_NAME FALSE  xsd:string      character      AIRPORT_NAME is a busines~
#>  9 DESCRIPTION  TRUE   xsd:string      character      DESCRIPTION describes the~
#> 10 PHYSICAL_AD~ TRUE   xsd:string      character      PHYSICAL_ADDRESS contains~
#> # ... with 32 more rows

Created on 2021-03-31 by the reprex package (v1.0.0)

@boshek boshek marked this pull request as ready for review March 31, 2021 22:08
@boshek boshek requested a review from ateucher March 31, 2021 22:08
Copy link
Collaborator

@ateucher ateucher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @boshek! It looks good, just a few suggestions

R/bcdc_options.R Outdated Show resolved Hide resolved
R/bcdc_options.R Outdated Show resolved Hide resolved
R/bcdc_options.R Outdated Show resolved Hide resolved
R/bcdc_options.R Outdated Show resolved Hide resolved
R/describe-feature.R Outdated Show resolved Hide resolved
@boshek
Copy link
Collaborator Author

boshek commented Apr 1, 2021

/document

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use WFS getCapabilities endpoint
2 participants