]> granicus.if.org Git - postgis/commitdiff
#2838 collection handling partially fixed - fix size computation for tins and add...
authorRegina Obe <lr@pcorp.us>
Fri, 25 Jul 2014 20:41:07 +0000 (20:41 +0000)
committerRegina Obe <lr@pcorp.us>
Fri, 25 Jul 2014 20:41:07 +0000 (20:41 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@12831 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwout_x3d.c

index bb32c2b3a8fe85af091dee8474a39cd3829a20c4..ba46fbc7a6a903a0f818b1b29d0e5823b64aa774 100644 (file)
@@ -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("<MultiGeometry></MultiGeometry>") + defidlen*2;
+       //size = sizeof("<MultiGeometry></MultiGeometry>") + 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; i<col->ngeoms; i++)
        {
                subgeom = col->geoms[i];
-               size += ( sizeof("<geometryMember>/") + defidlen ) * 2;
+               //size += ( sizeof("<geometryMember>/") + 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) )
                {