PostGIS  2.2.7dev-r@@SVN_REVISION@@
static size_t asx3d3_line_buf ( const LWLINE line,
char *  srs,
char *  output,
int  precision,
int  opts,
const char *  defid 
)
static

Definition at line 164 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().

165 {
166  char *ptr=output;
167  /* int dimension=2; */
168  POINTARRAY *pa;
169 
170 
171  /* if (FLAGS_GET_Z(line->flags)) dimension = 3; */
172 
173  pa = line->points;
174  ptr += sprintf(ptr, "<LineSet %s vertexCount='%d'>", defid, pa->npoints);
175 
176  if ( X3D_USE_GEOCOORDS(opts) ) ptr += sprintf(ptr, "<GeoCoordinate geoSystem='\"GD\" \"WE\" \"%s\"' point='", ( (opts & LW_X3D_FLIP_XY) ? "latitude_first" : "longitude_first") );
177  else
178  ptr += sprintf(ptr, "<Coordinate point='");
179  ptr += pointArray_toX3D3(line->points, ptr, precision, opts, lwline_is_closed((LWLINE *) line));
180 
181  ptr += sprintf(ptr, "' />");
182 
183  ptr += sprintf(ptr, "</LineSet>");
184  return (ptr-output);
185 }
int npoints
Definition: liblwgeom.h:355
#define X3D_USE_GEOCOORDS(x)
Definition: liblwgeom.h:1489
#define LW_X3D_FLIP_XY
Macros for specifying X3D options.
Definition: liblwgeom.h:1487
uint8_t precision
Definition: cu_in_twkb.c:25
int lwline_is_closed(const LWLINE *line)
Definition: lwline.c:439
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:819
POINTARRAY * points
Definition: liblwgeom.h:406

Here is the call graph for this function:

Here is the caller graph for this function: