]> granicus.if.org Git - postgis/commitdiff
#2838 grudgingly wrap shape tags around collected geometries. It's the only way...
authorRegina Obe <lr@pcorp.us>
Fri, 1 Aug 2014 10:58:12 +0000 (10:58 +0000)
committerRegina Obe <lr@pcorp.us>
Fri, 1 Aug 2014 10:58:12 +0000 (10:58 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@12847 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwout_x3d.c

index ba46fbc7a6a903a0f818b1b29d0e5823b64aa774..dacb426394f743b4f33a143fc4ca732b555b5cf1 100644 (file)
@@ -670,13 +670,13 @@ asx3d3_collection_size(const LWCOLLECTION *col, char *srs, int precision, int op
        //size = sizeof("<MultiGeometry></MultiGeometry>") + defidlen*2;
        size = defidlen*2;
 
-       if ( srs )
-               size += strlen(srs) + sizeof(" srsName=..");
+       /** if ( srs )
+               size += strlen(srs) + sizeof(" srsName=.."); **/
 
        for (i=0; i<col->ngeoms; i++)
        {
                subgeom = col->geoms[i];
-               //size += ( sizeof("<geometryMember>/") + defidlen ) * 2;
+               size += ( sizeof("<Shape />") + defidlen ) * 2; /** for collections we need to wrap each in a shape tag to make valid **/
                if ( subgeom->type == POINTTYPE )
                {
                        size += asx3d3_point_size((LWPOINT*)subgeom, 0, precision, opts, defid);
@@ -731,7 +731,7 @@ asx3d3_collection_buf(const LWCOLLECTION *col, char *srs, char *output, int prec
        for (i=0; i<col->ngeoms; i++)
        {
                subgeom = col->geoms[i];
-               //ptr += sprintf(ptr, "<%sgeometryMember>", defid);
+               ptr += sprintf(ptr, "<Shape%s>", defid);
                if ( subgeom->type == POINTTYPE )
                {
                        ptr += asx3d3_point_buf((LWPOINT*)subgeom, 0, ptr, precision, opts, defid);
@@ -764,7 +764,7 @@ asx3d3_collection_buf(const LWCOLLECTION *col, char *srs, char *output, int prec
                else
                        lwerror("asx3d3_collection_buf: unknown geometry type");
 
-               //ptr += sprintf(ptr, "</%sgeometryMember>", defid);
+               ptr += sprintf(ptr, "</Shape>", defid);
        }
 
        /* Close outmost tag */