コード例 #1
0
        public VPFFeatureClass createFromSchema(VPFCoverage coverage, VPFFeatureClassSchema schema)
        {
            if (coverage == null)
            {
                String message = Logging.getMessage("nullValue.CoverageIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

            if (schema == null)
            {
                String message = Logging.getMessage("nullValue.SchemaIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

            try
            {
                return(this.doCreateFromSchema(coverage, schema));
            }
            catch (Exception e)
            {
                String message = Logging.getMessage("generic.ExceptionWhileReading",
                                                    coverage.getFilePath() + File.separator + schema.getClassName());
                throw new WWRuntimeException(message, e);
            }
        }
コード例 #2
0
 public VPFFeatureClass(VPFCoverage coverage, VPFFeatureClassSchema schema, String joinTableName,
                        String primitiveTableName)
 {
     this.coverage           = coverage;
     this.schema             = schema;
     this.joinTableName      = joinTableName;
     this.primitiveTableName = primitiveTableName;
 }
コード例 #3
0
        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);
        }
コード例 #4
0
 protected VPFFeatureClass doCreateFromSchema(VPFCoverage coverage, VPFFeatureClassSchema schema) throws IOException