[postgis-commits] svn - r2710 - trunk/lwgeom
postgis-commits at postgis.refractions.net
postgis-commits at postgis.refractions.net
Wed Oct 10 14:27:52 PDT 2007
Author: mcayland
Date: 2007-10-10 14:27:51 -0700 (Wed, 10 Oct 2007)
New Revision: 2710
Modified:
trunk/lwgeom/lwgeom_gml.c
Log:
Apply extra fixes for the reworked AsGML() function to ensure that enough memory is allocated for the GML output. Patch supplied by Barbara Phillipot.
Modified: trunk/lwgeom/lwgeom_gml.c
===================================================================
--- trunk/lwgeom/lwgeom_gml.c 2007-09-28 10:18:23 UTC (rev 2709)
+++ trunk/lwgeom/lwgeom_gml.c 2007-10-10 21:27:51 UTC (rev 2710)
@@ -302,6 +302,8 @@
/* the longest possible multi version */
size = sizeof("<gml:MultiLineString></gml:MultiLineString>");
+ size += sizeof("<gml:lineStringMember>/") * 2;
+
if ( srs ) size += strlen(srs) + sizeof(" srsName=..");
for (i=0; i<insp->ngeometries; i++)
@@ -643,6 +645,7 @@
asgml3_poly_buf(poly, srs, output);
return output;
}
+
/*
* Compute max size required for GML version of this
* inspected geometry. Will recurse when needed.
@@ -656,6 +659,8 @@
/* the longest possible multi version */
size = sizeof("<gml:MultiLineString></gml:MultiLineString>");
+ size += sizeof("<gml:curveMember>/") * 2;
+
if ( srs ) size += strlen(srs) + sizeof(" srsName=..");
for (i=0; i<insp->ngeometries; i++)
More information about the postgis-commits
mailing list