1

I have multiple fgdb with many feature classes.

I am importing them to my PostGIS and this is the code i used

ogr2ogr -overwrite -progress -f "PostgreSQL" PG:"host=localhost port=5432 dbname=postgres user=postgres password=postgres^" MY.gdb

Yet the table names in my PostGIS comes same as my fgdb feature classes. I want to add prefix when I am importing them to PostGIS like "buliding" feature class in FGDB becomes Test_building in PostGIS

"-nln" option does not seem to have that function (or I just can't find?)

2

The -nln option works on individual layers, so you would have to split your import into several commands

ogr2ogr -overwrite -progress -f "PostgreSQL" PG:"host=localhost port=5432 
  dbname=postgres user=postgres password=postgres^" 
  MY.gdb building -nln Test_building

Alternatively, you can import the entire FGDB and rename the layers inside the PostgresDB; or you can create a test schema and import your tables, with the original names, in this specific schema.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.