code: function(features) {
          var feature;
          if (features.constructor == Array)
              feature = features[0];
          else
              feature = features;
  
          var geometry = feature.geometry;
          var type = geometry.CLASS_NAME.split('.')[2].toLowerCase();
  
          var pointGeometries;
          if (type == "point")
              pointGeometries = new Array(geometry);
          else if (type == "linestring" ||
                   type == "linearring" ||
                   type == "multipoint")
              pointGeometries = geometry.components;
          else if (type == "polygon")
              pointGeometries = geometry.components[0].components;
          else
              return null;
  
          var flatPoints = [];
  
          var pointGeometriesLength = pointGeometries.length;
          for (var i = 0; i < pointGeometriesLength; ++i) {
              var pointGeometry = pointGeometries[i];
              flatPoints.push(pointGeometry.y);
              flatPoints.push(pointGeometry.x);
          }
  
          return this.encodeDeltas(flatPoints, 2);
      }
docs: APIMethod: write
  Serialize a feature or array of features into a WKT string.
  
  Parameters:
  features - {<OpenLayers.Feature.Vector>|Array} A feature or array of
  features
  
  Returns:
  {String} The WKT string representation of the input geometries