Example #1
0
        protected VPFFeature createCompoundSimpleFeature(VPFFeatureClass featureClass, VPFRecord featureRow,
                                                         VPFBufferedRecordData joinTable, Iterable <String> attributeKeys)
        {
            // Feature has a direct 1:* relation to the primitive table through a join table.

            // Query the number of primitives which match the feature.
            Object o = this.getPrimitiveIds(featureClass, featureRow, joinTable, null, true);

            if (o == null || !(o is Integer))
            {
                return(null);
            }

            int numPrimitives = (Integer)o;

            if (numPrimitives < 1)
            {
                return(null);
            }

            // Gather the actual primitive ids matching the feature.
            int[]          primitiveIds = new int[numPrimitives];
            VPFBoundingBox bounds       = (VPFBoundingBox)this.getPrimitiveIds(featureClass, featureRow, joinTable, primitiveIds,
                                                                               false);

            return(this.createFeature(featureClass, featureRow, attributeKeys, bounds, primitiveIds));
        }
Example #2
0
        protected void buildTextPrimitives(VPFCoverage coverage, VPFTile tile, VPFPrimitiveData primitiveData)
        {
            VPFBufferedRecordData textTable = this.createPrimitiveTable(coverage, tile, VPFConstants.TEXT_PRIMITIVE_TABLE);

            if (textTable == null || textTable.getNumRecords() == 0)
            {
                return;
            }

            int numText = textTable.getNumRecords();

            VPFPrimitiveData.BasicPrimitiveInfo[] textInfo = new VPFPrimitiveData.BasicPrimitiveInfo[numText];
            VecBufferSequence     coords  = (VecBufferSequence)textTable.getRecordData("shape_line").getBackingData();
            CompoundStringBuilder strings = (CompoundStringBuilder)textTable.getRecordData("string").getBackingData();

            foreach (VPFRecord row in textTable)
            {
                int id = row.getId();

                textInfo[VPFBufferedRecordData.indexFromId(id)] = new VPFPrimitiveData.BasicPrimitiveInfo(
                    VPFBoundingBox.fromVecBuffer(coords.subBuffer(id)));
            }

            primitiveData.setPrimitiveInfo(VPFConstants.TEXT_PRIMITIVE_TABLE, textInfo);
            primitiveData.setPrimitiveCoords(VPFConstants.TEXT_PRIMITIVE_TABLE, coords);
            primitiveData.setPrimitiveStrings(VPFConstants.TEXT_PRIMITIVE_TABLE, strings);
        }
Example #3
0
        protected VPFFeature createFeature(VPFFeatureClass featureClass, VPFRecord featureRow,
                                           Iterable <String> attributeKeys,
                                           VPFBoundingBox bounds, int[] primitiveIds)
        {
            VPFFeature feature = new VPFFeature(featureClass, featureRow.getId(), bounds, primitiveIds);

            this.setFeatureAttributes(featureRow, attributeKeys, feature);

            return(feature);
        }
 public EdgeInfo(int edgeType, int startNode, int endNode, int leftFace, int rightFace, int leftEdge,
                 int rightEdge, bool isOnTileBoundary, VPFBoundingBox bounds)
 {
     super(bounds);
     this.edgeType         = edgeType;
     this.startNode        = startNode;
     this.endNode          = endNode;
     this.leftFace         = leftFace;
     this.rightFace        = rightFace;
     this.leftEdge         = leftEdge;
     this.rightEdge        = rightEdge;
     this.isOnTileBoundary = isOnTileBoundary;
 }
        public VPFBoundingBox union(VPFBoundingBox boundingBox)
        {
            if (boundingBox == null)
            {
                String message = Logging.getMessage("nullValue.BoundingBoxIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

            return(new VPFBoundingBox(
                       (this.xmin < boundingBox.xmin) ? this.xmin : boundingBox.xmin,
                       (this.ymin < boundingBox.ymin) ? this.ymin : boundingBox.ymin,
                       (this.xmax > boundingBox.xmax) ? this.xmax : boundingBox.xmax,
                       (this.ymax > boundingBox.ymax) ? this.ymax : boundingBox.ymax));
        }
Example #6
0
        protected bool buildNodePrimitives(VPFBufferedRecordData table, String name, VPFPrimitiveData primitiveData)
        {
            int numNodes = table.getNumRecords();

            VPFPrimitiveData.BasicPrimitiveInfo[] nodeInfo = new VPFPrimitiveData.BasicPrimitiveInfo[numNodes];
            VecBufferSequence coords = (VecBufferSequence)table.getRecordData("coordinate").getBackingData();

            foreach (VPFRecord row in table)
            {
                int id = row.getId();

                nodeInfo[VPFBufferedRecordData.indexFromId(id)] = new VPFPrimitiveData.BasicPrimitiveInfo(
                    VPFBoundingBox.fromVecBuffer(coords.subBuffer(id)));
            }

            primitiveData.setPrimitiveInfo(name, nodeInfo);
            primitiveData.setPrimitiveCoords(name, coords);
            return(true);
        }
Example #7
0
        public VPFTile(int id, String name, VPFBoundingBox bounds)
        {
            if (name == null)
            {
                String message = Logging.getMessage("nullValue.NameIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

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

            this.id     = id;
            this.name   = name;
            this.bounds = bounds;
        }
Example #8
0
        public VPFFeature(VPFFeatureClass featureClass, int id, VPFBoundingBox bounds, int[] primitiveIds)
        {
            if (featureClass == null)
            {
                String message = Logging.getMessage("nullValue.FeatureClassIsNull");
                Logging.logger().severe(message);
                throw new ArgumentException(message);
            }

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

            this.featureClass = featureClass;
            this.id           = id;
            this.bounds       = bounds;
            this.primitiveIds = primitiveIds;
        }
 public BasicPrimitiveInfo(VPFBoundingBox bounds)
 {
     this.bounds = bounds;
 }
 public FaceInfo(Ring outerRing, Ring[] innerRings, VPFBoundingBox bounds)
 {
     super(bounds);
     this.outerRing  = outerRing;
     this.innerRings = innerRings;
 }