bcgov / bcdata

An R package for searching & retrieving data from the B.C. Data Catalogue
https://bcgov.github.io/bcdata
Apache License 2.0
81 stars 12 forks source link

BUG : select feature not working with bcdc_query_geodata() #331

Closed gcperk closed 10 months ago

gcperk commented 10 months ago

Hi all, I noticed the select function is not working when using the bcdc_query_geodata(). I first noticed this using the streams data ("92344413-8035-4c08-b996-65a9b3f62fca"), so I suspected it was a LINESTRING issue. My code is a three step process (for context only)

  streams <- bcdata::bcdc_query_geodata("92344413-8035-4c08-b996-65a9b3f62fca") %>%
    bcdata::filter(bcdata::INTERSECTS(aoi)) %>%
    bcdata::select(c(id, STREAM_ORDER)) %>% 
    bcdata::collect() 

However i am having the same issues with even the test dataset. Here is a reprex:

res<-bcdata::bcdc_query_geodata("groundwater-wells")%>% 
  bcdata::filter(OBSERVATION_WELL_NUMBER=="108")%>% 
  bcdata::select(WELL_TAG_NUMBER,INTENDED_WATER_USE)%>% 
  bcdata::collect()

I did see this about the sticky columns, but I am seeing all columns staying in the dataset (i.e 97 columns for streams dataset).

I am running most up to data BCdata package. Thanks again and great work on this complex package!

gcperk commented 10 months ago

I think I just figured it out.... I am just dealing with sticky columns ....... urgh! Sorry!

ateucher commented 10 months ago

Yeah, there are a lot of them in some datasets!