Assume you want to write EWKB/EWKT that includes SRID information (eg for inserting into Postgis). This is currently already supported, as you can do:
geoms = pygeos.points(...)
geoms_with_srid = pygeos.set_srid(geoms, 4326)
pygeos.to_wkb(geoms_with_srid, include_srid=True)
However, the above means you need to create a full copy of the array of geometries, just for getting the EWKB (assuming you don't need to set the SRID for anything else), which can be wasteful when working with a large array of geometries.
In principle, we could also clone and set the srid on the fly within the to_wkb ufunc. This does not avoid the cloning of all geometries, but avoids keeping those clones alive for the full array, which should improve memory usage.
Assume you want to write EWKB/EWKT that includes SRID information (eg for inserting into Postgis). This is currently already supported, as you can do:
However, the above means you need to create a full copy of the array of geometries, just for getting the EWKB (assuming you don't need to set the SRID for anything else), which can be wasteful when working with a large array of geometries.
In principle, we could also clone and set the srid on the fly within the
to_wkbufunc. This does not avoid the cloning of all geometries, but avoids keeping those clones alive for the full array, which should improve memory usage.