osmextract icon indicating copy to clipboard operation
osmextract copied to clipboard

Simplifying queries

Open Robinlovelace opened this issue 2 years ago • 2 comments

Many of the examples in the documents show queries like this:

q = "SELECT * FROM 'multipolygons' WHERE 'building' is not null"

However, I've just discovered that this works fine (better in this case, the above fails to omit building=NA):

In context of reprex:

library(dplyr)
q = "SELECT * FROM multipolygons WHERE building is not null"
buildings_nyorks = osmextract::oe_get("north yorkshire", query = q)
buildings_nyorks %>%
  sf::st_drop_geometry() %>% 
  group_by(building) %>% 
  count(building) %>% 
  arrange(desc(n))

Robinlovelace avatar Dec 07 '21 21:12 Robinlovelace

Result!

image

Robinlovelace avatar Dec 07 '21 21:12 Robinlovelace

Hi Robin! I'm not 100% sure but I think that sounds like a bug (or at least something that I want to check with more details as soon as possible). Anyway, thanks for creating this issue!

agila5 avatar Dec 07 '21 22:12 agila5