Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save NewGraphEnvironment/4ae4ebb25f4e5f4451fb3e59fafd556e to your computer and use it in GitHub Desktop.
Save NewGraphEnvironment/4ae4ebb25f4e5f4451fb3e59fafd556e to your computer and use it in GitHub Desktop.
update background_layers.gpkg streams and crossings from shared db
query <- "SELECT *
FROM bcfishpass.streams
WHERE watershed_group_code IN ('ADMS', 'MORK', 'UFRA', 'CANO', 'LNTH', 'UNTH', 'MURT', 'CLWR', 'CLRH', 'REVL')"
##import and grab the coordinates - this is already done
sf::st_read(conn, query = query) %>% st_write('background_layers.gpkg', delete_layer =TRUE, layer = 'streams')
query <- "SELECT *
FROM bcfishpass.crossings
WHERE watershed_group_code IN ('ADMS', 'MORK', 'UFRA', 'CANO', 'LNTH', 'UNTH', 'MURT', 'CLWR', 'CLRH', 'REVL')"
##import and grab the coordinates - this is already done
sf::st_read(conn, query = query) %>% st_write('background_layers.gpkg', delete_layer =TRUE, layer = 'crossings')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment