public void Reset()
        {
            DbaseReader newReader = m_Reader.Clone();

            m_Reader.Dispose();
            m_Reader = newReader;
            m_CurrentAttrTbleIndex = 0;
        }
Пример #2
0
        public ShapeDataReader(string shapeFilePath, ISpatialIndex <ShapeLocationInFileInfo> index, IGeometryFactory geoFactory, bool buildIndexAsync)
        {
            m_SpatialIndex = index;
            m_GeoFactory   = geoFactory;

            ValidateParameters(shapeFilePath);

            m_ShapeReader = new ShapeReader(shapeFilePath);

            if (buildIndexAsync)
            {
                m_CancellationTokenSrc = new CancellationTokenSource();
                m_IndexCreationTask    = Task.Factory.StartNew(FillSpatialIndex, m_CancellationTokenSrc.Token);
            }
            else
            {
                FillSpatialIndex();
            }

            m_DbfReader = new DbaseReader(Path.ChangeExtension(shapeFilePath, DBF_EXT));
        }
        public ShapeDataReader(IStreamProviderRegistry streamProviderRegistry, ISpatialIndex <ShapeLocationInFileInfo> index, IGeometryFactory geoFactory, bool buildIndexAsync)
        {
            m_SpatialIndex = index;
            m_GeoFactory   = geoFactory;

            ValidateParameters();

            m_ShapeReader = new ShapeReader(streamProviderRegistry);

            if (buildIndexAsync)
            {
                m_CancellationTokenSrc = new CancellationTokenSource();
                m_IndexCreationTask    = Task.Factory.StartNew(FillSpatialIndex, m_CancellationTokenSrc.Token);
            }
            else
            {
                FillSpatialIndex();
            }

            m_DbfReader = new DbaseReader(streamProviderRegistry[StreamTypes.Data]);
        }
 public DbaseEnumerator(DbaseReader reader)
 {
     m_Reader = reader.Clone();
     m_CurrentAttrTbleIndex = 0;
 }