PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ pointArray_toGML3()

static size_t pointArray_toGML3 ( POINTARRAY pa,
char *  buf,
int  precision,
int  opts 
)
static

Definition at line 1890 of file lwout_gml.c.

1891 {
1892  uint32_t i;
1893  char *ptr;
1894  char x[OUT_DOUBLE_BUFFER_SIZE];
1895  char y[OUT_DOUBLE_BUFFER_SIZE];
1896  char z[OUT_DOUBLE_BUFFER_SIZE];
1897 
1898  ptr = output;
1899 
1900  if ( ! FLAGS_GET_Z(pa->flags) )
1901  {
1902  for (i=0; i<pa->npoints; i++)
1903  {
1904  const POINT2D *pt;
1905  pt = getPoint2d_cp(pa, i);
1910 
1911  if ( i ) ptr += sprintf(ptr, " ");
1912  if (IS_DEGREE(opts))
1913  ptr += sprintf(ptr, "%s %s", y, x);
1914  else
1915  ptr += sprintf(ptr, "%s %s", x, y);
1916  }
1917  }
1918  else
1919  {
1920  for (i=0; i<pa->npoints; i++)
1921  {
1922  const POINT3DZ *pt;
1923  pt = getPoint3dz_cp(pa, i);
1924 
1931 
1932  if ( i ) ptr += sprintf(ptr, " ");
1933  if (IS_DEGREE(opts))
1934  ptr += sprintf(ptr, "%s %s %s", y, x, z);
1935  else
1936  ptr += sprintf(ptr, "%s %s %s", x, y, z);
1937  }
1938  }
1939 
1940  return ptr-output;
1941 }
static uint8_t precision
Definition: cu_in_twkb.c:25
const POINT3DZ * getPoint3dz_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT3DZ pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
Definition: lwgeom_api.c:388
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:140
#define IS_DEGREE(x)
Definition: liblwgeom.h:1552
const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
Definition: lwgeom_api.c:374
#define OUT_DOUBLE_BUFFER_SIZE
int lwprint_double(double d, int maxdd, char *buf, size_t bufsize)
Definition: lwprint.c:490
opts
Definition: ovdump.py:44
double y
Definition: liblwgeom.h:331
double x
Definition: liblwgeom.h:331
double z
Definition: liblwgeom.h:337
double x
Definition: liblwgeom.h:337
double y
Definition: liblwgeom.h:337
uint32_t npoints
Definition: liblwgeom.h:374
uint8_t flags
Definition: liblwgeom.h:372
unsigned int uint32_t
Definition: uthash.h:78

References POINTARRAY::flags, FLAGS_GET_Z, getPoint2d_cp(), getPoint3dz_cp(), IS_DEGREE, lwprint_double(), POINTARRAY::npoints, ovdump::opts, OUT_DOUBLE_BUFFER_SIZE, precision, POINT2D::x, POINT3DZ::x, pixval::x, POINT2D::y, POINT3DZ::y, pixval::y, and POINT3DZ::z.

Referenced by asgml3_circstring_buf(), asgml3_compound_buf(), asgml3_curvepoly_buf(), asgml3_line_buf(), asgml3_point_buf(), asgml3_poly_buf(), asgml3_triangle_buf(), and gbox_to_gml3().

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