Example #1
0
  @Override
  protected Sector calculateSector() {
    Sector sector = null;

    for (GMLPoint point : getPoints()) sector = Sector.union(sector, point.getSector());

    return sector;
  }
  public static Sector union(Sector sectorA, Sector sectorB) {
    if (sectorA == null || sectorB == null) {
      if (sectorA == sectorB) {
        return sectorA;
      }

      return sectorB == null ? sectorA : sectorB;
    }

    return sectorA.union(sectorB);
  }
  public Sector getBBox() {
    if (null != this.coverage) return this.coverage;

    this.coverage = Sector.EMPTY_SECTOR;
    MapSource myMapSource = this.mapSource;
    for (Iterator<MapSource> iterator = myMapSource.getChildren(); iterator.hasNext(); ) {
      MapSource ms = iterator.next();
      try {
        MapGenerator gen = (null != ms) ? ms.getMapGenerator() : null;
        if (null != gen) {
          Sector bbox = gen.getBBox();
          if (null != bbox) this.coverage = Sector.union(this.coverage, bbox);
        }
      } catch (Exception e) {
        Logging.logger()
            .severe(
                "CompoundImageryGenerator:getBBox: undefined coverage of child map source"
                    + ms.getName());
      }
    }
    return this.coverage;
  }