Aggregate functions for TopoGeometries

Sandro Santilli strk at kbt.io
Tue Nov 12 23:51:03 PST 2024


On Tue, Nov 12, 2024 at 08:38:46PM +0000, Felipe Matas wrote:
> Hi latot here, to construct new TopoGeometries using other
> TopoGeometries we need to convert to TopoElements, make an array with
> them, I think would be ver nice have functions to instead work with
> TopoElements work directly with TopoGeometries.

You can use the cast from TopoGeometry to TopoElement and the
TopoElementArray_agg aggregate to obtain that:


  SELECT TopoElementArray_agg(tg::TopoElement) FROM myLayer;

See https://postgis.net/docs/TopoElement.html
and https://postgis.net/docs/TopoElementArray_Agg.html

--strk;

  Libre GIS consultant/developer
  https://strk.kbt.io/services.html


More information about the postgis-devel mailing list