我有一个包含 150 个 .gml 文件的文件夹,我需要上传到我的 postgis/postgres 数据库。上传第一个 gml 后,其余的将附加到它以形成单个表。但是我不知道如何让 ogr2ogr 遍历每个文件......目前我必须单独上传/附加每个 cml。
我转换第一个 gml 的代码:
ogr2ogr -update -append -f "PostgreSQL" PG:"host=localhost port=5432 dbname=testdb user=admin password=password" -lco SCHEMA=test_schema "D:\path to folder\File1.gml" -progress -lco OVERWRITE=YES
以及我将每个后续 gml 附加到第一个的代码:
ogr2ogr -update -append -f "PostgreSQL" PG:"host=localhost port=5432 dbname=testdb user=admin password=password active_schema=test_schema" "D:\path to folder\File2.gml" -progress
这工作正常,但我不想再这样做 148 次,每次将 File2 更改为 File3 等等......