Method: parseCoords.multipolygon
Convert a coordinate array from GeoJSON into an
<OpenLayers.Geometry>.

Parameters:
array - {Object} The coordinates array from the GeoJSON fragment.

Returns:
{<OpenLayers.Geometry>} A geometry.
164333
function(array) {
            var polys = [];
            var p = null;
            for(var i=0, len=array.length; i<len; ++i) {
                try {
                    p = this.parseCoords["polygon"].apply(this, [array[i]]);
                } catch(err) {
                    throw err;
                }
                polys.push(p);
            }
            return new OpenLayers.Geometry.MultiPolygon(polys);
        }
649657
function parseCoordinates(coord) {
    if (Array.isArray(coord) && coord.length === 2) {
        return {
            lng: coord[0],
            lat: coord[1],
        };
    }

    if (coord instanceof Object && coord !== null) {
        return {
            lng: coord.lng || coord.lon,
            lat: coord.lat,
        };
    }

    return {};
}
1156295
function parsePolygonGeometry(coordinates) {
		var polygonWkt = [];
		for (var i = 0; i < coordinates.length; i++) {
			polygonWkt.push('(' + parseLineGeometry(coordinates[i]) + ')');
		}
		return polygonWkt.join(', ');
	}
553202
def cosines=(array)
      raise ArgumentError, "Invalid parameter 'array'. Exactly 6 elements needed, got #{array.length}" unless array.length == 6
      @cosines = array.collect {|val| val.to_f}
    end
541515
function toArray(args, pos)
{
    if(pos === void 0)
    {
        pos = 0;
    }
    return Array.prototype.slice.call(args, pos);
}
260729
function(input, isPolygon) {
        if (isCoordArray(input)) {
            // Leaflet Polygons don't need the first point to be repeated, but we do
            const coords = isPolygon ? input.concat([input[0]]) : input;
            return [coords];
        }
        if (input instanceof L.Polyline) {
            // we need some recursivity to support multi-poly*
            return this._initPaths(input.getLatLngs(), (input instanceof L.Polygon));
        }
        if (Array.isArray(input)) {
            // flatten everything, we just need coordinate lists to apply patterns
            return input.reduce((flatArray, p) =>
                flatArray.concat(this._initPaths(p, isPolygon)),
            []);
        }
        return [];
    }
486853
function(array) {
            if(array.length != 2) {
                throw "GeoJSON box coordinates must have 2 elements";
            }
            return new OpenLayers.Geometry.Polygon([
                new OpenLayers.Geometry.LinearRing([
                    new OpenLayers.Geometry.Point(array[0][0], array[0][1]),
                    new OpenLayers.Geometry.Point(array[1][0], array[0][1]),
                    new OpenLayers.Geometry.Point(array[1][0], array[1][1]),
                    new OpenLayers.Geometry.Point(array[0][0], array[1][1]),
                    new OpenLayers.Geometry.Point(array[0][0], array[0][1])
                ])
            ]);
        }
747483
function array(obj) {
  if ('array' === type(obj)) return obj;
  if ('arguments' === type(obj)) return Array.prototype.slice.call(obj, 0);

  return obj  // Only transform objects in to an array when they exist.
    ? [obj]
    : [];
}
70
function() {
        if (this.components) {
            var len = this.components.length;
            if (len > 0 && len <= 2) {
                return this.components[0].clone();
            } else if (len > 2) {
                var sumX = 0.0;
                var sumY = 0.0;
                var x0 = this.components[0].x;
                var y0 = this.components[0].y;
                var area = -1 * this.getArea();
                if (area != 0) {
                    for (var i = 0; i < len - 1; i++) {
                        var b = this.components[i];
                        var c = this.components[i+1];
                        sumX += (b.x + c.x - 2 * x0) * ((b.x - x0) * (c.y - y0) - (c.x - x0) * (b.y - y0));
                        sumY += (b.y + c.y - 2 * y0) * ((b.x - x0) * (c.y - y0) - (c.x - x0) * (b.y - y0));
                    }
                    var x = x0 + sumX / (6 * area);
                    var y = y0 + sumY / (6 * area);
                } else {
                    for (var i = 0; i < len - 1; i++) {
                        sumX += this.components[i].x;
                        sumY += this.components[i].y;
                    }
                    var x = sumX / (len - 1);
                    var y = sumY / (len - 1);
                }
                return new OpenLayers.Geometry.Point(x, y);
            } else {
                return null;
            }
        }
    }
346569
def parseGeometry(self, geometry):
        

        

        self.coordinates = []
        self.index = []
        self.position = 0
        self.lastX = 0 
        self.lastY = 0
        self.isPoly = False
        self.isPoint = True;
        self.dropped = 0;
        self.first = True
        # Used for exception strings
        self._current_string = geometry
        
        reader = _ExtendedUnPacker(geometry)
                
        # Start the parsing
        self._dispatchNextType(reader)
966665
function(geometry) {
        var coordinatesNode = this.createElementNS(this.gmlns,
                                                   "gml:coordinates");
        coordinatesNode.setAttribute("decimal", ".");
        coordinatesNode.setAttribute("cs", ",");
        coordinatesNode.setAttribute("ts", " ");

        var parts = [];

        if(geometry instanceof OpenLayers.Bounds){
            parts.push(geometry.left + "," + geometry.bottom);
            parts.push(geometry.right + "," + geometry.top);
        } else {
            var points = (geometry.components) ? geometry.components : [geometry];
            for(var i=0; i<points.length; i++) {
                parts.push(points[i].x + "," + points[i].y);                
            }            
        }

        var txtNode = this.createTextNode(parts.join(" "));
        coordinatesNode.appendChild(txtNode);
        
        return coordinatesNode;
    }
1250045
function(obj) {
        var feature, geometry, attributes, bbox;
        attributes = (obj.properties) ? obj.properties : {};
        bbox = (obj.geometry && obj.geometry.bbox) || obj.bbox;
        try {
            geometry = this.parseGeometry(obj.geometry);
        } catch(err) {
            // deal with bad geometries
            throw err;
        }
        feature = new OpenLayers.Feature.Vector(geometry, attributes);
        if(bbox) {
            feature.bounds = OpenLayers.Bounds.fromArray(bbox);
        }
        if(obj.id) {
            feature.fid = obj.id;
        }
        return feature;
    }
1028790
private double[][] getPoints(Geometry input) {
        double[][] result = new double[input.getNumPoints()][];
        for (int i = 0; i < input.getPoints().size(); i++) {
            Point p = input.getPointN(i);
            if(p.isMeasured() && p.is3D()) {
                result[i] = new double[]{p.getX(), p.getY(), p.getZ(), p.getM()};
            } else if(p.isMeasured()) {
                // ideally we'd use something like Double.Nan, but JSON doesn't support that.
                result[i] = new double[]{p.getX(), p.getY(), 0, p.getM()};
            } else if(p.is3D()) {
                result[i] = new double[]{p.getX(), p.getY(), p.getZ()};
            } else {
                result[i] = new double[]{p.getX(), p.getY()};
            }
        }
        return result;
    }
393481
function() {
    // convert to a poly point string
    for (var i = 0, il = this.value.length, array = []; i < il; i++)
      array.push(this.value[i].join(','))

    return array.join(' ')
  }
307963
def convertor(geometry, method="wgs2gcj"):
    
    if geometry['type'] == 'Point':
        coords = geometry['coordinates']
        coords[0], coords[1] = methods[method](coords[0], coords[1])
    elif geometry['type'] == 'LineString' or geometry['type'] == 'MutliPoint':
        coordinates = geometry['coordinates']
        for coords in coordinates:
            coords[0], coords[1] = methods[method](coords[0], coords[1])
    elif geometry['type'] == 'Polygon' or geometry['type'] == 'MultiLineString':
        coordinates = geometry['coordinates']
        for rings in coordinates:
            for coords in rings:
                coords[0], coords[1] = methods[method](coords[0], coords[1])
    elif geometry['type'] == 'MultiPolygon':
        coordinates = geometry['coordinates']
        for rings in coordinates:
            for lines in rings:
                for coords in lines:
                    coords[0], coords[1] = methods[method](coords[0], coords[1])
    return geometry
1078784
function toArray(matrix, array) {
  for (var i = 0, l = matrix.length; i < l; i++) {
    array[i] = matrix[i];
  }

  return array;
}
504217
def from_geojson(cls, filename):
        """"""
        with open(filename) as fd:
            geometry = json.load(fd)

        if 'type' not in geometry:
            raise TypeError("%s is not a valid geojson." % (filename,))

        return cls(to_shape(geometry), WGS84_CRS)