Exports a [SurfacePolygon]{@link SurfacePolygon} in GeoJSON format of type Polygon.
@param {SurfacePolygon} renderable The SurfacePolygon object.
@throws {ArgumentError} If the specified argument is null or undefined.
@returns {String} GeoJSON format.
197204
function (renderable) {
                if (!(renderable instanceof WorldWind.SurfacePolygon)) {
                    throw new ArgumentError(
                        Logger.logMessage(Logger.LEVEL_SEVERE, "GeoJSONExporter", "exportSurfacePolygon",
                            "invalidTypeOfRenderable"));
                }

                var sb = '{';
                sb = sb + '"' + GeoJSONConstants.FIELD_TYPE + '":"' + GeoJSONConstants.TYPE_POLYGON + '",';
                sb = sb + '"' + GeoJSONConstants.FIELD_COORDINATES + '":[';
                if (renderable.boundaries.length > 0 && renderable.boundaries[0].length > 2) {
                    //with holes
                    for (var i = 0; i < renderable.boundaries.length; i++) {
                        sb = sb + '[';
                        for (var j = 0; j < renderable.boundaries[i].length; j++) {
                            sb = sb + '[' + renderable.boundaries[i][j].longitude + ',' +
                                renderable.boundaries[i][j].latitude + ']';
                            sb = sb + ',';

                            if (j === renderable.boundaries[i].length - 1) {
                                sb = sb + '[' + renderable.boundaries[i][0].longitude + ',' +
                                    renderable.boundaries[i][0].latitude + ']';
                            }
                        }
                        sb = sb + ']';
                        if (i !== renderable.boundaries.length - 1) {
                            sb = sb + ',';
                        }
                    }
                }
                else {
                    //no holes
                    sb = sb + '[';
                    for (var i = 0; i < renderable.boundaries.length; i++) {
                        sb = sb + '[' + renderable.boundaries[i].longitude + ',' +
                            renderable.boundaries[i].latitude + ']';
                        sb = sb + ',';

                        if (i === renderable.boundaries.length - 1) {
                            sb = sb + '[' + renderable.boundaries[0].longitude + ',' +
                                renderable.boundaries[0].latitude + ']';
                        }
                    }
                    sb = sb + ']';
                }
                sb = sb + ']';
                sb = sb + '}';
                return sb;
            }
1123783
function RenderBuffer( gl, format ){
  this._uid = _UID++;
  this.gl = gl;
  this.id = gl.createRenderbuffer();

  this.width  = 0;
  this.height = 0;
  this.format = format || gl.DEPTH_COMPONENT16;

  this._valid = false;

  // Dummy allocation needed
  // on some platform (chrome 57, osx, nvidia), gl.framebufferRenderbuffer raise 
  // an INVALID_OPERATION if a RB is attached before it storage is set.
  this._storage();

}
65300
function (layer) {
                if (!layer) {
                    throw new ArgumentError(
                        Logger.logMessage(Logger.LEVEL_SEVERE, "GeoJSONExporter", "exportLayer",
                            "missingLayer"));
                }

                return this.exportRenderables(layer.renderables);
            }
1008332
function renderedPosition(dim, val) {
    var ele = this[0];
    var cy = this.cy();
    var zoom = cy.zoom();
    var pan = cy.pan();
    var rpos = plainObject(dim) ? dim : undefined;
    var setting = rpos !== undefined || val !== undefined && string(dim);

    if (ele && ele.isNode()) {
      // must have an element and must be a node to return position
      if (setting) {
        for (var i = 0; i < this.length; i++) {
          var _ele = this[i];

          if (val !== undefined) {
            // set one dimension
            _ele.position(dim, (val - pan[dim]) / zoom);
          } else if (rpos !== undefined) {
            // set whole position
            _ele.position(renderedToModelPosition(rpos, zoom, pan));
          }
        }
      } else {
        // getting
        var pos = ele.position();
        rpos = modelToRenderedPosition(pos, zoom, pan);

        if (dim === undefined) {
          // then return the whole rendered position
          return rpos;
        } else {
          // then return the specified dimension
          return rpos[dim];
        }
      }
    } else if (!setting) {
      return undefined; // for empty collection case
    }

    return this; // chaining
  }
1216270
function(geometry) {
        if (this.internalProjection && this.externalProjection) {
            geometry = geometry.clone();
            geometry.transform(this.internalProjection, 
                               this.externalProjection);
        }
        var node;
        // match Polygon
        if (geometry.CLASS_NAME == "OpenLayers.Geometry.Polygon") {
            node = this.createElementNS(this.georssns, 'georss:polygon');
            
            node.appendChild(this.buildCoordinatesNode(geometry.components[0]));
        }
        // match LineString
        else if (geometry.CLASS_NAME == "OpenLayers.Geometry.LineString") {
            node = this.createElementNS(this.georssns, 'georss:line');
            
            node.appendChild(this.buildCoordinatesNode(geometry));
        }
        // match Point
        else if (geometry.CLASS_NAME == "OpenLayers.Geometry.Point") {
            node = this.createElementNS(this.georssns, 'georss:point');
            node.appendChild(this.buildCoordinatesNode(geometry));
        } else {
            throw "Couldn't parse " + geometry.CLASS_NAME;
        }  
        return node;         
    }
1341073
function (renderable) {
                if (!(renderable instanceof WorldWind.SurfacePolyline)) {
                    throw new ArgumentError(
                        Logger.logMessage(Logger.LEVEL_SEVERE, "WktExporter", "exportSurfacePolyline",
                            "invalidTypeOfRenderable"));
                }

                var sb = WktType.SupportedGeometries.LINE_STRING + '(';
                for (var i = 0; i < renderable.boundaries.length; i++) {
                    sb = sb + renderable.boundaries[i].longitude + ' ' +
                        renderable.boundaries[i].latitude;
                    sb = sb + ', ';
                }
                sb = sb.substring(0, sb.length - 2);
                sb = sb + ')';
                return sb;
            }
305002
function(obj) {
        if (obj == null) {
            return null;
        }
        var geometry, collection = false;
        if(obj.type == "GeometryCollection") {
            if(!(OpenLayers.Util.isArray(obj.geometries))) {
                throw "GeometryCollection must have geometries array: " + obj;
            }
            var numGeom = obj.geometries.length;
            var components = new Array(numGeom);
            for(var i=0; i<numGeom; ++i) {
                components[i] = this.parseGeometry.apply(
                    this, [obj.geometries[i]]
                );
            }
            geometry = new OpenLayers.Geometry.Collection(components);
            collection = true;
        } else {
            if(!(OpenLayers.Util.isArray(obj.coordinates))) {
                throw "Geometry must have coordinates array: " + obj;
            }
            if(!this.parseCoords[obj.type.toLowerCase()]) {
                throw "Unsupported geometry type: " + obj.type;
            }
            try {
                geometry = this.parseCoords[obj.type.toLowerCase()].apply(
                    this, [obj.coordinates]
                );
            } catch(err) {
                // deal with bad coordinates
                throw err;
            }
        }
        // We don't reproject collections because the children are reprojected
        // for us when they are created.
        if (this.internalProjection && this.externalProjection && !collection) {
            geometry.transform(this.externalProjection, 
                               this.internalProjection); 
        }                       
        return geometry;
    }
1148759
function(containerID) {
        if (!this.supported()) { 
            return; 
        }
        if (!document.namespaces.olv) {
            document.namespaces.add("olv", this.xmlns);
            var style = document.createStyleSheet();
            var shapes = ['shape','rect', 'oval', 'fill', 'stroke', 'imagedata', 'group','textbox']; 
            for (var i = 0, len = shapes.length; i < len; i++) {

                style.addRule('olv\\:' + shapes[i], "behavior: url(#default#VML); " +
                              "position: absolute; display: inline-block;");
            }                  
        }
        
        OpenLayers.Renderer.Elements.prototype.initialize.apply(this, 
                                                                arguments);
    }
698807
public function render(Polygon $polygon, Map $map)
    {
        $formatter = $this->getFormatter();
        $jsonBuilder = $this->getJsonBuilder()
            ->setValue('[map]', $map->getVariable(), false)
            ->setValue('[paths]', []);

        foreach ($polygon->getCoordinates() as $index => $coordinate) {
            $jsonBuilder->setValue('[paths]['.$index.']', $coordinate->getVariable(), false);
        }

        $jsonBuilder->setValues($polygon->getOptions());

        return $formatter->renderObjectAssignment($polygon, $formatter->renderObject('Polygon', [
            $jsonBuilder->build(),
        ]));
    }
889103
function(geometry, style, featureId) {
        var components = geometry.components;
        var len = components.length;
        this.drawLinearRing(components[0], style, featureId);
        // erase inner rings
        for (var i=1; i<len; ++i) {
            /** 
             * Note that this is overly agressive.  Here we punch holes through 
             * all previously rendered features on the same canvas.  A better 
             * solution for polygons with interior rings would be to draw the 
             * polygon on a sketch canvas first.  We could erase all holes 
             * there and then copy the drawing to the layer canvas. 
             * TODO: http://trac.osgeo.org/openlayers/ticket/3130 
             */
            this.canvas.globalCompositeOperation = "destination-out";
            if (this.hitDetection) {
                this.hitContext.globalCompositeOperation = "destination-out";
            }
            this.drawLinearRing(
                components[i], 
                OpenLayers.Util.applyDefaults({stroke: false, fillOpacity: 1.0}, style),
                featureId
            );
            this.canvas.globalCompositeOperation = "source-over";
            if (this.hitDetection) {
                this.hitContext.globalCompositeOperation = "source-over";
            }
            this.drawLinearRing(
                components[i], 
                OpenLayers.Util.applyDefaults({fill: false}, style),
                featureId
            );
        }
    }
432279
function () {
            RenderableLayer.call(this, "Blue Marble Image");

            var surfaceImage = new SurfaceImage(Sector.FULL_SPHERE,
                WorldWind.configuration.baseUrl + "images/BMNG_world.topo.bathy.200405.3.2048x1024.jpg");

            this.addRenderable(surfaceImage);

            this.pickEnabled = false;
            this.minActiveAltitude = 3e6;
        }
750723
function() {
    this.options.viewType = utils.arrayify(this.options.viewType || []);
    if (this.options.viewType.length === 0) {
      this.options.viewType.push('renderable');
    }
    return this.options.viewType;
  }
708872
function convert(json) {
		var wkt = '', coordinates;

		if (!json) throw new Error('Not able to parse Geometry. No argument or null passed.');

		// check if JSON is passed as String and convert to object
		if (typeof json === 'string') {
			try {
				json = JSON.parse(json);
			} catch (e) {
				throw new Error('Not able to parse Geometry. Invalid String.');
			}
		} else if (typeof json !== 'object') {
			throw new Error('Not able to parse Geometry. Invalid data type.');
		}

		if (!json.coordinates) throw new Error('Not able to parse geometry. Property geometry not set.');

		switch (json.type) {
			case 'Point':
				wkt = parsePointGeometry(json.coordinates);
				break;
			case 'MultiPoint':
				wkt = parseMultiPointGeometry(json.coordinates);
				break;
			case 'LineString':
				wkt = parseLineGeometry(json.coordinates);
				break;
			case 'MultiLineString':
				wkt = parseMultiLineGeometry(json.coordinates);
				break;
			case 'Polygon':
				wkt = parsePolygonGeometry(json.coordinates);
				break;
			case 'MultiPolygon':
				wkt = parseMultiPolygonGeometry(json.coordinates);
				break;
			default:
				throw new Error('Not able to parse geometry. Property type not set.');
		}
		return [json.type.toUpperCase(), '(', wkt, ')'].join('');
	}
446454
def fig_to_geojson(fig=None, **kwargs):
    
    if fig is None:
        fig = plt.gcf()
    renderer = LeafletRenderer(**kwargs)
    exporter = Exporter(renderer)
    exporter.run(fig)

    return renderer.geojson()
777706
function(encoded) {
        var geomType;
        if (this.geometryType == "linestring")
            geomType = OpenLayers.Geometry.LineString;
        else if (this.geometryType == "linearring")
            geomType = OpenLayers.Geometry.LinearRing;
        else if (this.geometryType == "multipoint")
            geomType = OpenLayers.Geometry.MultiPoint;
        else if (this.geometryType != "point" && this.geometryType != "polygon")
            return null;

        var flatPoints = this.decodeDeltas(encoded, 2);
        var flatPointsLength = flatPoints.length;

        var pointGeometries = [];
        for (var i = 0; i + 1 < flatPointsLength;) {
            var y = flatPoints[i++], x = flatPoints[i++];
            pointGeometries.push(new OpenLayers.Geometry.Point(x, y));
        }


        if (this.geometryType == "point")
            return new OpenLayers.Feature.Vector(
                pointGeometries[0]
            );

        if (this.geometryType == "polygon")
            return new OpenLayers.Feature.Vector(
                new OpenLayers.Geometry.Polygon([
                    new OpenLayers.Geometry.LinearRing(pointGeometries)
                ])
            );

        return new OpenLayers.Feature.Vector(
            new geomType(pointGeometries)
        );
    }
683968
function getRenderable(settings) {
         var renderable;
         var tileset = this.tileset;

         if (tileset.animations.has(this.tileId)) {
           var frames = [];
           var frameId = [];
           tileset.animations.get(this.tileId).frames.forEach(function (frame) {
             frameId.push(frame.tileid);
             frames.push({
               name: "" + frame.tileid,
               delay: frame.duration
             });
           });
           renderable = tileset.texture.createAnimationFromName(frameId, settings);
           renderable.addAnimation(this.tileId - tileset.firstgid, frames);
           renderable.setCurrentAnimation(this.tileId - tileset.firstgid);
         } else {
           if (tileset.isCollection === true) {
             var image = tileset.getTileImage(this.tileId);
             renderable = new me.Sprite(0, 0, Object.assign({
               image: image
             }) //, settings)
             );
             renderable.anchorPoint.set(0, 0);
             renderable.scale(settings.width / this.width, settings.height / this.height);

             if (typeof settings.rotation !== "undefined") {
               renderable.anchorPoint.set(0.5, 0.5);
               renderable.currentTransform.rotate(settings.rotation);
               renderable.currentTransform.translate(settings.width / 2, settings.height / 2); // TODO : move the rotation related code from TMXTiledMap to here (under)

               settings.rotation = undefined;
             }
           } else {
             renderable = tileset.texture.createSpriteFromName(this.tileId - tileset.firstgid, settings);
           }
         } // any H/V flipping to apply?


         if (this.flippedX) {
           renderable.currentTransform.scaleX(-1);
         }

         if (this.flippedY) {
           renderable.currentTransform.scaleY(-1);
         }

         return renderable;
       }
402362
function fromOverlaysToJSON_(geom) {
  var gtype = getGeometryType_(geom);
  var g, gs, i, pts;
  var json = '{';
  switch (gtype) {
  case GeometryType.POINT:
    g = isArray_(geom) ? geom[0] : geom;
    if (g instanceof G.Marker) {
      g = g.getPosition();
    }
    json += 'x:' + g.lng() + ',y:' + g.lat();
    break;
  case GeometryType.MULTIPOINT:
    pts = [];
    for (i = 0; i < geom.length; i++) {
      if (geom[i] instanceof G.Marker) {
        g = geom[i].getPosition();
      } else {
        g = geom[i];
      }
      pts.push('[' + g.lng() + ',' + g.lat() + ']');
    }
    json += 'points: [' + pts.join(',') + ']';
    break;
  case GeometryType.POLYLINE:
    // V3 does not support multiple paths yet
    pts = [];
    gs = isArray_(geom) ? geom : [geom];
    for (i = 0; i < gs.length; i++) {
      pts.push('[' + fromLatLngsToJSON_(gs[i].getPath()) + ']');
    }
    json += 'paths:[' + pts.join(',') + ']';
    break;
  case GeometryType.POLYGON:
    pts = [];
    g = isArray_(geom) ? geom[0] : geom;
    var paths = g.getPaths();
    for (i = 0; i < paths.getLength(); i++) {
      pts.push('[' + fromLatLngsToJSON_(paths.getAt(i), true) + ']');
    }
    json += 'rings:[' + pts.join(',') + ']';
    
    break;
  case GeometryType.ENVELOPE:
    g = isArray_(geom) ? geom[0] : geom;
    json += 'xmin:' + g.getSouthWest().lng() + ',ymin:' + g.getSouthWest().lat() + ',xmax:' + g.getNorthEast().lng() + ',ymax:' + g.getNorthEast().lat();
    break;
  }
  json += ', spatialReference:{wkid:4326}';
  json += '}';
  return json;
}