PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ asx3d3_line_sb()

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

Return the linestring as an X3D LineSet.

Definition at line 219 of file lwout_x3d.c.

221 {
222 
223  /* int dimension=2; */
224  POINTARRAY *pa;
225 
226 
227  /* if (FLAGS_GET_Z(line->flags)) dimension = 3; */
228 
229  pa = line->points;
230  stringbuffer_aprintf(sb, "<LineSet %s vertexCount='%d'>", defid, pa->npoints);
231 
232  if ( X3D_USE_GEOCOORDS(opts) ) stringbuffer_aprintf(sb, "<GeoCoordinate geoSystem='\"GD\" \"WE\" \"%s\"' point='", ( (opts & LW_X3D_FLIP_XY) ? "latitude_first" : "longitude_first") );
233  else
234  stringbuffer_aprintf(sb, "<Coordinate point='");
235 
237 
238 
239  stringbuffer_aprintf(sb, "' />");
240 
241  return stringbuffer_aprintf(sb, "</LineSet>");
242 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define LW_X3D_FLIP_XY
Macros for specifying X3D options.
Definition: liblwgeom.h:1560
#define X3D_USE_GEOCOORDS(x)
Definition: liblwgeom.h:1562
int lwline_is_closed(const LWLINE *line)
Definition: lwline.c:454
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:502
opts
Definition: ovdump.py:44
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:253
POINTARRAY * points
Definition: liblwgeom.h:425
uint32_t npoints
Definition: liblwgeom.h:374

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: