PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ lwgeom_to_x3d3_sb()

static int lwgeom_to_x3d3_sb ( const LWGEOM geom,
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 66 of file lwout_x3d.c.

67 {
68  int type = geom->type;
69 
70  switch (type)
71  {
72  case POINTTYPE:
73  return asx3d3_point_sb((LWPOINT *)geom, precision, opts, defid, sb);
74 
75  case LINETYPE:
76  return asx3d3_line_sb((LWLINE *)geom, precision, opts, defid, sb);
77 
78  case POLYGONTYPE:
79  {
84  asx3d3_multi_sb(tmp, precision, opts, defid, sb);
85  lwcollection_free(tmp);
86  return LW_SUCCESS;
87  }
88 
89  case TRIANGLETYPE:
90  return asx3d3_triangle_sb((LWTRIANGLE *)geom, precision, opts, defid, sb);
91 
92  case MULTIPOINTTYPE:
93  case MULTILINETYPE:
94  case MULTIPOLYGONTYPE:
95  return asx3d3_multi_sb((LWCOLLECTION *)geom, precision, opts, defid, sb);
96 
98  return asx3d3_psurface_sb((LWPSURFACE *)geom, precision, opts, defid, sb);
99 
100  case TINTYPE:
101  return asx3d3_tin_sb((LWTIN *)geom, precision, opts, defid, sb);
102 
103  case COLLECTIONTYPE:
104  return asx3d3_collection_sb((LWCOLLECTION *)geom, precision, opts, defid, sb);
105 
106  default:
107  lwerror("lwgeom_to_x3d3: '%s' geometry type not supported", lwtype_name(type));
108  return LW_FAILURE;
109  }
110 }
static uint8_t precision
Definition: cu_in_twkb.c:25
#define COLLECTIONTYPE
Definition: liblwgeom.h:108
#define LW_FAILURE
Definition: liblwgeom.h:96
#define MULTILINETYPE
Definition: liblwgeom.h:106
LWGEOM * lwgeom_as_multi(const LWGEOM *lwgeom)
Create a new LWGEOM of the appropriate MULTI* type.
Definition: lwgeom.c:380
#define LINETYPE
Definition: liblwgeom.h:103
#define LW_SUCCESS
Definition: liblwgeom.h:97
#define MULTIPOINTTYPE
Definition: liblwgeom.h:105
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:102
#define TINTYPE
Definition: liblwgeom.h:116
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:107
#define POLYGONTYPE
Definition: liblwgeom.h:104
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:114
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:216
void lwcollection_free(LWCOLLECTION *col)
Definition: lwcollection.c:357
#define TRIANGLETYPE
Definition: liblwgeom.h:115
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
static int asx3d3_collection_sb(const LWCOLLECTION *col, int precision, int opts, const char *defid, stringbuffer_t *sb)
Definition: lwout_x3d.c:451
static int asx3d3_point_sb(const LWPOINT *point, int precision, int opts, __attribute__((__unused__)) const char *defid, stringbuffer_t *sb)
Definition: lwout_x3d.c:113
static int asx3d3_multi_sb(const LWCOLLECTION *col, int precision, int opts, const char *defid, stringbuffer_t *sb)
Definition: lwout_x3d.c:282
static int asx3d3_tin_sb(const LWTIN *tin, int precision, int opts, const char *defid, stringbuffer_t *sb)
Definition: lwout_x3d.c:414
static int asx3d3_triangle_sb(const LWTRIANGLE *triangle, int precision, int opts, __attribute__((__unused__)) const char *defid, stringbuffer_t *sb)
Definition: lwout_x3d.c:268
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.
Definition: lwout_x3d.c:221
static int asx3d3_psurface_sb(const LWPSURFACE *psur, int precision, int opts, const char *defid, stringbuffer_t *sb)
Definition: lwout_x3d.c:361
opts
Definition: ovdump.py:45
type
Definition: ovdump.py:42
uint8_t type
Definition: liblwgeom.h:462

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, ovdump::opts, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, precision, TINTYPE, TRIANGLETYPE, LWGEOM::type, and ovdump::type.

Referenced by lwgeom_to_x3d3().

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