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; } }
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; }