public VPFFeatureClassSchema[] getFeatureClasses(FileFilter featureTableFilter) { if (featureTableFilter == null) { String message = Logging.getMessage("nullValue.FilterIsNull"); Logging.logger().severe(message); throw new ArgumentException(message); } // List the file names in the coverage directory matching the specified feature table file filter. String[] names = WWIO.listChildFilenames(new File(this.getFilePath()), featureTableFilter); if (names == null) { return(null); } int numFeatures = names.length; VPFFeatureClassSchema[] desc = new VPFFeatureClassSchema[numFeatures]; for (int i = 0; i < numFeatures; i++) { String featureTableName = names[i]; String className = WWIO.replaceSuffix(featureTableName, ""); String type = null; // If the Feature Class Attriute Table is available, then use it to determine the feature type for the // specified class. if (this.featureClassAttributeTable != null) { VPFRecord record = this.featureClassAttributeTable.getRecord("fclass", className); if (record != null) { type = (String)record.getValue("type"); } } // Otherwise, determine the feature type is based on the feature table extension. if (type == null) { type = VPFUtils.getFeatureTypeName(featureTableName); } desc[i] = new VPFFeatureClassSchema(className, VPFFeatureType.fromTypeName(type), featureTableName); } return(desc); }
public VPFFeatureClassSchema(String className, VPFFeatureType type, String featureTableName) { this.className = className; this.type = type; this.featureTableName = featureTableName; }