I want to encode coordinates of LineString in WKB with the SRID included
wkbwriter = shapely.geos.WKBWriter(shapely.geos.lgeos, big_endian=False, include_srid=True)
geo = wkbwriter.write_hex(LineString(geometry_obj['coordinates']))
but it is the same exact as
shapely.geometry.shape(geometry_obj).wkb_hex
and does not include the SRID in the encoding, causing issues when trying to store it in postgis with column Geometry('LineString', 3857)
what am I doing wrong?
Best Answer
The easiest way is to use
wkb.dumps
, e.g.: