Cidree / rpostgis

rpostgis: R Interface to a 'PostGIS' Database
http://cidree.github.io/rpostgis/
77 stars 14 forks source link

Read geometries from materialized views #6

Closed cswingle closed 7 years ago

cswingle commented 7 years ago

I think this is more of a feature request to add support for materialized views, unless I'm missing something about the pgGetGeom() or dbReadDataFrame() functions, which fail when I try to read a materialized view with this sort of error:

Error in dbReadDataFrame(con, c("public", "properties")) : 
Table public.properties not found.

Geometry columns from materialized views do appear in pgListGeom().

Thanks!

dnbucklin commented 7 years ago

Hi @cswingle , I've updated the package to allow materialized views, the fix is on both master and dev branches. Install from master using:

devtools::install_github("mablab/rpostgis")

The issue was due to an internal function not finding materialized views in the information_schema.tables catalog (which is apparently by design).

cswingle commented 7 years ago

Thanks @dnbucklin, and for the context from the postgres mailing list.