Advertisement
Guest User

Untitled

a guest
Jun 27th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. require(RPostgreSQL)
  2. drv <- dbDriver("PostgreSQL")
  3. con <- dbConnect(drv, dbname = "")
  4. dbGetquery(con, "SELECT rid, rast, filename FROM schema.capri")
  5.  
  6. library('raster')
  7. library('rgdal')
  8.  
  9. dsn="PG:dbname='plots' host=localhost user='test' password='test' port=5432 schema='gisdata' table='map' mode=2"
  10.  
  11. ras <- readGDAL(dsn) # Get your file as SpatialGridDataFrame
  12. ras2 <- raster(ras,1) # Convert the first Band to Raster
  13. plot(ras2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement