PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ read_geos_from_partition()

static GEOSGeometry* read_geos_from_partition ( WindowObject  win_obj,
uint32_t  i,
bool *  is_null 
)
static

Definition at line 89 of file lwgeom_window.c.

90 {
91  GSERIALIZED* g;
92  LWGEOM* lwg;
93  GEOSGeometry* gg;
94  Datum arg = WinGetFuncArgInPartition(win_obj, 0, i, WINDOW_SEEK_HEAD, false, is_null, NULL);
95 
96  if (*is_null) {
97  /* So that the indexes in our clustering input array can match our partition positions,
98  * toss an empty point into the clustering inputs, as a pass-through.
99  * NOTE: this will cause gaps in the output cluster id sequence.
100  * */
102  gg = LWGEOM2GEOS(lwg, LW_FALSE);
103  lwgeom_free(lwg);
104  return gg;
105  }
106 
107  g = (GSERIALIZED*) PG_DETOAST_DATUM_COPY(arg);
108  lwg = lwgeom_from_gserialized(g);
109  gg = LWGEOM2GEOS(lwg, LW_TRUE);
110  lwgeom_free(lwg);
111  if (!gg) {
112  *is_null = LW_TRUE;
113  }
114  return gg;
115 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
Definition: gserialized.c:239
GEOSGeometry * LWGEOM2GEOS(const LWGEOM *lwgeom, uint8_t autofix)
LWPOINT * lwpoint_construct_empty(int32_t srid, char hasz, char hasm)
Definition: lwpoint.c:151
#define LW_FALSE
Definition: liblwgeom.h:94
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1155
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
Definition: lwgeom.c:344
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:93

References LW_FALSE, LW_TRUE, LWGEOM2GEOS(), lwgeom_free(), lwgeom_from_gserialized(), lwpoint_as_lwgeom(), and lwpoint_construct_empty().

Referenced by ST_ClusterIntersectingWin().

Here is the call graph for this function:
Here is the caller graph for this function: