I try to load my KMLs into an existing table (the geometry field is geometry type). One KML file can contain multiple geometries and I would like to add these to an existing table (each feature is a new record) with an "ID"
which should be the KML file's name. I have a partly working code, but I want to add the filename to the "ID"
field as well
ogr2ogr -append -f "PostgreSQL" PG:"host='0.0.0.1' port='5433' user='user' dbname='dbname' password='password'" h:\Users\gpapp\kmls\AEY17525.kml -nln cat_projects_geom
this one generates error:
ogr2ogr -append -f "PostgreSQL" PG:"host='0.0.0.1' port='5433' user='user' dbname='dbname' password='password'" h:\Users\gpapp\kmls\AEY17525.kml -nln cat_projects_geom -sql "UPDATEcat_projects_geom SET nameref = 'AEY17525 or filename'"
-sql "SELECT geometry, attr_1, attr_2, attr_3, 'AEY17525' AS nameref from my_kml_layer"
.