Пример #1
0
  public String getInheritedSrsName() {
    if (srsName == null) {
      Child child = this;
      ModelObject parent = null;

      while ((parent = child.getParent()) != null) {
        if (parent instanceof AbstractGeometry)
          return ((AbstractGeometry) parent).getInheritedSrsName();
        else if (parent instanceof AbstractFeature) {
          AbstractFeature feature = (AbstractFeature) parent;
          if (feature.isSetBoundedBy()
              && feature.getBoundedBy().isSetEnvelope()
              && feature.getBoundedBy().getEnvelope().isSetSrsName())
            return feature.getBoundedBy().getEnvelope().getSrsName();
        }

        if (parent instanceof Child) child = (Child) parent;
        else break;
      }
    }

    return srsName;
  }