Exemplo n.º 1
0
  /**
   * Compute the facade index for given osm tags, polygon and height.
   *
   * @param tags
   * @param polygon
   * @param height
   * @return Integer the facade index.
   */
  public Integer computeFacadeIndex(OsmPolygon polygon) {
    Integer result = null;
    // first, do we are on a residential object?
    // yes if there is residential or house tag
    // or if surface of the polygon is under the max surface for a
    // residential house
    // and height is under max residential height
    if ((OsmUtils.isValueinTags("residential", polygon.getTags())
            || OsmUtils.isValueinTags("house", polygon.getTags())
            || polygon.getArea() * 10000000 < ASSERTION_RESIDENTIAL_MAX_AREA)
        && polygon.getHeight() < XplaneOptionsHelper.getOptions().getResidentialMax()) {

      result = computeResidentialFacadeIndex(polygon);
    }

    // do we are on a building object?
    // yes if there is industrial or Commercial tag
    // or if surface of the polygon is above the max surface for a
    // residential house
    // and height is above max residential height
    else {
      if (OsmUtils.isValueinTags("industrial", polygon.getTags())
          || OsmUtils.isValueinTags("Commercial", polygon.getTags())
          || polygon.getArea() * 10000000 > ASSERTION_RESIDENTIAL_MAX_AREA
          || polygon.getHeight() > XplaneOptionsHelper.getOptions().getResidentialMax()) {

        result = computeBuildingFacadeIndex(polygon);
      }
    }
    return result;
  }