PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ linemerge()

Datum linemerge ( PG_FUNCTION_ARGS  )

Definition at line 2170 of file postgis/lwgeom_geos.c.

2171{
2172 GSERIALIZED *geom1;
2173 bool directed = false;
2175 LWGEOM *lwgeom1, *lwresult ;
2176
2177 geom1 = PG_GETARG_GSERIALIZED_P(0);
2178
2179 if ( PG_NARGS() > 1 )
2180 directed = PG_GETARG_BOOL(1);
2181
2182 lwgeom1 = lwgeom_from_gserialized(geom1) ;
2183
2184 lwresult = lwgeom_linemerge_directed(lwgeom1, directed ? LW_TRUE : LW_FALSE);
2185 result = geometry_serialize(lwresult) ;
2186
2187 lwgeom_free(lwgeom1) ;
2188 lwgeom_free(lwresult) ;
2189
2190 PG_FREE_IF_COPY(geom1, 0);
2191
2192 PG_RETURN_POINTER(result);
2193}
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition cu_print.c:267
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
LWGEOM * lwgeom_linemerge_directed(const LWGEOM *geom1, int directed)
#define LW_FALSE
Definition liblwgeom.h:94
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1246
#define LW_TRUE
Return types for functions with status returns.
Definition liblwgeom.h:93

References LW_FALSE, LW_TRUE, lwgeom_free(), lwgeom_from_gserialized(), lwgeom_linemerge_directed(), and result.

Here is the call graph for this function: