PostGIS  3.7.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 90 of file lwgeom_window.c.

91 {
92  GSERIALIZED* g;
93  LWGEOM* lwg;
94  GEOSGeometry* gg;
95  Datum arg = WinGetFuncArgInPartition(win_obj, 0, i, WINDOW_SEEK_HEAD, false, is_null, NULL);
96 
97  if (*is_null) {
98  /* So that the indexes in our clustering input array can match our partition positions,
99  * toss an empty point into the clustering inputs, as a pass-through.
100  * NOTE: this will cause gaps in the output cluster id sequence.
101  * */
103  gg = LWGEOM2GEOS(lwg, LW_FALSE);
104  lwgeom_free(lwg);
105  return gg;
106  }
107 
108  g = (GSERIALIZED*) PG_DETOAST_DATUM_COPY(arg);
109  lwg = lwgeom_from_gserialized(g);
110  gg = LWGEOM2GEOS(lwg, LW_TRUE);
111  lwgeom_free(lwg);
112  if (!gg) {
113  *is_null = LW_TRUE;
114  }
115  return gg;
116 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
Definition: gserialized.c:268
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:1218
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: