Add geoms to the guide definitions
979215
def create_geoms(self, gdefs, plot):
        
        new_gdefs = []
        for gdef in gdefs:
            gdef = gdef.create_geoms(plot)
            if gdef:
                new_gdefs.append(gdef)

        return new_gdefs
104359
public function addGeometryColumn($tableName,
                                      $type,
                                      $srid,
                                      $geomFieldName = "geom",
                                      $schemaName = "public",
                                      $dimensions = 2)
    {
        $connection = $this->getConnection();
        return $this->connection->exec("SELECT AddGeometryColumn("
            . $connection->quote($schemaName) . ','
            . $connection->quote($tableName) . ','
            . $connection->quote($geomFieldName) . ','
            . $srid . ','
            . $connection->quote($type) . ','
            . $dimensions
            . ')');
    }
1198932
def __geomToPointList(self, geom):
        
        sr = geom.spatialReference
        wkid = None
        wkt = None
        if sr is None:
            if self._wkid is None and self._wkt is not None:
                wkt = self._wkt
            else:
                wkid = self._wkid
        else:
            wkid = sr.factoryCode
        g = json.loads(geom.JSON)
        top = []
        for gring in g['rings']:
            ring = []
            for g in gring:
                ring.append(Point(coord=g, wkid=wkid, wkt=wkt, z=None, m=None))
            top.append(ring)
        return top
418166
def _expand_description(desc):
    
    srcs = expand_groups(desc['src'])
    dsts = expand_groups(desc['dst'])
    descs = []
    for src in srcs:
        for dst in dsts:
            local_desc = desc.copy()
            local_desc['src'] = src
            local_desc['dst'] = dst
            descs.append(local_desc)

    return descs
1150693
public static void toKMLGeometry(Geometry geom, StringBuilder sb) throws SQLException {
        toKMLGeometry(geom, ExtrudeMode.NONE, AltitudeMode.NONE, sb);
    }
1366520
def _geom_points(geom):
    
    if geom['type'] == 'Point':
        yield tuple(geom['coordinates'])
    elif geom['type'] in ('MultiPoint', 'LineString'):
        for position in geom['coordinates']:
            yield tuple(position)
    else:
        raise InvalidFeatureError(
            "Unsupported geometry type:{0}".format(geom['type']))
548638
def get_geoms_for_bounds(self, bounds):
        
        poly = ogr.CreateGeometryFromWkt(bounds)
        self._layer.SetSpatialFilter(poly)
        poly.Destroy()

        return [json.loads(e.GetGeometryRef().ExportToJson()) for e in self._layer]
267201
def find_geom(geom, geoms):
    
    for i, g in enumerate(geoms):
        if g is geom:
            return i
91812
def write(geom, options = nil)
      unless options.nil?
        old_options = {
          include_srid: include_srid
        }

        set_options(options)
      end

      size_t = FFI::MemoryPointer.new(:size_t)
      FFIGeos.GEOSWKBWriter_write_r(Geos.current_handle_pointer, ptr, geom.ptr, size_t).get_bytes(0, size_t.read_int)
    ensure
      set_options(old_options) unless old_options.nil?
    end
304086
def boxify_points(geom, rast):
    
    if 'Point' not in geom.type:
        raise ValueError("Points or multipoints only")

    buff = -0.01 * abs(min(rast.affine.a, rast.affine.e))

    if geom.type == 'Point':
        pts = [geom]
    elif geom.type == "MultiPoint":
        pts = geom.geoms
    geoms = []
    for pt in pts:
        row, col = rast.index(pt.x, pt.y)
        win = ((row, row + 1), (col, col + 1))
        geoms.append(box(*window_bounds(win, rast.affine)).buffer(buff))

    return MultiPolygon(geoms)
870118
def warn_for_geometry_collections(self):
        """"""
        geom_collections = [
            feature.get('properties') if feature.get('properties') is not None else key
            for key, feature in enumerate(self._parent.data['features'])
            if feature['geometry']['type'] == 'GeometryCollection'
        ]
        if any(geom_collections):
            warnings.warn(
                "GeoJsonTooltip is not configured to render tooltips for GeoJson GeometryCollection geometries. "
                "Please consider reworking these features: {} to MultiPolygon for full functionality.\n"
                "https://tools.ietf.org/html/rfc7946#page-9".format(geom_collections), UserWarning)
1031527
def write(geom, options = nil)
      unless options.nil?
        old_options = {
          trim: trim,
          old_3d: old_3d,
          rounding_precision: rounding_precision,
          output_dimensions: output_dimensions
        }

        set_options(options)
      end

      FFIGeos.GEOSWKTWriter_write_r(Geos.current_handle_pointer, ptr, geom.ptr)
    ensure
      set_options(old_options) unless options.nil?
    end
97912
function setGeomAttrList(params) {
    for(var param in params) {
      if(params.hasOwnProperty(param)) {
        if(typeof params[param] === 'string') {
          geomAttrs.push(params[param]);
        } else if (typeof params[param] === 'object') { // Array of coordinates for Point
          geomAttrs.push(params[param][0]);
          geomAttrs.push(params[param][1]);
        }
      }
    }

    if(geomAttrs.length === 0) { throw new Error('No geometry attributes specified'); }
  }
339771
def create_geoms(self, plot):
        
        for l in plot.layers:
            exclude = set()
            if isinstance(l.show_legend, dict):
                l.show_legend = rename_aesthetics(l.show_legend)
                exclude = {ae for ae, val in l.show_legend.items()
                           if not val}
            elif l.show_legend not in (None, True):
                continue

            matched = self.legend_aesthetics(l, plot)

            # layer uses guide
            if set(matched) - exclude:
                break
        # no break, no layer uses this guide
        else:
            return None

        return self
533006
def map(self, coords):
        
        m = np.empty(coords.shape)
        m[:, :3] = (coords[:, :3] * self.scale[np.newaxis, :3] +
                    coords[:, 3:] * self.translate[np.newaxis, :3])
        m[:, 3] = coords[:, 3]
        return m
974487
def set_geometry(self, geom):
        
        (self.thet0, self.thet, self.phi0, self.phi, self.alpha, 
            self.beta) = geom
578719
public static String toGeojson(Geometry geom) {
        StringBuilder sb = new StringBuilder();
        toGeojsonGeometry(geom, sb);
        return sb.toString();
    }