s.append(","); nextIndex = createOGCWKT(coords, nextIndex, s, false);
s.append(", "); nextIndex = createOGCWKT(coords, nextIndex, s, isGeometryCollection);
	private int createOGCWKT(double []coords, int startIndex, StringBuffer s, boolean addGeometryType)	{		int geometryType = (int)coords[startIndex];		int nElements = (int)coords[startIndex + 1];		int nextIndex = startIndex + 2;		if (addGeometryType)		{			if (geometryType == GEOMETRY_POINT)				s.append("POINT ");			else if (geometryType == GEOMETRY_LINESTRING)				s.append("LINESTRING ");			else if (geometryType == GEOMETRY_POLYGON)				s.append("POLYGON ");			else if (geometryType == GEOMETRY_MULTIPOINT)				s.append("MULTIPOINT ");			else if (geometryType == GEOMETRY_MULTILINESTRING)				s.append("MULTILINESTRING ");			else if (geometryType == GEOMETRY_MULTIPOLYGON)				s.append("MULTIPOLYGON ");			else				s.append("GEOMETRYCOLLECTION ");		}		if (nElements == 0)		{			/*			 * Geometry is empty.			 */			s.append("EMPTY ");		}		else if (geometryType == GEOMETRY_POINT)		{			/*			 * Convert point to OGC Well Known Text representation.			 */			if (addGeometryType)				s.append("(");			s.append(coords[nextIndex + 1]);			s.append(" ");			s.append(coords[nextIndex + 2]);			if (addGeometryType)				s.append(")");			nextIndex += 3;		}		else if (geometryType == GEOMETRY_LINESTRING || geometryType == GEOMETRY_POLYGON)		{			/*			 * Convert line or polygon to OGC Well Known Text representation.			 */			if (geometryType == GEOMETRY_POLYGON)				s.append("(");			for (int i = 0; i < nElements; i++)			{				if (coords[nextIndex] == MOVETO)				{					/*					 * End last polygon ring and begin next ring.					 */					if (i > 0)						s.append("), ");					s.append("(");				}				else if (i > 0)				{					s.append(", ");				}				s.append(mGeometryValue[nextIndex + 1]);				s.append(" ");				s.append(mGeometryValue[nextIndex + 2]);				nextIndex += 3;			}			if (geometryType == GEOMETRY_LINESTRING)				s.append(")");			else				s.append("))");		}		else /* GEOMETRY_MULTIPOINT, GEOMETRY_MULTILINESTRING, GEOMETRY_MULTIPOLYGON, GEOMETRYCOLLECTION */		{			/*			 * Expand each geometry in the multiple geometry.			 */			s.append("( ");			for (int i = 0; i < nElements; i++)			{				if (i > 0)					s.append(",");				nextIndex = createOGCWKT(coords, nextIndex, s, false);			}			s.append(")");		}		return(nextIndex);	}