0

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?

0

I had the same issue. This is not a big problem. Instead of having the SRID code inside you can use this syntax when exporting in postgis:

"ST_GeomFromText('{}',{})".format(geometry,srid)

Hope that helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.