0

我在 Windows 上安装了GDAL-3.3.1-cp39-cp39-win_amd64.whl,我正在 python 中尝试 ogr2ogr.py。对于默认驱动程序可以完美运行,但支持驱动程序不是 OCI 驱动程序 ( https://gdal.org/drivers/vector/oci.html#vector-oci )。当我安装 OsGeo4W 时,我选择了 OCI,所以它在 ogr2ogr.exe 中有效,但在 python ogr2ogr.py 中无效。我也安装了 cx_Oracle,单独工作(SELECT ...),但不能与 ogr2ogr 一起工作。

如何为 python ogr2ogr 安装这个 OCI 驱动程序?

import cx_Oracle
from osgeo import ogr
from osgeo_utils.samples import ogr2ogr   
   
cx_Oracle.init_oracle_client('C:\\Users\\peter\\Downloads\\instantclient-basic-windows.x64-19.11.0.0.0dbru\\instantclient_19_11')
ogr2ogr.main(["", "--formats"]) 

从https://gdal.org/drivers/vector/index.html写入控制台所有“默认内置”格式(驱动程序)

4

0 回答 0