PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ asgml3_point_buf()

static size_t asgml3_point_buf ( const LWPOINT point,
const char *  srs,
char *  output,
int  precision,
int  opts,
const char *  prefix,
const char *  id 
)
static

Definition at line 788 of file lwout_gml.c.

789 {
790  char *ptr = output;
791  int dimension=2;
792 
793  if (FLAGS_GET_Z(point->flags)) dimension = 3;
794 
795  ptr += sprintf(ptr, "<%sPoint", prefix);
796  if ( srs ) ptr += sprintf(ptr, " srsName=\"%s\"", srs);
797  if ( id ) ptr += sprintf(ptr, " %sid=\"%s\"", prefix, id);
798  if ( lwpoint_is_empty(point) )
799  {
800  ptr += sprintf(ptr, "/>");
801  return (ptr-output);
802  }
803 
804  ptr += sprintf(ptr, ">");
805  if (IS_DIMS(opts)) ptr += sprintf(ptr, "<%spos srsDimension=\"%d\">", prefix, dimension);
806  else ptr += sprintf(ptr, "<%spos>", prefix);
807  ptr += pointArray_toGML3(point->point, ptr, precision, opts);
808  ptr += sprintf(ptr, "</%spos></%sPoint>", prefix, prefix);
809 
810  return (ptr-output);
811 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define IS_DIMS(x)
Definition: liblwgeom.h:1657
#define FLAGS_GET_Z(flags)
Definition: liblwgeom.h:179
int lwpoint_is_empty(const LWPOINT *point)
static size_t pointArray_toGML3(POINTARRAY *pa, char *buf, int precision, int opts)
Definition: lwout_gml.c:1889
opts
Definition: ovdump.py:45
POINTARRAY * point
Definition: liblwgeom.h:457
lwflags_t flags
Definition: liblwgeom.h:459

References LWPOINT::flags, FLAGS_GET_Z, IS_DIMS, lwpoint_is_empty(), ovdump::opts, LWPOINT::point, pointArray_toGML3(), and precision.

Referenced by asgml3_collection_buf(), asgml3_multi_buf(), and asgml3_point().

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