简体   繁体   English

在Windows XP上从R访问PostGIS

[英]Access PostGIS from R on Windows XP

Is there any easy way how to access PostGis data in R on Windows XP? 有没有简单的方法如何在Windows XP上访问R中的PostGis数据?

I thought I can try rgdal , but there is no easy way how to add PG driver (see file.show(system.file("README.windows", package="rgdal")) . Therefore this simple piece of code does not work: 我以为我可以试试rgdal ,但是没有简单的方法来添加PG驱动程序(参见file.show(system.file("README.windows", package="rgdal")) 。因此这段简单的代码没有工作:

library(rgdal)
mylayer <-readOGR(dsn="PG:host=localhost user=MyUser dbname=MyDb password=Secret port=5432", layer = "MyLayer", verbose = TRUE)

Then I have found qGIS plugin called manageR . 然后我找到了名为manageR的 qGIS插件。 Unfortunately, there is a dependency to rpy2 plugin which is not available anymore. 不幸的是,rpy2插件存在依赖性,不再可用。

I have no problems using shapefiles, but my intention was to integrate postgis data with current data warehouse and then use R for analytics. 我使用shapefile没有问题,但我的目的是将postgis数据与当前数据仓库集成,然后使用R进行分析。

Is there any known simple way how to use PostGIS and R or I have to change OS? 有没有任何已知的简单方法如何使用PostGIS和R或我必须更改操作系统?

This question has been previously dealt with on the r-sig-geo mailing lists. 此问题之前已在r-sig-geo邮件列表中处理过。

Searching for 'postgis rgdal windows' on rseek.org finds previous discussions. 在rseek.org上搜索“postgis rgdal windows”可以找到之前的讨论。

In short - not positive, because the windows rgdal is compiled using a minimal set of drivers - because compiling for lots of others - all of which have different versions - would just transpose the problem into one of the wrong version or missing postgis (in this case). 简而言之 - 不是积极的,因为windows rgdal是使用一组最小的驱动程序编译的 - 因为编译许多其他驱动程序 - 所有这些驱动程序都有不同版本 - 只会将问题转换为错误版本或缺少postgis(在此案件)。

Going via FWtools may be an option. 通过FWtools可能是一种选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM