Esempio n. 1
0
        private MapInfo.Styles.RasterStyle GetRasterStyle(Table table)
        {
            MapInfo.Styles.RasterStyle rasterStyle = null;
            MIDataReader rdr            = null;
            string       projectionlist = "MI_Style";

            rdr = table.ExecuteReader(projectionlist);

            string name;
            string typename;
            int    n = rdr.FieldCount;

            MapInfo.Styles.Style style = null;
            if (rdr.Read())
            {
                for (int i = 0; i < rdr.FieldCount; i++)
                {
                    name     = rdr.GetName(i);
                    typename = rdr.GetDataTypeName(i);
                    if (typename == "MapInfo.Styles.Style")
                    {
                        style = rdr.GetStyle(i);
                    }
                }
            }
            rdr.Close();
            rdr.Dispose();
            rdr = null;
            if (style != null)
            {
                rasterStyle = style as RasterStyle;
            }
            return(rasterStyle);
        }
Esempio n. 2
0
        // Gets RasterInfo from a given table.
        // Each raster table has exactly one associated raster image, and thus only one record.
        // Reading that record with a data reader, we can get
        // a FeatureGeometry - a bounding rectangle,
        // a Style - the Raster style,
        // a key
        // a RasterInfo object.
        private MapInfo.Raster.RasterInfo GetRasterInfo(Table table)
        {
            MapInfo.Raster.RasterInfo rasterInfo = null;
            MIDataReader rdr            = null;
            string       projectionlist = "obj, MI_Key, MI_Raster, MI_Style";

            rdr = table.ExecuteReader(projectionlist);

            string name;
            string typename;
            int    n = rdr.FieldCount;

            MapInfo.Styles.Style             style;
            MapInfo.Geometry.FeatureGeometry featureGeometry;
            MapInfo.Data.Key key;
            if (rdr.Read())
            {
                for (int i = 0; i < rdr.FieldCount; i++)
                {
                    name     = rdr.GetName(i);
                    typename = rdr.GetDataTypeName(i);
                    if (typename == "MapInfo.Styles.Style")
                    {
                        style = rdr.GetStyle(i);
                    }
                    else if (typename == "MapInfo.Geometry.FeatureGeometry")
                    {
                        featureGeometry = rdr.GetFeatureGeometry(i);
                    }
                    else if (typename == "MapInfo.Data.Key")
                    {
                        key = rdr.GetKey(i);
                    }
                    else if (typename == "MapInfo.Raster.RasterInfo")
                    {
                        rasterInfo = rdr.GetRasterInfo(i);
                    }
                }
            }
            rdr.Close();
            rdr.Dispose();
            rdr = null;
            return(rasterInfo);
        }
Esempio n. 3
0
		public void SelectAllIndivColumns()
		{
			MIDataReader rdr = null;
			string projectionlist = "obj, MI_Key, MI_Grid, MI_Style";
			rdr = _miTable.ExecuteReader(projectionlist);
			
			string name;
			string typename;
			int n = rdr.FieldCount;
			if(rdr.Read())
			{
				n = rdr.FieldCount;//shouldn't change
				for(int i =0; i <n; i++)
				{
					name = rdr.GetName(i);
					typename = rdr.GetDataTypeName(i);
					if(typename == "MapInfo.Styles.Style")
					{
						_mStyle = rdr.GetStyle(i) as GridStyle; 
					}
					else if(typename == "MapInfo.Geometry.FeatureGeometry")
					{
						_mObject = rdr.GetFeatureGeometry(i);
					}
					else if(typename == "MapInfo.Data.Key")
					{
						_mKey = rdr.GetKey(i);
					}
					else if (typename == "MapInfo.Raster.GridInfo")
					{
						_mGridInfo = rdr.GetGridInfo(i);
					}
				}
			}

			rdr.Close();
			rdr.Dispose();
			rdr = null;
		}