public OgrDataReader(string sDataSource, string sLayer) { //wkbReader = new DotSpatial.Data.WKBReader(); _ogrDataSource = Ogr.Open(sDataSource, 0); _ogrLayer = _ogrDataSource.GetLayerByName(sLayer); _iFeatureCount = _ogrLayer.GetFeatureCount(1); _ogrFeatureDefinition = _ogrLayer.GetLayerDefn(); _iFieldCount = _ogrFeatureDefinition.GetFieldCount(); BuildSchemaTable(); _currentFeature = null; bClosed = false; }
/// <summary> /// Loads a Ogr datasource with the specified layer /// </summary> /// <param name="Filename">datasource</param> /// <param name="LayerName">name of layer</param> public Ogr(string Filename, string LayerName) { this.Filename = Filename; OSGeo.OGR.Ogr.RegisterAll(); _OgrDataSource = OSGeo.OGR.Ogr.Open(this.Filename, 1); _OgrLayer = _OgrDataSource.GetLayerByName(LayerName); }
/// <summary> /// Loads a OgrFeatureProvider datasource with the specified layer /// </summary> /// <param name="path">datasource</param> /// <param name="layerName">name of layer</param> public OgrFeatureProvider(string path, string layerName) : this() { this.path = path; this.layerName = layerName; ogrDataSource = Ogr.Open(path, 1); ogrLayer = ogrDataSource.GetLayerByName(layerName); Name = layerName; _IsOpen = true; }
public IPlugInDatasetHelper OpenDataset(string localName) { if (m_connString == null) { return(null); } OSGeo.OGR.Layer layer = m_datasource.GetLayerByName(localName); if (layer == null) { return(null); } OGRDataset ds = new OGRDataset(layer); return((IPlugInDatasetHelper)ds); }