135 uint32_t i, j, k, si;
140 for (i=0; i < mgeom->
ngeoms; i++)
146 for (k=0; k < np ; k++)
165 if (i < (mgeom->
ngeoms - 1) )
183 for (i=0; i<psur->
ngeoms; i++)
186 for (l=0; l < patch->
nrings; l++)
189 for (k=0; k < np ; k++)
198 if (l < (patch->
nrings - 1) )
211 if (i < (psur->
ngeoms - 1) )
259 for (i=0; i<poly->
nrings; i++)
296 x3dtype =
"PointSet";
297 if ( dimension == 2 ){
298 x3dtype =
"Polypoint2D";
306 x3dtype =
"IndexedLineSet";
312 x3dtype =
"IndexedFaceSet";
328 for (i=0; i<col->
ngeoms; i++)
330 subgeom = col->
geoms[i];
373 for (i=0; i<psur->
ngeoms; i++)
377 for (k=0; k < np ; k++)
385 if (i < (psur->
ngeoms - 1) )
397 for (i=0; i<psur->
ngeoms; i++)
400 if (i < (psur->
ngeoms - 1) )
423 for (i=0; i<tin->
ngeoms; i++)
426 if (i < (tin->
ngeoms - 1) )
436 for (i=0; i<tin->
ngeoms; i++)
439 if (i < (tin->
ngeoms - 1) )
459 #ifdef PGIS_X3D_OUTERMOST_TAGS
463 for (i=0; i<col->
ngeoms; i++)
465 subgeom = col->
geoms[i];
495 lwerror(
"asx3d3_collection_buf: unknown geometry type");
501 #ifdef PGIS_X3D_OUTERMOST_TAGS
523 if ( !is_closed || i < (pa->
npoints - 1) )
545 if ( !is_closed || i < (pa->
npoints - 1) )
LWGEOM * lwgeom_as_multi(const LWGEOM *lwgeom)
Create a new LWGEOM of the appropriate MULTI* type.
int getPoint2d_p(const POINTARRAY *pa, uint32_t n, POINT2D *point)
#define LW_X3D_FLIP_XY
Macros for specifying X3D options.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
#define FLAGS_GET_Z(flags)
int lwgeom_is_collection(const LWGEOM *lwgeom)
Determine whether a LWGEOM can contain sub-geometries or not.
#define POLYHEDRALSURFACETYPE
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
void lwcollection_free(LWCOLLECTION *col)
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
#define LWSIZE_SET(varsize, len)
void * lwalloc(size_t size)
#define X3D_USE_GEOCOORDS(x)
int lwline_is_closed(const LWLINE *line)
#define OUT_DOUBLE_BUFFER_SIZE
int lwprint_double(double d, int maxdd, char *buf)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
static int lwgeom_to_x3d3_sb(const LWGEOM *geom, int precision, int opts, const char *defid, stringbuffer_t *sb)
static int asx3d3_collection_sb(const LWCOLLECTION *col, int precision, int opts, const char *defid, stringbuffer_t *sb)
static int asx3d3_point_sb(const LWPOINT *point, int precision, int opts, __attribute__((__unused__)) const char *defid, stringbuffer_t *sb)
static int asx3d3_multi_sb(const LWCOLLECTION *col, int precision, int opts, const char *defid, stringbuffer_t *sb)
static int asx3d3_tin_sb(const LWTIN *tin, int precision, int opts, const char *defid, stringbuffer_t *sb)
static int asx3d3_triangle_sb(const LWTRIANGLE *triangle, int precision, int opts, __attribute__((__unused__)) const char *defid, stringbuffer_t *sb)
static int asx3d3_poly_sb(const LWPOLY *poly, int precision, int opts, __attribute__((__unused__)) int is_patch, __attribute__((__unused__)) const char *defid, stringbuffer_t *sb)
Compute the X3D coordinates of the polygon and add to string buffer.
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.
static int asx3d3_mpoly_coordindex_sb(const LWMPOLY *psur, stringbuffer_t *sb)
static int asx3d3_line_sb(const LWLINE *line, int precision, int opts, __attribute__((__unused__)) const char *defid, stringbuffer_t *sb)
Return the linestring as an X3D LineSet.
static int asx3d3_line_coords_sb(const LWLINE *line, int precision, int opts, stringbuffer_t *sb)
static int asx3d3_mline_coordindex_sb(const LWMLINE *mgeom, stringbuffer_t *sb)
static int asx3d3_psurface_sb(const LWPSURFACE *psur, int precision, int opts, const char *defid, stringbuffer_t *sb)
lwvarlena_t * lwgeom_to_x3d3(const LWGEOM *geom, int precision, int opts, const char *defid)
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.
lwvarlena_t * stringbuffer_getvarlenacopy(stringbuffer_t *s)
stringbuffer_t * stringbuffer_create(void)
Allocate a new stringbuffer_t.
void stringbuffer_destroy(stringbuffer_t *s)
Free the stringbuffer_t and all memory managed within it.
static void stringbuffer_append_len(stringbuffer_t *s, const char *a, size_t alen)
Append the specified string to the stringbuffer_t using known length.