98 for (i = 0; i < ptarray->
npoints; i++)
106 for (j = 0; j < dimensions; j++)
116 if ( ! (variant & WKT_NO_PARENS) )
184 for ( i = 0; i < poly->
nrings; i++ )
231 for ( i = 0; i < mpoint->
ngeoms; i++ )
261 for ( i = 0; i < mline->
ngeoms; i++ )
291 for ( i = 0; i < mpoly->
ngeoms; i++ )
323 for ( i = 0; i < comp->
ngeoms; i++ )
340 lwerror(
"lwcompound_to_wkt_sb: Unknown type received %d - %s", type,
lwtype_name(type));
367 for ( i = 0; i < cpoly->
nrings; i++ )
387 lwerror(
"lwcurvepoly_to_wkt_sb: Unknown type received %d - %s", type,
lwtype_name(type));
415 for ( i = 0; i < mcurv->
ngeoms; i++ )
435 lwerror(
"lwmcurve_to_wkt_sb: Unknown type received %d - %s", type,
lwtype_name(type));
463 for ( i = 0; i < msurf->
ngeoms; i++ )
479 lwerror(
"lwmsurface_to_wkt_sb: Unknown type received %d - %s", type,
lwtype_name(type));
499 if ( collection->
ngeoms < 1 )
506 for ( i = 0; i < collection->
ngeoms; i++ )
555 for ( i = 0; i < tin->
ngeoms; i++ )
586 for ( i = 0; i < psurf->
ngeoms; i++ )
602 LWDEBUGF(4,
"lwgeom_to_wkt_sb: type %s, hasz %d, hasm %d",
654 lwerror(
"lwgeom_to_wkt_sb: Type %d - %s unsupported.",
static void lwtin_to_wkt_sb(const LWTIN *tin, stringbuffer_t *sb, int precision, uint8_t variant)
static void lwmcurve_to_wkt_sb(const LWMCURVE *mcurv, stringbuffer_t *sb, int precision, uint8_t variant)
int lwgeom_has_srid(const LWGEOM *geom)
Return true or false depending on whether a geometry has a valid SRID set.
stringbuffer_t * stringbuffer_create(void)
Allocate a new stringbuffer_t.
static void lwpsurface_to_wkt_sb(const LWPSURFACE *psurf, stringbuffer_t *sb, int precision, uint8_t variant)
char * stringbuffer_getstringcopy(stringbuffer_t *s)
Returns a newly allocated string large enough to contain the current state of the string...
static void lwcurvepoly_to_wkt_sb(const LWCURVEPOLY *cpoly, stringbuffer_t *sb, int precision, uint8_t variant)
static void dimension_qualifiers_to_wkt_sb(const LWGEOM *geom, stringbuffer_t *sb, uint8_t variant)
#define POLYHEDRALSURFACETYPE
static void lwcircstring_to_wkt_sb(const LWCIRCSTRING *circ, stringbuffer_t *sb, int precision, uint8_t variant)
static void lwtriangle_to_wkt_sb(const LWTRIANGLE *tri, stringbuffer_t *sb, int precision, uint8_t variant)
static void lwpoly_to_wkt_sb(const LWPOLY *poly, stringbuffer_t *sb, int precision, uint8_t variant)
int stringbuffer_aprintf(stringbuffer_t *s, const char *fmt,...)
Appends a formatted string to the current string buffer, using the format and argument list provided...
int stringbuffer_getlength(stringbuffer_t *s)
Returns the length of the current string, not including the null terminator (same behavior as strlen(...
static void lwmline_to_wkt_sb(const LWMLINE *mline, stringbuffer_t *sb, int precision, uint8_t variant)
int lwtriangle_is_empty(const LWTRIANGLE *triangle)
static void lwmpoint_to_wkt_sb(const LWMPOINT *mpoint, stringbuffer_t *sb, int precision, uint8_t variant)
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
uint8_t * getPoint_internal(const POINTARRAY *pa, int n)
#define WKT_NO_TYPE
Well-Known Text (WKT) Output Variant Types.
int lwpoly_is_empty(const LWPOLY *poly)
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
static void lwmpoly_to_wkt_sb(const LWMPOLY *mpoly, stringbuffer_t *sb, int precision, uint8_t variant)
static void ptarray_to_wkt_sb(const POINTARRAY *ptarray, stringbuffer_t *sb, int precision, uint8_t variant)
int lwcircstring_is_empty(const LWCIRCSTRING *circ)
static void lwgeom_to_wkt_sb(const LWGEOM *geom, stringbuffer_t *sb, int precision, uint8_t variant)
static void empty_to_wkt_sb(stringbuffer_t *sb)
int lwline_is_empty(const LWLINE *line)
void stringbuffer_append(stringbuffer_t *s, const char *a)
Append the specified string to the stringbuffer_t.
void stringbuffer_destroy(stringbuffer_t *s)
Free the stringbuffer_t and all memory managed within it.
static void lwcompound_to_wkt_sb(const LWCOMPOUND *comp, stringbuffer_t *sb, int precision, uint8_t variant)
static void lwpoint_to_wkt_sb(const LWPOINT *pt, stringbuffer_t *sb, int precision, uint8_t variant)
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
static void lwcollection_to_wkt_sb(const LWCOLLECTION *collection, stringbuffer_t *sb, int precision, uint8_t variant)
int lwpoint_is_empty(const LWPOINT *point)
#define FLAGS_GET_M(flags)
const char * stringbuffer_getstring(stringbuffer_t *s)
Returns a reference to the internal string being managed by the stringbuffer.
char * lwgeom_to_wkt(const LWGEOM *geom, uint8_t variant, int precision, size_t *size_out)
WKT emitter function.
char stringbuffer_lastchar(stringbuffer_t *s)
Return the last character in the buffer.
#define LWDEBUGF(level, msg,...)
#define FLAGS_NDIMS(flags)
static void lwmsurface_to_wkt_sb(const LWMSURFACE *msurf, stringbuffer_t *sb, int precision, uint8_t variant)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
static void lwline_to_wkt_sb(const LWLINE *line, stringbuffer_t *sb, int precision, uint8_t variant)