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

◆ lwgeom_to_wkt_internal()

static stringbuffer_t * lwgeom_to_wkt_internal ( const LWGEOM geom,
uint8_t  variant,
int  precision 
)
static

Definition at line 676 of file lwout_wkt.c.

677{
678 stringbuffer_t *sb;
679 if ( geom == NULL )
680 return NULL;
681 sb = stringbuffer_create();
682 /* Extended mode starts with an "SRID=" section for geoms that have one */
683 if ( (variant & WKT_EXTENDED) && lwgeom_has_srid(geom) )
684 {
685 stringbuffer_aprintf(sb, "SRID=%d;", geom->srid);
686 }
688 if ( stringbuffer_getstring(sb) == NULL )
689 {
690 lwerror("Uh oh");
691 return NULL;
692 }
693 return sb;
694}
static uint8_t variant
Definition cu_in_twkb.c:26
static uint8_t precision
Definition cu_in_twkb.c:25
#define WKT_EXTENDED
Definition liblwgeom.h:2221
int lwgeom_has_srid(const LWGEOM *geom)
Return true or false depending on whether a geometry has a valid SRID set.
Definition lwgeom.c:1495
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
static void lwgeom_to_wkt_sb(const LWGEOM *geom, stringbuffer_t *sb, int precision, uint8_t variant)
Definition lwout_wkt.c:616
stringbuffer_t * stringbuffer_create(void)
Allocate a new stringbuffer_t.
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.
const char * stringbuffer_getstring(stringbuffer_t *s)
Returns a reference to the internal string being managed by the stringbuffer.
int32_t srid
Definition liblwgeom.h:460

References lwerror(), lwgeom_has_srid(), lwgeom_to_wkt_sb(), precision, LWGEOM::srid, stringbuffer_aprintf(), stringbuffer_create(), stringbuffer_getstring(), variant, and WKT_EXTENDED.

Referenced by lwgeom_to_wkt(), and lwgeom_to_wkt_varlena().

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