R/getShape.R

#' This function imports a shapefile from a postgreSQL database.
#' @export
#' @title Import a shapefile from a postgreSQL database
#' @name getShape
#' @param con An object of class "pgConnect" generated by pgConnect()
#' @param vecTable Name of vectorial table in the database
#' @return Spatial object of class 'sp'
#' @author Bruno Silva
getShape <- function(con, vecTable){
  shape <- rgdal::readOGR(dsn = con[[2]], vecTable)
  return(shape)
}
berdinazzi/easyPostgreSQL documentation built on May 12, 2019, 3:04 p.m.