PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ asx3d3_line_buf()

static size_t asx3d3_line_buf ( const LWLINE line,
char *  srs,
char *  output,
int  precision,
int  opts,
const char *  defid 
)
static

Definition at line 185 of file lwout_x3d.c.

References LW_X3D_FLIP_XY, lwline_is_closed(), POINTARRAY::npoints, pointArray_toX3D3(), LWLINE::points, and X3D_USE_GEOCOORDS.

Referenced by asx3d3_collection_buf(), and asx3d3_line().

186 {
187  char *ptr=output;
188  /* int dimension=2; */
189  POINTARRAY *pa;
190 
191 
192  /* if (FLAGS_GET_Z(line->flags)) dimension = 3; */
193 
194  pa = line->points;
195  ptr += sprintf(ptr, "<LineSet %s vertexCount='%d'>", defid, pa->npoints);
196 
197  if ( X3D_USE_GEOCOORDS(opts) ) ptr += sprintf(ptr, "<GeoCoordinate geoSystem='\"GD\" \"WE\" \"%s\"' point='", ( (opts & LW_X3D_FLIP_XY) ? "latitude_first" : "longitude_first") );
198  else
199  ptr += sprintf(ptr, "<Coordinate point='");
200  ptr += pointArray_toX3D3(line->points, ptr, precision, opts, lwline_is_closed((LWLINE *) line));
201 
202  ptr += sprintf(ptr, "' />");
203 
204  ptr += sprintf(ptr, "</LineSet>");
205  return (ptr-output);
206 }
int npoints
Definition: liblwgeom.h:371
#define X3D_USE_GEOCOORDS(x)
Definition: liblwgeom.h:1555
#define LW_X3D_FLIP_XY
Macros for specifying X3D options.
Definition: liblwgeom.h:1553
uint8_t precision
Definition: cu_in_twkb.c:25
int lwline_is_closed(const LWLINE *line)
Definition: lwline.c:468
opts
Definition: ovdump.py:44
static size_t pointArray_toX3D3(POINTARRAY *pa, char *buf, int precision, int opts, int is_closed)
In X3D3, coordinates are separated by a space separator.
Definition: lwout_x3d.c:840
POINTARRAY * points
Definition: liblwgeom.h:422
Here is the call graph for this function:
Here is the caller graph for this function: