PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwmpoint_to_wkt_sb()

static void lwmpoint_to_wkt_sb ( const LWMPOINT mpoint,
stringbuffer_t sb,
int  precision,
uint8_t  variant 
)
static

Definition at line 216 of file lwout_wkt.c.

References dimension_qualifiers_to_wkt_sb(), empty_to_wkt_sb(), LWMPOINT::geoms, lwpoint_to_wkt_sb(), LWMPOINT::ngeoms, stringbuffer_append(), WKT_IS_CHILD, WKT_NO_PARENS, and WKT_NO_TYPE.

Referenced by lwgeom_to_wkt_sb().

217 {
218  int i = 0;
219  if ( ! (variant & WKT_NO_TYPE) )
220  {
221  stringbuffer_append(sb, "MULTIPOINT"); /* "MULTIPOINT" */
223  }
224  if ( mpoint->ngeoms < 1 )
225  {
226  empty_to_wkt_sb(sb);
227  return;
228  }
229  stringbuffer_append(sb, "(");
230  variant = variant | WKT_IS_CHILD; /* Inform the sub-geometries they are childre */
231  for ( i = 0; i < mpoint->ngeoms; i++ )
232  {
233  if ( i > 0 )
234  stringbuffer_append(sb, ",");
235  /* We don't want type strings or parens on our subgeoms */
236  lwpoint_to_wkt_sb(mpoint->geoms[i], sb, precision, variant | WKT_NO_PARENS | WKT_NO_TYPE );
237  }
238  stringbuffer_append(sb, ")");
239 }
#define WKT_NO_PARENS
uint8_t variant
Definition: cu_in_twkb.c:26
static void dimension_qualifiers_to_wkt_sb(const LWGEOM *geom, stringbuffer_t *sb, uint8_t variant)
Definition: lwout_wkt.c:39
#define WKT_IS_CHILD
uint8_t precision
Definition: cu_in_twkb.c:25
#define WKT_NO_TYPE
Well-Known Text (WKT) Output Variant Types.
LWPOINT ** geoms
Definition: liblwgeom.h:470
static void empty_to_wkt_sb(stringbuffer_t *sb)
Definition: lwout_wkt.c:69
void stringbuffer_append(stringbuffer_t *s, const char *a)
Append the specified string to the stringbuffer_t.
Definition: stringbuffer.c:134
static void lwpoint_to_wkt_sb(const LWPOINT *pt, stringbuffer_t *sb, int precision, uint8_t variant)
Definition: lwout_wkt.c:130
int ngeoms
Definition: liblwgeom.h:468
Here is the call graph for this function:
Here is the caller graph for this function: