Exemplo n.º 1
0
        public void Init()
        {
            originalWorkingDir = Environment.CurrentDirectory;

            originalUIwriter = UI.TextWriter;
            UI.TextWriter = Data.Output;

            PlugInDataset plugIns = new PlugInDataset();
            plugIns.AddPlugIn("Null Succession", "succession",
                              typeof(Null.Succession).AssemblyQualifiedName);
            plugIns.AddPlugIn("Null Output", "output",
                              typeof(Null.Output).AssemblyQualifiedName);

            rasterDriverMgr = new RasterDriverManager();
            model = new Model(plugIns, rasterDriverMgr);
        }
Exemplo n.º 2
0
        public void Init()
        {
            List<IParameters> ecoregionParms = new List<IParameters>();
            ecoregionParms.Add(new Parameters("eco0", "Ecoregion A", 0, true));
            ecoregionParms.Add(new Parameters("eco11", "Ecoregion B", 11, false));
            ecoregionParms.Add(new Parameters("eco222", "Ecoregion C", 222, true));
            ecoregionParms.Add(new Parameters("eco3333", "Ecoregion D", 3333, false));
            ecoregionParms.Add(new Parameters("eco-65535", "Ecoregion E", 65535, true));

            dataset = new Dataset(ecoregionParms);
            rasterDriverMgr = new RasterDriverManager();

            //  Initialize 8-bit ecoregion data
            ecoregions8Bit = new byte[,] {
                {   0,   0,  11, 222,  11 },
                {   0,  11,  11, 222,  11 },
                {   0,  11,  11, 222, 222 },
                {  11,  11,  11, 222, 222 },
                {  11,  11, 222, 222, 222 },
                {  11,  11, 222, 222, 222 }
            };
            dims8Bit = new Dimensions(ecoregions8Bit.GetLength(0),
                                      ecoregions8Bit.GetLength(1));
            rasterDriverMgr.SetData(path8Bit, ecoregions8Bit);

            //  Initialize 16-bit ecoregion data
            ecoregions16Bit = new ushort[,] {
                {   0,   0,  11, 222,  11,  3333,     0 },
                {   0,  11,  11, 222,  11,  3333, 65535 },
                {   0,  11,  11, 222, 222,  3333, 65535 },
                {  11,  11,  11, 222, 222,  3333, 65535 },
                {  11,  11, 222, 222, 222,  3333, 65535 },
                {  11,  11, 222, 222, 222, 65535, 65535 },
                {   0,   0, 222, 222, 222, 65535, 65535 }
            };
            dims16Bit = new Dimensions(ecoregions16Bit.GetLength(0),
                                       ecoregions16Bit.GetLength(1));
            rasterDriverMgr.SetData(path16Bit, ecoregions16Bit);
        }