如何使用rgdal读取Oracle Spatial数据(缺少驱动器?) [英] How to read Oracle Spatial data with rgdal (missing drive?)

查看:84
本文介绍了如何使用rgdal读取Oracle Spatial数据(缺少驱动器?)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从Oracle Spatial数据库中将空间数据读取到R中.

I would like to read spatial data into R from my Oracle Spatial database.

当我执行 ogrDrivers()时,我看不到Oracle Spatial的任何内容.并且以下失败:

When I execute ogrDrivers() I do not see anything for Oracle Spatial. And the following fails:

> require(rgdal)
> ogrInfo(dsn="OCI:myusr/mypwd@mydb:MYTABLE:")
Error in ogrListLayers(dsn = dsn) : Cannot open data source

它看起来像 Oracle Spatial驱动程序通常不是内置在OGR中(Oracle确实做到了每个人都很难与其他生态系统一起工作和互操作!).

It looks like Oracle Spatial driver is not normally built into OGR (Oracle makes it really difficult for everybody to work and interoperate with other eco-systems!).

我想知道是否还有其他方法可以访问Oracle Spatial数据,或者是否可能/合理地使用Oracle Spatial驱动程序来构建和安装rgdal ...

I am wondering whether there are other ways to access Oracle Spatial data or whether it would be possible/reasonable to build and install rgdal with Oracle Spatial drivers...

任何提示都是超级欢迎!

Any hints is super welcome!

推荐答案

OCI插件是默认GDAL构建中未包括的众多插件之一.有关向量的完整列表,请参见 http://www.gdal.org/ogr_formats.html 格式.默认配置中约有1/2.其他不是:Oracle OCI就是其中之一.ESRI SDE,MySQL,PostGIS等.主要原因是它们在构建时(当然也在运行时)都依赖于第三方库的存在.对于Oracle,这意味着Oracle运行时库.任何人都可以免费获得此许可证,但需要安装.

The OCI plugin is one among the many that are not included in default GDAL builds. See http://www.gdal.org/ogr_formats.html for the full list of vector formats. About 1/2 of them are in the default builds. The others are not: Oracle OCI is one of them. ESRI SDE, MySQL, PostGIS are others. The main reason is that they all depend on the presence of 3rd party libraries at build time (and of course also at runtime). For Oracle that means the Oracle runtime library. This is available license free to anyone, but needs to be installed.

因此,如果要通过GDAL访问Oracle数据库,则需要获得一个包含Oracle OCI驱动程序的构建,并让rgdal使用该构建.

So, if you want to access Oracle databases through GDAL, you need to get a build that includes the Oracle OCI driver and let rgdal use that one.

您在哪个平台上运行?

您可以获取一组GDAL版本,其中包括OCI驱动程序此处win32和win64以及linux-64.还应该有一个macOS构建.

You can get a set of GDAL builds that include the OCI driver here for win32 and win64 as well as linux-64. There should also be a macOS build.

这篇关于如何使用rgdal读取Oracle Spatial数据(缺少驱动器?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆