PostGIS  3.0.0dev-r@@SVN_REVISION@@

◆ pointArray_svg_abs()

static size_t pointArray_svg_abs ( POINTARRAY pa,
char *  output,
int  close_ring,
int  precision 
)
static

Returns maximum size of rendered pointarray in bytes.

Definition at line 614 of file lwout_svg.c.

References getPoint2d_p(), lwprint_double(), POINTARRAY::npoints, OUT_DOUBLE_BUFFER_SIZE, pixval::x, POINT2D::x, pixval::y, and POINT2D::y.

Referenced by assvg_line_buf(), and assvg_polygon_buf().

615 {
616  int i, end;
617  char *ptr;
620  POINT2D pt;
621 
622  ptr = output;
623 
624  if (close_ring) end = pa->npoints;
625  else end = pa->npoints - 1;
626 
627  for (i=0 ; i < end ; i++)
628  {
629  getPoint2d_p(pa, i, &pt);
630 
633 
634  if (i == 1) ptr += sprintf(ptr, " L ");
635  else if (i) ptr += sprintf(ptr, " ");
636  ptr += sprintf(ptr,"%s %s", x, y);
637  }
638 
639  return (ptr-output);
640 }
int lwprint_double(double d, int maxdd, char *buf, size_t bufsize)
Definition: lwprint.c:490
double x
Definition: liblwgeom.h:330
uint8_t precision
Definition: cu_in_twkb.c:25
double y
Definition: liblwgeom.h:330
int getPoint2d_p(const POINTARRAY *pa, uint32_t n, POINT2D *point)
Definition: lwgeom_api.c:337
#define OUT_DOUBLE_BUFFER_SIZE
uint32_t npoints
Definition: liblwgeom.h:373
Here is the call graph for this function:
Here is the caller graph for this function: