88 static size_t buffer_size = 128;
89 char coord[buffer_size];
100 for (i = 0; i < ptarray->
npoints; i++)
108 for (j = 0; j < dimensions; j++)
190 for ( i = 0; i < poly->
nrings; i++ )
237 for ( i = 0; i < mpoint->
ngeoms; i++ )
267 for ( i = 0; i < mline->
ngeoms; i++ )
297 for ( i = 0; i < mpoly->
ngeoms; i++ )
329 for ( i = 0; i < comp->
ngeoms; i++ )
373 for ( i = 0; i < cpoly->
nrings; i++ )
421 for ( i = 0; i < mcurv->
ngeoms; i++ )
469 for ( i = 0; i < msurf->
ngeoms; i++ )
505 if ( collection->
ngeoms < 1 )
512 for ( i = 0; i < collection->
ngeoms; i++ )
561 for ( i = 0; i < tin->
ngeoms; i++ )
592 for ( i = 0; i < psurf->
ngeoms; i++ )
608 LWDEBUGF(4,
"lwgeom_to_wkt_sb: type %s, hasz %d, hasm %d",
660 lwerror(
"lwgeom_to_wkt_sb: Type %d - %s unsupported.",
uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
int lwgeom_has_srid(const LWGEOM *geom)
Return true or false depending on whether a geometry has a valid SRID set.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
#define FLAGS_NDIMS(flags)
#define POLYHEDRALSURFACETYPE
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
#define FLAGS_GET_M(flags)
int lwline_is_empty(const LWLINE *line)
int lwpoint_is_empty(const LWPOINT *point)
int lwtriangle_is_empty(const LWTRIANGLE *triangle)
int lwpoly_is_empty(const LWPOLY *poly)
#define WKT_NO_TYPE
Well-Known Text (WKT) Output Variant Types.
int lwprint_double(double d, int maxdd, char *buf, size_t bufsize)
int lwcircstring_is_empty(const LWCIRCSTRING *circ)
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
static void lwcircstring_to_wkt_sb(const LWCIRCSTRING *circ, stringbuffer_t *sb, int precision, uint8_t variant)
static void lwmsurface_to_wkt_sb(const LWMSURFACE *msurf, stringbuffer_t *sb, int precision, uint8_t variant)
static void dimension_qualifiers_to_wkt_sb(const LWGEOM *geom, stringbuffer_t *sb, uint8_t variant)
static void lwtin_to_wkt_sb(const LWTIN *tin, stringbuffer_t *sb, int precision, uint8_t variant)
static void empty_to_wkt_sb(stringbuffer_t *sb)
static void lwcollection_to_wkt_sb(const LWCOLLECTION *collection, stringbuffer_t *sb, int precision, uint8_t variant)
static void lwcompound_to_wkt_sb(const LWCOMPOUND *comp, 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)
static void lwline_to_wkt_sb(const LWLINE *line, 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 lwmpoint_to_wkt_sb(const LWMPOINT *mpoint, stringbuffer_t *sb, int precision, uint8_t variant)
static void lwcurvepoly_to_wkt_sb(const LWCURVEPOLY *cpoly, 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)
static void lwmline_to_wkt_sb(const LWMLINE *mline, stringbuffer_t *sb, int precision, uint8_t variant)
static void lwmpoly_to_wkt_sb(const LWMPOLY *mpoly, stringbuffer_t *sb, int precision, uint8_t variant)
char * lwgeom_to_wkt(const LWGEOM *geom, uint8_t variant, int precision, size_t *size_out)
WKT emitter function.
static void lwpoly_to_wkt_sb(const LWPOLY *poly, 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)
static void lwgeom_to_wkt_sb(const LWGEOM *geom, stringbuffer_t *sb, int precision, uint8_t variant)
static void lwpsurface_to_wkt_sb(const LWPSURFACE *psurf, 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.
char stringbuffer_lastchar(stringbuffer_t *s)
Return the last character in the buffer.
stringbuffer_t * stringbuffer_create(void)
Allocate a new stringbuffer_t.
void stringbuffer_append(stringbuffer_t *s, const char *a)
Append the specified string to the stringbuffer_t.
int stringbuffer_getlength(stringbuffer_t *s)
Returns the length of the current string, not including the null terminator (same behavior as strlen(...
void stringbuffer_destroy(stringbuffer_t *s)
Free the stringbuffer_t and all memory managed within it.
char * stringbuffer_getstringcopy(stringbuffer_t *s)
Returns a newly allocated string large enough to contain the current state of the string.
const char * stringbuffer_getstring(stringbuffer_t *s)
Returns a reference to the internal string being managed by the stringbuffer.