问题标签 [ogr2ogr]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
gdal - 错误 - 错误 1:无法找到驱动程序“ESRI”。在运行 ogr2ogr 命令时
我已经安装了gdal
然后尝试运行命令合并2个shapefile
但出现错误
不确定是否需要单独安装驱动程序,因为在此错误上找不到太多内容。
python - 如何在 Jupyter Notebook 中将字符串格式化程序与 og2ogr 一起使用?
我正在 Jupyter Notebook 中制作一个脚本,它将ogr2ogr
在一个循环中执行多个转换。据我所知,我不能直接将变量传递给 ogr2ogr。我可以用字符串格式化程序做到这一点吗?
! ogr2ogr -f "ESRI Shapefile" {fout} "my_orignal_shp.shp".format(fout = "my_output.shp")
返回
并! (ogr2ogr -f "ESRI Shapefile" {fout} "my_orignal_shp.shp").format(fout = "my_output.shp")
返回.format(fout was unexpected at this time.
使用 Windows、Python 3.7、GDAL 3.3.1 和 Jupyter Notebook
更新 我还尝试了以下方法,如GDAL 示例指南中所建议的那样
并收到此错误:'os.system' is not recognized as an internal or external command, operable program or batch file.
python - GDAL/OGR (Ogr2ogr) python绑定windows OCI驱动
我在 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 驱动程序?
从https://gdal.org/drivers/vector/index.html写入控制台所有“默认内置”格式(驱动程序)
mysql - 用 ogr2ogr 连接 MySQL
我使用的是 Windows 10,安装了 Gdal,环境变量 OK。
我已经可以在 Shape 中转换 WKT,在 GeoJson 中转换 Shape,更改投影,添加 SQL ......全部使用 ogr2ogr,好!
但是无法连接 ogr 和 MySQL,并且 MySQL 没有出现在驱动列表中。与 Postgres 相同。
如何安装驱动程序?或者修复它?
谢谢
python - Geojson另存为GPX文件
有人知道使用 ogr2ogr 将 geojson 文件保存为 gpx 文件的 python 代码或函数吗?我不知道如何使用 ogr2ogr 选项。
也可以将 excel 文件或数据框用于 GPX。
此致,
达米安
postgresql - 在 Postgresql 中从文件 MapInfo (.tab) 加载样式
如何使用 ogr2ogr (gdal) 从 PostgreSQL 中的文件 MapInfo (.tab) 加载样式?如果使用此代码,则不加载样式:ogr2ogr -f PostgreSQL PG:"dbname='' host='' user='', password=''" "<path_to_tab>" -nln <table_name_in_postgres>。根据文档,可以指定一个参数来加载样式。
gdal - 将地理数据库导出到 DXF 时向属性添加文本
我正在使用 ogr2ogr 使用属性 ADDR_NUM 中的文本元素将地理数据库的一部分导出到 DXF。
ADDR_NUM 是包含地址的属性。地址只是一个数字。我想在地址旁边添加井号 (#),这样当我将 DXF 插入 AutoCAD 时,它看起来像 #123。有什么办法可以在上面的代码中添加 # 符号吗?
javascript - 在Node JS中使用GDAL ogr2ogr将geoJson批量转换为shapfile
我想使用 NodeJS 中的 ogr2ogr 库将文件中的所有 geojsons 一次性转换为 shapefile。我知道可以使用 gdal cli 直接从终端完成,但我想知道如何在 Node.js 中完成。非常感谢!
我有这个代码来转换单个文件:
python - 处理 SRS 定义失败
我正在尝试使用 gdal 版本重新投影 shapefile:GDAL 3.0.2,发布于 2019/10/28 和 python 版本:Python 3.7.11。
下面的代码:
但我得到这个错误: