function to convert the geomtries to strings
493137
def __geomToStringArray(self, geometries, returnType="str"):
        
        listGeoms = []
        for g in geometries:
            if isinstance(g, Point):
                listGeoms.append(g.asDictionary)
            elif isinstance(g, Polygon):
                listGeoms.append(g.asDictionary) #json.dumps(
            elif isinstance(g, Polyline):
                listGeoms.append({'paths' : g.asDictionary['paths']})
        if returnType == "str":
            return json.dumps(listGeoms)
        elif returnType == "list":
            return listGeoms
        else:
            return json.dumps(listGeoms)
1112802
def parse_geometry(geometry):
    """"""

    m = re.match("(\d+)x(\d+)([-+]\d+)([-+]\d+)", geometry)
    if not m:
        raise ValueError("failed to parse geometry string")
    return map(int, m.groups())
795998
def tostr(self):
        """"""
        element = _transform.SVGFigure(self.width, self.height)
        element.append(self)
        svgstr = element.to_str()
        return svgstr
672131
def _dump_linestring(obj, decimals):
    
    coords = obj['coordinates']
    ls = 'LINESTRING (%s)'
    ls %= ', '.join(' '.join(_round_and_pad(c, decimals)
                             for c in pt) for pt in coords)
    return ls
333224
def path_to_geom_dicts(path, skip_invalid=True):
    
    interface = path.interface.datatype
    if interface == 'geodataframe':
        return [row.to_dict() for _, row in path.data.iterrows()]
    elif interface == 'geom_dictionary':
        return path.data

    geoms = []
    invalid = False
    xdim, ydim = path.kdims
    for i, path in enumerate(path.split(datatype='columns')):
        array = np.column_stack([path.pop(xdim.name), path.pop(ydim.name)])
        splits = np.where(np.isnan(array[:, :2].astype('float')).sum(axis=1))[0]
        arrays = np.split(array, splits+1) if len(splits) else [array]
        subpaths = []
        for j, arr in enumerate(arrays):
            if j != (len(arrays)-1):
                arr = arr[:-1] # Drop nan

            if len(arr) == 0:
                continue
            elif len(arr) == 1:
                if skip_invalid:
                    continue
                g = Point(arr[0])
                invalid = True
            else:
                g = LineString(arr)
            subpaths.append(g)

        if invalid:
            geoms += [dict(path, geometry=sp) for sp in subpaths]
            continue
        elif len(subpaths) == 1:
            geom = subpaths[0]
        elif subpaths:
            geom = MultiLineString(subpaths)
        path['geometry'] = geom
        geoms.append(path)
    return geoms
912863
function writeMultiLineStringGeometry_(geometry) {
  if (geometry instanceof olGeomMultiLineString) {
    const ends = geometry.getEnds();
    const lineStringCount = ends.length;
    const flatCoordinates = geometry.getFlatCoordinates();
    const stride = geometry.getStride();
    let offset = 0;
    const textArray = ['L('];
    for (let i = 0; i < lineStringCount; ++i) {
      const end = ends[i];
      const text = this.encodeCoordinates_(flatCoordinates, stride, offset, end);
      if (i !== 0) {
        textArray.push('\'');
      }
      textArray.push(text);
      offset = end;
    }
    textArray.push(')');
    return textArray.join('');
  }
  return null;
}
198491
def geosgeometry_str_to_struct(value):
    '''
    
    '''

    result = geos_ptrn.match(value)

    if not result:
        return None

    return {
        'srid': result.group(1),
        'x': result.group(2),
        'y': result.group(3),
    }
735066
def _get_table_as_string(self):
        """"""
        tablelist = []
        tablelist.append("!%s_table_begin" % self.geotype.lower())
        tablelist.append("\t".join(self.table.columns))
        for idx, row in self.table.iterrows():
            tablelist.append("\t".join(map(str, row)))
        tablelist.append("!%s_table_end" % self.geotype.lower())
        return "\n".join(tablelist)
1287566
function lodashFunctionToString(functionName) {
	var moduleText = readFileSync(localRequire.resolve(getLodashId(functionName)), 'utf-8');

	return function () {
		return 'function '+functionName+'() {var module = {exports:{}};'+moduleText+'\nreturn module.exports.apply({}, arguments);};';
	}
}
304840
def toString(self):
        
        result = []
        k, v = self.optimalRepr()
        longest = reduce(lambda x, y: x if x > len(y) else len(y), k, 0)
        for ind in range(len(k)):
            result.append("%s : %s" % (k[ind].ljust(longest), v[ind]))
        return "\n".join(result)
1124962
public static void toGeojsonGeometry(Geometry geom, StringBuilder sb) {
        if (geom instanceof Point) {
            toGeojsonPoint((Point) geom, sb);
        } else if (geom instanceof LineString) {
            toGeojsonLineString((LineString) geom, sb);
        } else if (geom instanceof Polygon) {
            toGeojsonPolygon((Polygon) geom, sb);
        } else if (geom instanceof MultiPoint) {
            toGeojsonMultiPoint((MultiPoint) geom, sb);
        } else if (geom instanceof MultiLineString) {
            toGeojsonMultiLineString((MultiLineString) geom, sb);
        } else if (geom instanceof MultiPolygon) {
            toGeojsonMultiPolygon((MultiPolygon) geom, sb);
        } else {
            toGeojsonGeometryCollection((GeometryCollection) geom, sb);
        }
    }
593462
def to_s
      str = "Polyline["
      vertices.each do |vertex|
        str += vertex.to_element_s + ", "
      end
      str.slice!(str.length - 2, 2) if(vertices.size > 0)
      str += "] "
      str += "open" if(@is_open)
      str += "closed" if(!@is_open)
      return str
    end
411598
def _ToString(x):
    """"""
    # Some cross-language values for primitives.  This is tested in
    # jsontemplate_test.py.
    if x is None:
        return 'null'
    if isinstance(x, six.string_types):
        return x
    return pprint.pformat(x)
566435
def to_string(self, formatter = 'D'):
        '''
        
        '''
        return (self.lat.to_string(formatter), self.lon.to_string(formatter))
1179128
function stringify(x) {
	if (x === Object(x) && x.t === 'MetaString') return x.c;

  var result = [];
  var go = function (key, val) {
    if (key === 'Str') result.push(val);
    else if (key === 'Code') result.push(val[1]);
    else if (key === 'Math') result.push(val[1]);
    else if (key === 'LineBreak') result.push(' ');
    else if (key === 'Space') result.push(' ');
  };
  walk(x, go, '', {});
  return result.join('');
}
353073
function generateLineString() {
  var coordNumber = getRandomNumber(3, options.maxCoordCount);

  var feature = rawFeature();
  feature.geometry.type = 'LineString';

  addCoordinates(feature.geometry.coordinates, coordNumber);

  return feature;
}
835515
def mapping_to_str(mapping):
    """"""
    result = ["<"]
    for i, (key, value) in enumerate(mapping.items()):
        if i > 0:
            result.append(",")
        result += [key, "=", serialize_for_header(key, value)]
    result += [">"]
    return "".join(result)