예제 #1
0
        public IArray get_DatasetNames(esriDatasetType DatasetType)
        {
            if (m_connString == null)
            {
                return(null);
            }

            if (DatasetType == esriDatasetType.esriDTAny ||
                DatasetType == esriDatasetType.esriDTFeatureClass)
            {
                IArray datasets = new ArrayClass();

                int count = m_datasource.GetLayerCount();

                for (int i = 0; i < count; i++)
                {
                    OSGeo.OGR.Layer layer = m_datasource.GetLayerByIndex(i);

                    OGRDataset dataset = new OGRDataset(layer);

                    datasets.Add(dataset);
                }

                return(datasets);
            }

            return(null);
        }
예제 #2
0
        public OGRCursor(OGRDataset parent, String whereClause, System.Array esriQueryFieldMap, IEnvelope env = null, int onlyOneID = -1)
        {
            m_isFinished = false;
            m_pDataset   = parent;

            m_whereClause = whereClause;

            if (m_whereClause != null && m_whereClause.Length > 0)
            {
                m_pDataset.ogrLayer.SetAttributeFilter(m_whereClause);
            }
            else
            {
                m_pDataset.ogrLayer.SetAttributeFilter(null);
            }

            m_envelope = env;
            if (m_envelope != null)
            {
                m_envelope.Project(m_pDataset.SpatialReference);
                m_pDataset.ogrLayer.SetSpatialFilterRect(m_envelope.XMin, m_envelope.YMin, m_envelope.XMax, m_envelope.YMax);
            }
            else
            {
                m_pDataset.ogrLayer.SetSpatialFilter(null);
            }


            m_esriQueryFieldMap = esriQueryFieldMap;


            m_pDataset.ogrLayer.ResetReading();

            m_currentOGRFeature = null;

            m_onlyOneID = onlyOneID;

            if (m_onlyOneID == -1)
            {
                NextRecord();
            }
            else
            {
                RetrieveOnlyOneRecord();
            }
        }
예제 #3
0
        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);
        }
예제 #4
0
        public OGRCursor(OGRDataset parent, String whereClause, System.Array esriQueryFieldMap, IEnvelope env = null, int onlyOneID = -1)
        {
            m_isFinished = false;
            m_pDataset = parent;

            m_whereClause = whereClause;

            if (m_whereClause != null && m_whereClause.Length > 0)
                m_pDataset.OGRLayer.SetAttributeFilter(m_whereClause);
            else
                m_pDataset.OGRLayer.SetAttributeFilter(null);

            m_envelope = env;
            if (m_envelope != null)
            {
                m_envelope.Project(m_pDataset.SpatialReference);
                m_pDataset.OGRLayer.SetSpatialFilterRect(m_envelope.XMin, m_envelope.YMin, m_envelope.XMax, m_envelope.YMax);
            }
            else
            {
                m_pDataset.OGRLayer.SetSpatialFilter(null);
            }

            m_esriQueryFieldMap = esriQueryFieldMap;

            m_pDataset.OGRLayer.ResetReading();

            m_currentOGRFeature = null;

            m_onlyOneID = onlyOneID;

            if (m_onlyOneID == -1)
                NextRecord();
            else
            {
                RetrieveOnlyOneRecord();
            }
        }
예제 #5
0
        public IArray get_DatasetNames(esriDatasetType DatasetType)
        {
            if (m_connString == null)
                return null;

            if (DatasetType == esriDatasetType.esriDTAny ||
                DatasetType == esriDatasetType.esriDTFeatureClass)
            {
                IArray datasets = new ArrayClass();

                int count = m_datasource.GetLayerCount();

                for (int i = 0; i < count; i++)
                {
                    OSGeo.OGR.Layer layer = m_datasource.GetLayerByIndex(i);

                    OGRDataset dataset = new OGRDataset(layer);

                    datasets.Add(dataset);
                }

                return datasets;
            }

            return null;
        }
예제 #6
0
        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;
        }