protected static String getPrimitiveTablePath(
      VPFCoverage coverage, VPFTile tile, String tableName) {
    // Start with the coverage directory.
    StringBuilder sb = new StringBuilder(coverage.getFilePath());
    sb.append(File.separator);

    // If the tile is non-null then append the tile's path.
    if (tile != null) {
      sb.append(tile.getName());
      sb.append(File.separator);
    }

    // Append the primitive table name.
    sb.append(tableName);

    return sb.toString();
  }
Ejemplo n.º 2
0
  public static VPFCoverage readCoverage(VPFLibrary library, String name) {
    if (library == null) {
      String message = Logging.getMessage("nullValue.LibraryIsNull");
      Logging.logger().severe(message);
      throw new IllegalArgumentException(message);
    }

    if (name == null) {
      String message = Logging.getMessage("nullValue.NameIsNull");
      Logging.logger().severe(message);
      throw new IllegalArgumentException(message);
    }

    try {
      return VPFCoverage.fromFile(library, name);
    } catch (WWRuntimeException e) {
      // Exception already logged by VPFCoverage.
      return null;
    }
  }
Ejemplo n.º 3
0
  public static VPFFeatureClass[] readFeatureClasses(
      VPFCoverage coverage, FileFilter featureTableFilter) {
    if (coverage == null) {
      String message = Logging.getMessage("nullValue.CoverageIsNull");
      Logging.logger().severe(message);
      throw new IllegalArgumentException(message);
    }

    if (featureTableFilter == null) {
      String message = Logging.getMessage("nullValue.FilterIsNull");
      Logging.logger().severe(message);
      throw new IllegalArgumentException(message);
    }

    VPFFeatureClassSchema[] schemas = coverage.getFeatureClasses(featureTableFilter);
    VPFFeatureClass[] cls = new VPFFeatureClass[schemas.length];

    VPFFeatureClassFactory factory = new VPFBasicFeatureClassFactory();
    for (int i = 0; i < schemas.length; i++) {
      cls[i] = factory.createFromSchema(coverage, schemas[i]);
    }

    return cls;
  }