Esempio n. 1
0
 private void button2_Click(object sender, EventArgs e)
 {
     // int[] aoi = AOITemplateFactory.MakeAOI("raster:行政区划:河北省", 70,141,15,56,new Size(7100,4100));
     // int[] aoi2 = AOITemplateFactory.MakeAOI("raster:土地利用类型:林地", 70, 141, 15, 56, new Size(7100, 4100));
     //int[] aoi3 = AOITemplateFactory.MakeAOI("vector:太湖", 119, 121, 30, 32, new Size(74, 62));
     int[]    aoi3 = AOITemplateFactory.MakeAOI("vector:洞庭湖", 112.083749, 113.178749, 28.691249, 29.588749, new Size(110, 90));
     int[]    aoi  = aoi3;
     Envelope en   = new Envelope(20, 30, 60, 90);
 }
Esempio n. 2
0
        private int[] GetAOITemplates(IMonitoringSubProduct subProduct)
        {
            string[] aoiTemplates = _extractPanel.AOIs;
            if (aoiTemplates == null || aoiTemplates.Length == 0)
            {
                return(null);
            }
            IRasterDataProvider dataprovider = GetCurrentRasterDataProvider();

            if (dataprovider == null)
            {
                return(null);
            }
            CoordEnvelope evp = dataprovider.CoordEnvelope;

            int[] aoi;
            int[] retAOI = null;
            foreach (string aoiname in aoiTemplates)
            {
                if (string.IsNullOrEmpty(aoiname))
                {
                    continue;
                }
                aoi = AOITemplateFactory.MakeAOI(aoiname, evp.MinX, evp.MaxX, evp.MinY, evp.MaxY, new Size(dataprovider.Width, dataprovider.Height));
                if (aoi == null)
                {
                    continue;
                }
                if (subProduct != null)
                {
                    if (aoiname.Contains("海陆模版") && subProduct.Identify == "ICE")
                    {
                        aoi = AOIHelper.Reverse(aoi, new Size(dataprovider.Width, dataprovider.Height));
                    }
                }
                if (retAOI == null)
                {
                    retAOI = aoi;
                }
                else
                {
                    retAOI = AOIHelper.Merge(new int[][] { aoi, retAOI });
                }
            }
            return(retAOI);
        }