[gdal-dev] ogr2ogr, GMLAS driver, help

Bence Megyesi b.megyesi at soljoy.at
Tue Mar 26 03:01:28 PDT 2024


Hello,

i am importing an xml with ogr2ogr using GMLAS driver to a PostgreSQL server. I am also using an .xsd file to correctly import and manage the imported xml in the server. This way i was able to import every element into the correct column based on the xsd, except one, a type="xsd:time" element. In the server i created a table list and their columns with types based on the xsd, but this "Uhrzeit" element's value wont get imported into the server. I checked the type in PostgreSQL, which is "time without time zone".
The value in the xml is HH:MM:SS formated so in theory it should work, but it wont.
My question is: what adjustments can i do with my ogr2ogr command
ogr2ogr_command = [
        'ogr2ogr', '-skipfailures', '-f', 'PostgreSQL', f'PG:host={host} port={port} dbname={dbname} password={password} user={user} schemas={schema}',
        f'GMLAS:{xml_file_path}',
        '-oo', f'XSD={xsd_file_path}',
        '-oo', 'REMOVE_UNUSED_LAYERS=YES', '-oo', 'REMOVE_UNUSED_FIELDS=YES', '-append', '-forceNullable'
    ]
to be able to import this type of data too?

I hope i am sending my question to the right person. If this is not the case, kindly disregard my message.

Best regards,
Bence
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240326/f2da998f/attachment.htm>


More information about the gdal-dev mailing list