PostGIS  2.4.9dev-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 808 of file lwout_gml.c.

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

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

809 {
810  char *ptr = output;
811  int dimension=2;
812 
813  if (FLAGS_GET_Z(point->flags)) dimension = 3;
814 
815  ptr += sprintf(ptr, "<%sPoint", prefix);
816  if ( srs ) ptr += sprintf(ptr, " srsName=\"%s\"", srs);
817  if ( id ) ptr += sprintf(ptr, " %sid=\"%s\"", prefix, id);
818  if ( lwpoint_is_empty(point) )
819  {
820  ptr += sprintf(ptr, "/>");
821  return (ptr-output);
822  }
823 
824  ptr += sprintf(ptr, ">");
825  if (IS_DIMS(opts)) ptr += sprintf(ptr, "<%spos srsDimension=\"%d\">", prefix, dimension);
826  else ptr += sprintf(ptr, "<%spos>", prefix);
827  ptr += pointArray_toGML3(point->point, ptr, precision, opts);
828  ptr += sprintf(ptr, "</%spos></%sPoint>", prefix, prefix);
829 
830  return (ptr-output);
831 }
POINTARRAY * point
Definition: liblwgeom.h:411
#define IS_DIMS(x)
Definition: liblwgeom.h:1544
uint8_t precision
Definition: cu_in_twkb.c:25
#define FLAGS_GET_Z(flags)
Macros for manipulating the &#39;flags&#39; byte.
Definition: liblwgeom.h:140
uint8_t flags
Definition: liblwgeom.h:408
static size_t pointArray_toGML3(POINTARRAY *pa, char *buf, int precision, int opts)
Definition: lwout_gml.c:1909
int lwpoint_is_empty(const LWPOINT *point)
Definition: lwpoint.c:291
opts
Definition: ovdump.py:44
Here is the call graph for this function:
Here is the caller graph for this function: