PostGIS 3.0.6dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ lwgeom_to_x3d3_sb()

static int lwgeom_to_x3d3_sb ( const LWGEOM geom,
char *  srs,
int  precision,
int  opts,
const char *  defid,
stringbuffer_t sb 
)
static

We might change this later, but putting a polygon in an indexed face set seems like the simplest way to go so treat just like a mulitpolygon

Definition at line 67 of file lwout_x3d.c.

68{
69 int type = geom->type;
70
71 switch (type)
72 {
73 case POINTTYPE:
74 return asx3d3_point_sb((LWPOINT*)geom, srs, precision, opts, defid, sb);
75
76 case LINETYPE:
77 return asx3d3_line_sb((LWLINE*)geom, srs, precision, opts, defid, sb);
78
79 case POLYGONTYPE:
80 {
85 asx3d3_multi_sb(tmp, srs, precision, opts, defid, sb);
87 return LW_SUCCESS;
88 }
89
90 case TRIANGLETYPE:
91 return asx3d3_triangle_sb((LWTRIANGLE*)geom, srs, precision, opts, defid, sb);
92
93 case MULTIPOINTTYPE:
94 case MULTILINETYPE:
96 return asx3d3_multi_sb((LWCOLLECTION*)geom, srs, precision, opts, defid, sb);
97
99 return asx3d3_psurface_sb((LWPSURFACE*)geom, srs, precision, opts, defid, sb);
100
101 case TINTYPE:
102 return asx3d3_tin_sb((LWTIN*)geom, srs, precision, opts, defid, sb);
103
104 case COLLECTIONTYPE:
105 return asx3d3_collection_sb((LWCOLLECTION*)geom, srs, precision, opts, defid, sb);
106
107 default:
108 lwerror("lwgeom_to_x3d3: '%s' geometry type not supported", lwtype_name(type));
109 return LW_FAILURE;
110 }
111}
static uint8_t precision
Definition cu_in_twkb.c:25
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition lwutil.c:216
#define COLLECTIONTYPE
Definition liblwgeom.h:122
#define LW_FAILURE
Definition liblwgeom.h:110
LWGEOM * lwgeom_as_multi(const LWGEOM *lwgeom)
Create a new LWGEOM of the appropriate MULTI* type.
Definition lwgeom.c:362
#define MULTILINETYPE
Definition liblwgeom.h:120
#define LINETYPE
Definition liblwgeom.h:117
#define LW_SUCCESS
Definition liblwgeom.h:111
#define MULTIPOINTTYPE
Definition liblwgeom.h:119
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition liblwgeom.h:116
#define TINTYPE
Definition liblwgeom.h:130
#define MULTIPOLYGONTYPE
Definition liblwgeom.h:121
#define POLYGONTYPE
Definition liblwgeom.h:118
#define POLYHEDRALSURFACETYPE
Definition liblwgeom.h:128
void lwcollection_free(LWCOLLECTION *col)
#define TRIANGLETYPE
Definition liblwgeom.h:129
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition lwutil.c:190
static int asx3d3_tin_sb(const LWTIN *tin, __attribute__((__unused__)) char *srs, int precision, int opts, const char *defid, stringbuffer_t *sb)
Definition lwout_x3d.c:402
static int asx3d3_psurface_sb(const LWPSURFACE *psur, char *srs, int precision, int opts, const char *defid, stringbuffer_t *sb)
Definition lwout_x3d.c:349
static int asx3d3_triangle_sb(const LWTRIANGLE *triangle, __attribute__((__unused__)) char *srs, int precision, int opts, __attribute__((__unused__)) const char *defid, stringbuffer_t *sb)
Definition lwout_x3d.c:259
static int asx3d3_collection_sb(const LWCOLLECTION *col, char *srs, int precision, int opts, const char *defid, stringbuffer_t *sb)
Definition lwout_x3d.c:440
static int asx3d3_point_sb(const LWPOINT *point, __attribute__((__unused__)) char *srs, int precision, int opts, __attribute__((__unused__)) const char *defid, stringbuffer_t *sb)
Definition lwout_x3d.c:114
static int asx3d3_multi_sb(const LWCOLLECTION *col, __attribute__((__unused__)) char *srs, int precision, int opts, const char *defid, stringbuffer_t *sb)
Definition lwout_x3d.c:270
static int asx3d3_line_sb(const LWLINE *line, __attribute__((__unused__)) char *srs, int precision, int opts, __attribute__((__unused__)) const char *defid, stringbuffer_t *sb)
Return the linestring as an X3D LineSet.
Definition lwout_x3d.c:219
uint8_t type
Definition liblwgeom.h:448

References asx3d3_collection_sb(), asx3d3_line_sb(), asx3d3_multi_sb(), asx3d3_point_sb(), asx3d3_psurface_sb(), asx3d3_tin_sb(), asx3d3_triangle_sb(), COLLECTIONTYPE, LINETYPE, LW_FAILURE, LW_SUCCESS, lwcollection_free(), lwerror(), lwgeom_as_multi(), lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, precision, TINTYPE, TRIANGLETYPE, and LWGEOM::type.

Referenced by lwgeom_to_x3d3().

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