I use the following ogr2ogr
command to import my open file geodatabase into PostgreSQL.
# Note, I use the -append because I am adding to preexisting tables with the same structure
ogr2ogr -append -f "PostgreSQL" PG:"dbname=database host=localhost user=username password=password" my.gdb
This works just fine, but it always specifies the geometry field as wkb_geometry
, and I'd like it to be geom
as is the usual convention. I thought this might be controlled by the -geomfield
option, but it seems that this is the not the correct flag (the documentation is too vague for me to be sure though).
If it was just one geodatabase, I could simply loop through and rename all the columns to geom
, but since I will be appending multiple databases together that won't work.
-append
then add the others. So the geom field in the tables iswkb_geometry
by default.