Begin a polygon with a join connecting to the last segment (if valid join-type specified)
422243
function startPolygon(coordCurr, normPrev, normNext, join_type, context){
    // If polygon starts on a tile boundary, don't add a join
    if (join_type === undefined || isCoordOutsideTile(coordCurr)) {
        addVertex(coordCurr, normNext, normNext, 1, 0, context, 1);
        addVertex(coordCurr, normNext, normNext, 0, 0, context, -1);
    }
    else {
        // If polygon starts within a tile, add a join
        var v = 0;
        if (join_type === JOIN_TYPE.miter) {
            addMiter(v, coordCurr, normPrev, normNext, context.miter_len_sq, true, context);
        }
        else {
            addJoin(join_type, v, coordCurr, normPrev, normNext, true, context);
        }
    }
}
674123
private static boolean polygonDisjointPolygon_(Polygon polygon_a,
			Polygon polygon_b, double tolerance,
			ProgressTracker progress_tracker) {
		// Quick rasterize test to see whether the the geometries are disjoint,
		// or if one is contained in the other.
		int relation = tryRasterizedContainsOrDisjoint_(polygon_a, polygon_b,
				tolerance, true);

		if (relation == Relation.disjoint)
			return true;

		if (relation == Relation.contains || relation == Relation.within
				|| relation == Relation.intersects)
			return false;

		return polygonDisjointMultiPath_(polygon_a, polygon_b, tolerance,
				progress_tracker);
	}
253461
def _join_results(self, results, coarse, join):
    '''
    
    '''
    rval = OrderedDict()
    i_keys = set()
    for res in results:
      i_keys.update( res.keys() )
    for i_key in sorted(i_keys):
      if coarse:
        rval[i_key] = join( [res.get(i_key) for res in results] )
      else:
        rval[i_key] = OrderedDict()
        r_keys = set()
        for res in results:
          r_keys.update( res.get(i_key,{}).keys() )
        for r_key in sorted(r_keys):
          rval[i_key][r_key] = join( [res.get(i_key,{}).get(r_key) for res in results] )
    return rval
601022
def join_impl(other, join_type, sequence):
    
    if join_type == "inner":
        return inner_join_impl(other, sequence)
    seq_dict = {}
    for element in sequence:
        seq_dict[element[0]] = element[1]
    seq_kv = seq_dict
    other_kv = dict(other)
    if join_type == "left":
        keys = seq_kv.keys()
    elif join_type == "right":
        keys = other_kv.keys()
    elif join_type == "outer":
        keys = set(list(seq_kv.keys()) + list(other_kv.keys()))
    else:
        raise TypeError("Wrong type of join specified")
    result = {}
    for k in keys:
        result[k] = (seq_kv.get(k), other_kv.get(k))
    return six.viewitems(result)
664395
function capSplitAndJoin(joiner, options) {
  const string = options.fn(this);
  const members = string.split(/(?=[A-Z])/);
  return members.join(joiner);
}
1125337
private void appendJoin(StringBuffer where, StringBuffer buf, Join join)
    {
        buf.append(",");
        appendTableWithJoins(join.right, where, buf);
        if (where.length() > 0)
        {
            where.append(" AND ");
        }
        join.appendJoinEqualities(where);
    }
1279991
function intersectsPolygon (data, start, a, b) {
  var node = start
  do {
    var p1 = node.i,
      p2 = node.next.i

    if (p1 !== a && p2 !== a && p1 !== b && p2 !== b && intersects(data, p1, p2, a, b)) {
      return true
    }

    node = node.next
  } while (node !== start)

  return false
}
953960
function ( inOutSegListArray ) {
		// makes sure that the first N segments are one from each of the N polygon chains
		var mainIdx = 0;
		var helpIdx = this.polyData.nbPolyChains();
		if ( helpIdx == 1 )		return;
		var chainMarker = new Array(helpIdx);
		var oldSegListArray = inOutSegListArray.concat();
		for (var i=0; i<oldSegListArray.length; i++) {
			var chainId = oldSegListArray[i].chainId;
			if ( chainMarker[chainId] ) {
				inOutSegListArray[helpIdx++] = oldSegListArray[i];
			} else {
				inOutSegListArray[mainIdx++] = oldSegListArray[i];
				chainMarker[chainId] = true;
			}
		}
	}
1182489
function join(/*varags*/) {
	var segs = Array.prototype.slice.call(arguments);
	var path = [];
	for (var i=0; i < segs.length; i++) {
		var segment = segs[i];
		// This is kind of cheesy: avoid double-slashes
		var last = segment.length-1;
		if (i > 0 && segment[0] === '/') segment = segment.substring(1);
		if (segment[last] === '/') segment = segment.substring(0, last);
		path.push(segment);
	}
	return path.join('/');
}
554927
private void addJoinInfo(JoinType type, String localColumnName, String joinedColumnName,
			QueryBuilder<?, ?> joinedQueryBuilder, JoinWhereOperation operation) throws SQLException {
		JoinInfo joinInfo = new JoinInfo(type, joinedQueryBuilder, operation);
		if (localColumnName == null) {
			matchJoinedFields(joinInfo, joinedQueryBuilder);
		} else {
			matchJoinedFieldsByName(joinInfo, localColumnName, joinedColumnName, joinedQueryBuilder);
		}
		if (joinList == null) {
			joinList = new ArrayList<JoinInfo>();
		}
		joinList.add(joinInfo);
	}
276537
def _join(self, rows):
    '''
    
    '''
    rval = 0
    for row in rows:
      if row: rval += row
    return rval
850389
function polygonCopy(polygon, i,j,targetPoly){
    var p = targetPoly || [];
    polygonClear(p);
    if (i < j) {
        // Insert all vertices from i to j
        for(var k=i; k<=j; k++){
            p.push(polygon[k]);
        }

    } else {

        // Insert vertices 0 to j
        for(var k=0; k<=j; k++){
            p.push(polygon[k]);
        }

        // Insert vertices i to end
        for(var k=i; k<polygon.length; k++){
            p.push(polygon[k]);
        }
    }

    return p;
}
302647
def _prepPointsForSegments(points):
    
    while 1:
        point = points[-1]
        if point.segmentType:
            break
        else:
            point = points.pop()
            points.insert(0, point)
            continue
        break
705786
def execute_cross_join(op, left, right, **kwargs):
    
    # generate a unique name for the temporary join key
    key = "cross_join_{}".format(ibis.util.guid())
    join_key = {key: True}
    new_left = left.assign(**join_key)
    new_right = right.assign(**join_key)

    # inner/outer doesn't matter because every row matches every other row
    result = pd.merge(
        new_left,
        new_right,
        how='inner',
        on=key,
        copy=False,
        suffixes=constants.JOIN_SUFFIXES,
    )

    # remove the generated key
    del result[key]

    return result
454595
private void connectNodesIfNecessary(AbstractPlanNode node) {
        NodeSchema outputSchema = node.getOutputSchema();
        if (outputSchema != null) {
            for (SchemaColumn col : outputSchema) {
                connectPredicateStmt(col.getExpression());
            }
        }
        if (node instanceof AbstractScanPlanNode) {
            AbstractScanPlanNode scanNode = (AbstractScanPlanNode)node;
            connectPredicateStmt(scanNode.getPredicate());
            // If this is common table scan, we connect the scan node to the
            // plan nodes for the base and recursive query.
            if (scanNode instanceof SeqScanPlanNode) {
                SeqScanPlanNode seqScanNode = (SeqScanPlanNode)scanNode;
                connectCTENodesIfAny(seqScanNode);
            }
        } else if (node instanceof AbstractJoinPlanNode) {
            AbstractJoinPlanNode joinNode = (AbstractJoinPlanNode)node;
            connectPredicateStmt(joinNode.getPreJoinPredicate());
            connectPredicateStmt(joinNode.getJoinPredicate());
            connectPredicateStmt(joinNode.getWherePredicate());
        } else if (node instanceof AggregatePlanNode) {
            AggregatePlanNode aggNode = (AggregatePlanNode)node;
            connectPredicateStmt(aggNode.getPostPredicate());
        }

        for (AbstractPlanNode inlineNode: node.getInlinePlanNodes().values()) {
            connectNodesIfNecessary(inlineNode);
        }
    }
1178754
function select(segments, selection, buildLog){
	var result = [];
	segments.forEach(function(seg){
		var index =
			(seg.myFill.above ? 8 : 0) +
			(seg.myFill.below ? 4 : 0) +
			((seg.otherFill && seg.otherFill.above) ? 2 : 0) +
			((seg.otherFill && seg.otherFill.below) ? 1 : 0);
		if (selection[index] !== 0){
			// copy the segment to the results, while also calculating the fill status
			result.push({
				id: buildLog ? buildLog.segmentId() : -1,
				start: seg.start,
				end: seg.end,
				myFill: {
					above: selection[index] === 1, // 1 if filled above
					below: selection[index] === 2  // 2 if filled below
				},
				otherFill: null
			});
		}
	});

	if (buildLog)
		buildLog.selected(result);

	return result;
}
436409
private void join(ParserRuleContext ctx, Class<? extends Join> type)
  {
    QueryNode left = relationChain.get(relationIdx);
    QueryNode right = relationChain.get(relationIdx+1);

    try
    {
      Constructor<? extends Join> c = type.getConstructor(QueryNode.class);
      Join newJoin = c.newInstance(right);
      left.addOutgoingJoin(addParsedLocation(ctx, newJoin));
      
    }
    catch (NoSuchMethodException ex)
    {
      log.error(null, ex);
    }
    catch (InstantiationException ex)
    {
      log.error(null, ex);
    }
    catch (IllegalAccessException ex)
    {
      log.error(null, ex);
    }
    catch (InvocationTargetException ex)
    {
      log.error(null, ex);
    }

  }