Monday, 6 July 2015

postgresql - Use Postgis to convert wkb_geometry data type to geom datatype


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.



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.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...