I'm getting this Warning 1: layer names ignored in combination with -sql. However, I need to use the -sql query as I'm adding fields and populating them as I go.
The source dataset cannot be edited. I'm trying to combine several datasets into various tables in PostGIS, where there's a name difference between the source layer and the PostGIS table name. my command is in this format. ogr2ogr -f PostgreSQL -a_srs "EPSG:4326" PG:dbname=SomeDB <insert some options> Sourcedata -nlt POLYGON -skipfailures -explodecollections -sql "SELECT *,'VALUE1' AS valuefield, 1 as anotherfield FROM <layer> WHERE OGR_GEOMETRY='POLYGON' OR OGR_GEOMETRY='MULTIPOLYGON'" <layer> I wish to not put it in a table named <layer> in my PostGIS/SomeDB, but rather <layer>+somesuffix This is easy with -nln, but when I added the -sql, I get the warning above, and it seems to drop it in just <layer> and not <layer>+somesuffix. How can I accomplish what I want? This is ultimately run on many datasets, so it will be appending to existing tables (or create them if they didnt exist yet). -Mike
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev