From: Regina Obe Date: Fri, 25 Jul 2014 20:41:07 +0000 (+0000) Subject: #2838 collection handling partially fixed - fix size computation for tins and add... X-Git-Tag: 2.2.0rc1~935 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c4377ea18234e1965683017fc94d6a06014df1b8;p=postgis #2838 collection handling partially fixed - fix size computation for tins and add support for polyhedralsurface in geometry collection git-svn-id: http://svn.osgeo.org/postgis/trunk@12831 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/liblwgeom/lwout_x3d.c b/liblwgeom/lwout_x3d.c index bb32c2b3a..ba46fbc7a 100644 --- a/liblwgeom/lwout_x3d.c +++ b/liblwgeom/lwout_x3d.c @@ -667,7 +667,8 @@ asx3d3_collection_size(const LWCOLLECTION *col, char *srs, int precision, int op size_t defidlen = strlen(defid); LWGEOM *subgeom; - size = sizeof("") + defidlen*2; + //size = sizeof("") + defidlen*2; + size = defidlen*2; if ( srs ) size += strlen(srs) + sizeof(" srsName=.."); @@ -675,7 +676,7 @@ asx3d3_collection_size(const LWCOLLECTION *col, char *srs, int precision, int op for (i=0; ingeoms; i++) { subgeom = col->geoms[i]; - size += ( sizeof("/") + defidlen ) * 2; + //size += ( sizeof("/") + defidlen ) * 2; if ( subgeom->type == POINTTYPE ) { size += asx3d3_point_size((LWPOINT*)subgeom, 0, precision, opts, defid); @@ -688,6 +689,14 @@ asx3d3_collection_size(const LWCOLLECTION *col, char *srs, int precision, int op { size += asx3d3_poly_size((LWPOLY*)subgeom, 0, precision, opts, defid); } + else if ( subgeom->type == TINTYPE ) + { + size += asx3d3_tin_size((LWTIN*)subgeom, 0, precision, opts, defid); + } + else if ( subgeom->type == POLYHEDRALSURFACETYPE ) + { + size += asx3d3_psurface_size((LWPSURFACE*)subgeom, 0, precision, opts, defid); + } else if ( lwgeom_is_collection(subgeom) ) { size += asx3d3_multi_size((LWCOLLECTION*)subgeom, 0, precision, opts, defid); @@ -739,6 +748,11 @@ asx3d3_collection_buf(const LWCOLLECTION *col, char *srs, char *output, int prec { ptr += asx3d3_tin_buf((LWTIN*)subgeom, srs, ptr, precision, opts, defid); + } + else if ( subgeom->type == POLYHEDRALSURFACETYPE ) + { + ptr += asx3d3_psurface_buf((LWPSURFACE*)subgeom, srs, ptr, precision, opts, defid); + } else if ( lwgeom_is_collection(subgeom) ) {