Gets the geoSegment value for this ProductSegmentation.

@return geoSegment   * The geographic segmentation. Segments should be set on the
{@link GeoTargeting#targetedLocations} field.

<p>This attribute is optional.
169165
public com.google.api.ads.admanager.axis.v201808.GeoTargeting getGeoSegment() {
        return geoSegment;
    }
947345
public com.google.api.ads.admanager.axis.v201808.MobileDeviceTargeting getMobileDeviceSegment() {
        return mobileDeviceSegment;
    }
1336359
public com.google.api.ads.admanager.axis.v201811.BandwidthGroupTargeting getBandwidthSegment() {
        return bandwidthSegment;
    }
800284
public Coordinate getCentroid() {
		if (isEmpty()) {
			return null;
		}
		double sumX = 0;
		double sumY = 0;
		double totalLength = 0;
		for (int i = 0; i < coordinates.length - 1; i++) {
			double length = coordinates[i].distance(coordinates[i + 1]);
			totalLength += length;
			double midx = (coordinates[i].getX() + coordinates[i + 1].getX()) / 2;
			sumX += length * midx;
			double midy = (coordinates[i].getY() + coordinates[i + 1].getY()) / 2;
			sumY += length * midy;
		}
		return new Coordinate(sumX / totalLength, sumY / totalLength);
	}
576405
public static Point get(Geometry geometry) {
        // Get polygon from geometry
        Polygon polygon;
        if (geometry instanceof LineString) {
            // Validity of LineString is checked outside of this scope
            polygon = geometry.getFactory().createPolygon(geometry.getCoordinates());
        } else if (geometry instanceof MultiPolygon) {
            // For MultiPolygon the widest Polygon is taken
            Geometry widestGeometry = geometry.getGeometryN(0);
            for (int i = 1; i < geometry.getNumGeometries(); i++) {
                if (geometry.getGeometryN(i).getEnvelopeInternal().getWidth() >
                        widestGeometry.getEnvelopeInternal().getWidth()) {
                    widestGeometry = geometry.getGeometryN(i);
                }
            }
            polygon = (Polygon) widestGeometry;
        } else if (geometry instanceof Polygon) {
            polygon = (Polygon) geometry;
        } else {
            LOGGER.warning("Failed to get label for geometry: " + geometry);
            return geometry.getCentroid();
        }

        // As original geometry is used in other places clone it before re-projecting
        polygon = (Polygon) polygon.clone();

        // Re-project coordinates. This is needed to get proper visual results for polygons
        // distorted my Mercator projection
        polygon.apply(new CoordinateFilter() {
            @Override
            public void filter(Coordinate c) {
                c.x = longitudeToX(c.x);
                c.y = latitudeToY(c.y);
            }
        });
        polygon.geometryChanged();

        Envelope envelope = polygon.getEnvelopeInternal();

        double width = envelope.getWidth();
        double height = envelope.getHeight();
        double cellSize = Math.min(width, height);
        double h = cellSize / 2;

        // A priority queue of cells in order of their "potential" (max distance to polygon)
        PriorityQueue<Cell> cellQueue = new PriorityQueue<>(1, new MaxComparator());

        // Cover polygon with initial cells
        for (double x = envelope.getMinX(); x < envelope.getMaxX(); x += cellSize) {
            for (double y = envelope.getMinY(); y < envelope.getMaxY(); y += cellSize) {
                cellQueue.add(new Cell(x + h, y + h, h, polygon));
            }
        }

        // Take centroid as the first best guess
        Cell bestCell = getCentroidCell(polygon);

        // Special case for rectangular polygons
        Cell bboxCell = new Cell(envelope.centre().x, envelope.centre().y, 0, polygon);
        if (bboxCell.d > bestCell.d) bestCell = bboxCell;

        while (!cellQueue.isEmpty()) {
            // Pick the most promising cell from the queue
            Cell cell = cellQueue.remove();

            // Update the best cell if we found a better one
            if (cell.d > bestCell.d)
                bestCell = cell;

            // Do not drill down further if there's no chance of a better solution
            if (cell.max - bestCell.d <= PRECISION) continue;

            // Split the cell into four cells
            h = cell.h / 2;
            cellQueue.add(new Cell(cell.x - h, cell.y - h, h, polygon));
            cellQueue.add(new Cell(cell.x + h, cell.y - h, h, polygon));
            cellQueue.add(new Cell(cell.x - h, cell.y + h, h, polygon));
            cellQueue.add(new Cell(cell.x + h, cell.y + h, h, polygon));
        }

        // Return the best found point projected back to geodesic coordinates
        return geometry.getFactory().createPoint(new Coordinate(toLongitude(bestCell.x), toLatitude(bestCell.y)));
    }
21217
public BoundingBox getBoundingBox() {

		GeometryEnvelope envelope = null;

		long offset = 0;
		boolean hasResults = true;

		while (hasResults) {

			hasResults = false;

			FeatureResultSet resultSet = featureDao.queryForChunk(chunkLimit,
					offset);
			try {
				while (resultSet.moveToNext()) {
					hasResults = true;

					FeatureRow featureRow = resultSet.getRow();
					GeometryEnvelope featureEnvelope = featureRow
							.getGeometryEnvelope();
					if (featureEnvelope != null) {

						if (envelope == null) {
							envelope = featureEnvelope;
						} else {
							envelope = envelope.union(featureEnvelope);
						}

					}
				}
			} finally {
				resultSet.close();
			}

			offset += chunkLimit;
		}

		BoundingBox boundingBox = null;
		if (envelope != null) {
			boundingBox = new BoundingBox(envelope);
		}

		return boundingBox;
	}
38403
Segment getSegment(int vertex) {
		if (m_segments != null) {
			int vindex = getVertexIndex(vertex);
			return m_segments.get(vindex);
		}
		return null;
	}
939454
@Override
	@Pure
	public GeoLocation getGeoLocation() {
		final Rectangle2d b = getBoundingBox();
		if (b == null) {
			return new GeoLocationNowhere(getUUID());
		}
		return new GeoLocationPoint(b.getCenterX(), b.getCenterY());
	}
579751
public com.google.api.ads.admanager.axis.v201902.GeoTargeting getGeoTargeting() {
        return geoTargeting;
    }
274657
synchronized JournalSegment<E> getNextSegment() {
    assertOpen();
    assertDiskSpace();

    JournalSegment lastSegment = getLastSegment();
    JournalSegmentDescriptor descriptor = JournalSegmentDescriptor.builder()
        .withId(lastSegment != null ? lastSegment.descriptor().id() + 1 : 1)
        .withIndex(currentSegment.lastIndex() + 1)
        .withMaxSegmentSize(maxSegmentSize)
        .withMaxEntries(maxEntriesPerSegment)
        .build();

    currentSegment = createSegment(descriptor);

    segments.put(descriptor.index(), currentSegment);
    return currentSegment;
  }
1252568
public Segment nextSegment() {
		if (m_currentSegmentIndex != m_nextSegmentIndex)
			_updateSegment();

		if (m_bCirculator) {
			m_nextSegmentIndex = (m_nextSegmentIndex + 1) % m_segmentCount;
		} else {
			if (m_nextSegmentIndex == m_segmentCount)
				throw new IndexOutOfBoundsException();

			m_nextSegmentIndex++;
		}

		return m_currentSegment;
	}
743757
public com.google.api.ads.admanager.axis.v201808.MobileDeviceSubmodelTargeting getMobileDeviceSubmodelSegment() {
        return mobileDeviceSubmodelSegment;
    }
416575
public Partition getAutomorphismPartition() {
        final int n = group.getSize();
        final DisjointSetForest forest = new DisjointSetForest(n);
        group.apply(new PermutationGroup.Backtracker() {

            boolean[]       inOrbit      = new boolean[n];
            private int     inOrbitCount = 0;
            private boolean isFinished;

            @Override
            public boolean isFinished() {
                return isFinished;
            }

            @Override
            public void applyTo(Permutation p) {
                for (int elementX = 0; elementX < n; elementX++) {
                    if (inOrbit[elementX]) {
                        continue;
                    } else {
                        int elementY = p.get(elementX);
                        while (elementY != elementX) {
                            if (!inOrbit[elementY]) {
                                inOrbitCount++;
                                inOrbit[elementY] = true;
                                forest.makeUnion(elementX, elementY);
                            }
                            elementY = p.get(elementY);
                        }
                    }
                }
                if (inOrbitCount == n) {
                    isFinished = true;
                }
            }
        });

        // convert to a partition
        Partition partition = new Partition();
        for (int[] set : forest.getSets()) {
            partition.addCell(set);
        }

        // necessary for comparison by string
        partition.order();
        return partition;
    }
1054994
public String getText() {
        if(text == null) {
            StringBuilder sb = new StringBuilder(length());
            for(SEG seg: segments)
                sb.append(segmentOps.getText(seg));
            text = sb.toString();
        }
        return text;
    }
324513
function() {

            var segments = this.segments;
            var numSegments = segments.length;
            if (numSegments === 0) return null; // if segments is an empty array

            var bbox;
            for (var i = 0; i < numSegments; i++) {

                var segment = segments[i];
                if (segment.isVisible) {
                    var segmentBBox = segment.bbox();
                    bbox = bbox ? bbox.union(segmentBBox) : segmentBBox;
                }
            }

            if (bbox) return bbox;

            // if the path has only invisible elements, return end point of last segment
            var lastSegment = segments[numSegments - 1];
            return new Rect(lastSegment.end.x, lastSegment.end.y, 0, 0);
        }
1006258
@Override
  protected Long boundaryForSegment(String segmentName) throws IOException {
    if (segmentRegistration.equals(SEGMENT_SORT_ASC)
        || segmentRegistration.equals(SEGMENT_SORT_DESC)) {
      Long thisLast = segmentValueTopListLast.get(segmentName);
      if (thisLast == null) {
        return null;
      } else if (segmentRegistration.equals(SEGMENT_SORT_ASC)) {
        return thisLast * segmentNumber;
      } else {
        return Math.floorDiv(thisLast, segmentNumber);
      }
    } else {
      throw new IOException("can't compute boundary for segmentRegistration "
          + segmentRegistration);
    }
  }
285916
@Pure
	public CrossRoad getFirstJunctionPoint() {
		RoadConnection point = getFirstPoint();
		double distance = 0;
		RoadSegment beforeSegment = null;
		RoadSegment afterSegment = null;
		int beforeSegmentIndex = -1;
		int afterSegmentIndex = -1;
		boolean found = false;
		if (point != null) {
			int index = 0;
			for (final RoadSegment sgmt : this) {
				if (found) {
					afterSegment = sgmt;
					afterSegmentIndex = index;
					//stop now
					break;
				}

				point = sgmt.getOtherSidePoint(point);
				beforeSegment = sgmt;
				beforeSegmentIndex = index;
				distance += sgmt.getLength();
				final int count = point.getConnectedSegmentCount();
				if (count != 2) {
					found = true;
				}
				++index;
			}
		}

		if (found) {
			return new CrossRoad(point, beforeSegment, beforeSegmentIndex,
					afterSegment, afterSegmentIndex, distance, distance);
		}

		return null;
	}