PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ asx3d3_line_sb()

static int asx3d3_line_sb ( const LWLINE line,
int  precision,
int  opts,
__attribute__((__unused__)) const char *  defid,
stringbuffer_t sb 
)
static

Return the linestring as an X3D LineSet.

Definition at line 221 of file lwout_x3d.c.

226 {
227 
228  /* int dimension=2; */
229  POINTARRAY *pa;
230 
231 
232  /* if (FLAGS_GET_Z(line->flags)) dimension = 3; */
233 
234  pa = line->points;
235  stringbuffer_aprintf(sb, "<LineSet %s vertexCount='%d'>", defid, pa->npoints);
236 
237  if ( X3D_USE_GEOCOORDS(opts) ) stringbuffer_aprintf(sb, "<GeoCoordinate geoSystem='\"GD\" \"WE\" \"%s\"' point='", ( (opts & LW_X3D_FLIP_XY) ? "latitude_first" : "longitude_first") );
238  else
239  stringbuffer_aprintf(sb, "<Coordinate point='");
240 
242 
243 
244  stringbuffer_aprintf(sb, "' />");
245 
246  return stringbuffer_aprintf(sb, "</LineSet>");
247 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define LW_X3D_FLIP_XY
Macros for specifying X3D options.
Definition: liblwgeom.h:1700
#define X3D_USE_GEOCOORDS(x)
Definition: liblwgeom.h:1702
int lwline_is_closed(const LWLINE *line)
Definition: lwline.c:445
static int ptarray_to_x3d3_sb(POINTARRAY *pa, int precision, int opts, int is_closed, stringbuffer_t *sb)
In X3D3, coordinates are separated by a space separator.
Definition: lwout_x3d.c:511
opts
Definition: ovdump.py:45
int stringbuffer_aprintf(stringbuffer_t *s, const char *fmt,...)
Appends a formatted string to the current string buffer, using the format and argument list provided.
Definition: stringbuffer.c:247
POINTARRAY * points
Definition: liblwgeom.h:483
uint32_t npoints
Definition: liblwgeom.h:427

References LW_X3D_FLIP_XY, lwline_is_closed(), POINTARRAY::npoints, ovdump::opts, LWLINE::points, precision, ptarray_to_x3d3_sb(), stringbuffer_aprintf(), and X3D_USE_GEOCOORDS.

Referenced by asx3d3_collection_sb(), and lwgeom_to_x3d3_sb().

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