コード例 #1
0
        public void AddFeatureToIndex(FeatureDataRow <UInt32> feature)
        {
            UInt32 id = feature.Id;

            if (ContainsKey(id))
            {
                throw new ShapeFileInvalidOperationException(
                          "Cannot add a feature with the same id to the index more than once.");
            }

            _header.Extents = _shapeFile.GeometryFactory.CreateExtents(
                _header.Extents, feature.Geometry.Extents);

            Int32 length = ShapeFileProvider.ComputeGeometryLengthInWords(feature.Geometry, ShapeFile.ShapeType);
            Int32 offset = ComputeShapeFileSizeInWords();

            IndexEntry entry = new IndexEntry(length, offset);

            _shapeIndex[id] = entry;
        }