I have 4126 GML-files as.xml, containing building polygons. I want to use ogr2ogr to transform them to geopackages. The following command works on one layer when I run it in the OS4Geo Shell shipped with QGIS:
ogr2ogr -f GPKG c:\path\to\ouput.gpkg GMLAS:c:\path\to\input.xml -oo REMOVE_UNUSED_FIELDS=YES
I tried to adapt this to a python script, where I use it in the following way
outputfilepath = r"path\to\LoD1.gpkg"
inputfilepath = r"path\to\LoD1.xml"
os.system("ogr2ogr -f GPKG "+outputfilepath+" GMLAS:"+inputfilepath+" -oo REMOVE_UNUSED_FIELDS=YES")
However, nothing happens, I don't even get an error message.
When I run this in the command line with a running python instance I get the error message
ERROR 6: Unknown option name '-'
What am I doing wrong?