PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwline_split_by_point()

static LWGEOM * lwline_split_by_point ( const LWLINE lwgeom_in,
const LWPOINT blade_in 
)
static

Definition at line 153 of file lwgeom_geos_split.c.

154 {
155  LWMLINE* out;
156 
157  out = lwmline_construct_empty(lwline_in->srid,
158  FLAGS_GET_Z(lwline_in->flags),
159  FLAGS_GET_M(lwline_in->flags));
160  if ( lwline_split_by_point_to(lwline_in, blade_in, out) < 2 )
161  {
162  lwmline_add_lwline(out, lwline_clone_deep(lwline_in));
163  }
164 
165  /* Turn multiline into collection */
166  out->type = COLLECTIONTYPE;
167 
168  return (LWGEOM*)out;
169 }
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
LWMLINE * lwmline_construct_empty(int srid, char hasz, char hasm)
Definition: lwmline.c:38
LWMLINE * lwmline_add_lwline(LWMLINE *mobj, const LWLINE *obj)
Definition: lwmline.c:46
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:140
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:141
LWLINE * lwline_clone_deep(const LWLINE *lwgeom)
Definition: lwline.c:118
int lwline_split_by_point_to(const LWLINE *lwline_in, const LWPOINT *blade_in, LWMLINE *v)
Split a line by a point and push components to the provided multiline.
uint8_t type
Definition: liblwgeom.h:480

References COLLECTIONTYPE, LWLINE::flags, FLAGS_GET_M, FLAGS_GET_Z, lwline_clone_deep(), lwline_split_by_point_to(), lwmline_add_lwline(), lwmline_construct_empty(), LWLINE::srid, and LWMLINE::type.

Referenced by lwline_split().

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