Пример #1
0
 /// <summary>
 /// Function to test if a the datasource contains the specified <paramref name="layerName"/>
 /// </summary>
 /// <param name="layerName">The name of the layer</param>
 /// <returns><c>true</c> if the layer is present, otherwise <c>false</c></returns>
 public Boolean ContainsLayer(string layerName)
 {
     using (OgrLayer layer = _ogrDataSource.GetLayerByName(layerName))
     {
         return(layer != null);
     }
 }
Пример #2
0
        public Ogr(string filename, string layerName)
        {
            Filename = filename;

            _ogrDataSource = OgrOgr.Open(filename, 1);
            _ogrLayer      = _ogrDataSource.GetLayerByName(layerName);
            OsrSpatialReference spatialReference = _ogrLayer.GetSpatialRef();

            if (spatialReference != null)
            {
                SRID = spatialReference.AutoIdentifyEPSG();
            }
        }
Пример #3
0
        public Ogr(string filename, string layerName)
        {
            Filename = filename;

            _ogrDataSource = OgrOgr.Open(filename, 1);
            _ogrLayer = _ogrDataSource.GetLayerByName(layerName);
            OsrSpatialReference spatialReference = _ogrLayer.GetSpatialRef();
            if (spatialReference != null)
                SRID = spatialReference.AutoIdentifyEPSG();
        }