[postgis-tickets] [PostGIS] #5336: topoelementarray_agg that takes topogeometry

PostGIS trac at osgeo.org
Mon Feb 13 18:52:13 PST 2023


#5336: topoelementarray_agg that takes topogeometry
-----------------------+---------------------------
  Reporter:  robe      |      Owner:  robe
      Type:  defect    |     Status:  new
  Priority:  medium    |  Milestone:  PostGIS 3.4.0
 Component:  topology  |    Version:  master
Resolution:            |   Keywords:
-----------------------+---------------------------
Comment (by robe):

 I'm going to test the performance of this out, but here is what my plan
 is.


 {{{
 CREATE OR REPLACE FUNCTION topology.topoelement(topo
         topology.topogeometry)
     RETURNS topology.topoelement
     LANGUAGE sql
     COST 1
     IMMUTABLE PARALLEL SAFE
 AS  $$SELECT ARRAY[topo.id,topo.layer_id]::topology.topoelement;$$;

 -- note you can't create a cast against a domain, but you can create a
 cast against the underlying type of domain
 CREATE CAST (topogeometry AS int[]) WITH FUNCTION
 topoelement(topogeometry) AS IMPLICIT;

 }}}

 Once you do the above:

 This works:


 {{{


 SELECT TopoElementArray_Agg(NULL::topogeometry)
 }}}


 without the cast in place, you get error:


 {{{
 function topoelementarray_agg(topogeometry) does not exist
 }}}
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5336#comment:5>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list