[GIS] Use Postgis to convert wkb_geometry data type to geom datatype

geometrypostgispostgresqlsqlwell-known-binary

How would I write an ALTER statement or otherwise to convert an existing imported data column from "wkb_geometry geometry(LineString,4326)" to a geom data type?

I ask because I've moved to importing my data from geojson instead of shapefiles due to column length issues with shapefiles and now I've created the new problem for myself of the data type not being geom as default.

Best Answer

You already have the geom type. wkb_geometry is just the name of the column. I see it is a confusing naming since thebstorage isn't wkb but a internal PostGIS format that is quite similar to wkb. I guess you used ogr2ogr to import since I think you get that naming then. What you have as input to such a tool will not affect what you get on the output side. That is the purpose of a tool loke ogr2ogr to convert between different formats.

Related Question