When creating a new table (PostGIS) using OGR/GDAL (2.1+), is there a way to select a specific name for the geometry field (such as geom
), rather than using the default name?
I created a new table via python3 ogr/grdal liek this:
ds = gdal.OpenEx(connection_string, gdal.OF_VECTOR | gdal.OF_UPDATE)
lyr = ds.CreateLayer( "mylayer", XXX, ogr.wkbLineString)
The problem is that I can't find a parameter to specify the name of the geometry field, only its type. In the table created, the geometry field seems to be called wkb_geometry
by default:
wkb_geometry geometry(LineString,26945)
Is there a parameter or option to let CreateLayer()
use a different name such as geom
?
Related question: Use Postgis to convert wkb_geometry data type to geom datatype