示例#1
0
        public VPFRelation[] getFeatureClassRelations(String className)
        {
            if (className == null)
            {
                String message = Logging.getMessage("nullValue.ClassNameIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

            ArrayList <VPFRelation> rels = new ArrayList <VPFRelation>();

            foreach (VPFRecord row in this.featureClassSchemaTable)
            {
                Object o = row.getValue("feature_class");
                if (o == null || !(o is String))
                {
                    continue;
                }

                if (!className.equalsIgnoreCase((String)o))
                {
                    continue;
                }

                rels.add(new VPFRelation(
                             (String)row.getValue("table1"),
                             (String)row.getValue("table1_key"),
                             (String)row.getValue("table2"),
                             (String)row.getValue("table2_key")));
            }

            VPFRelation[] array = new VPFRelation[rels.size()];
            rels.toArray(array);
            return(array);
        }
示例#2
0
        protected VPFFeature createSimpleFeature(VPFFeatureClass featureClass, VPFRecord featureRow,
                                                 Iterable <String> attributeKeys)
        {
            // Feature has a direct 1:1 relation to the primitive table.

            if (this.tile != null && !matchesTile(featureRow, this.tile))
            {
                return(null);
            }

            VPFRelation featureToPrimitive = this.getFeatureToPrimitiveRelation(featureClass);

            if (featureToPrimitive == null)
            {
                return(null);
            }

            int primitiveId = asInt(featureRow.getValue(featureToPrimitive.getTable1Key()));

            VPFPrimitiveData.PrimitiveInfo primitiveInfo = this.primitiveData.getPrimitiveInfo(
                featureToPrimitive.getTable2(), primitiveId);

            return(this.createFeature(featureClass, featureRow, attributeKeys, primitiveInfo.getBounds(),
                                      new int[] { primitiveId }));
        }