Exemple #1
0
        private void getSectorCoverage()
        {
            dc_tmap.ExecuteCommand(HandleTable.createCellTracing);
            Console.WriteLine(dc_oss.SITE.Count());

            foreach (var site in dc_oss.SITE)
            {
                if (site.latitude == null)
                {
                    continue;
                }

                CellCoverage cc = new CellCoverage();

                #region 这里的算法复杂度高,仿真的过程比较复杂

                cc.pre_rxlev = -94;

                #endregion

                sgeog = cc.MergePoint(site);
                sgeom = SqlGeometry.STGeomFromWKB(sgeog.STAsBinary(), 4326).STConvexHull();

                pencolor = HandleTable.getRandomPenColor(false, false, false);

                CellTracing ct = new CellTracing();
                ct.cell        = site.cell;
                ct.MI_STYLE    = "Pen (1, 60," + pencolor.ToString() + ")";
                ct.SP_GEOMETRY = sgeom;
                sql            = @" INSERT INTO [CELLTRACING]([cell],[MI_STYLE],[SP_GEOMETRY]) VALUES  ('"
                                 + ct.cell + "','" + ct.MI_STYLE + "','" + ct.SP_GEOMETRY + "')";
                dc_tmap.ExecuteCommand(sql);
            }
        }
        private void getSectorCoverage()
        {
            dc_tmap.ExecuteCommand(HandleTable.createCellTracing);
            Console.WriteLine(dc_oss.SITE.Count());

            foreach (var site in dc_oss.SITE)
            {

                if (site.latitude == null) continue;

                CellCoverage cc = new CellCoverage();

                #region 这里的算法复杂度高,仿真的过程比较复杂

                cc.pre_rxlev = -94;

                #endregion

                sgeog = cc.MergePoint(site);
                sgeom = SqlGeometry.STGeomFromWKB(sgeog.STAsBinary(), 4326).STConvexHull();

                pencolor = HandleTable.getRandomPenColor(false, false, false);

                CellTracing ct = new CellTracing();
                ct.cell = site.cell;
                ct.MI_STYLE = "Pen (1, 60," + pencolor.ToString() + ")";
                ct.SP_GEOMETRY = sgeom;
                sql = @" INSERT INTO [CELLTRACING]([cell],[MI_STYLE],[SP_GEOMETRY]) VALUES  ('"
                    + ct.cell + "','" + ct.MI_STYLE + "','" + ct.SP_GEOMETRY + "')";
                dc_tmap.ExecuteCommand(sql);

            }
        }
Exemple #3
0
        public SqlGeography getCellGeo()
        {
            site = dc_oss.SITE.Where(e => e.cell == this.sCell).FirstOrDefault();
            if (site == null)
            {
                return(SqlGeography.Point(0, 0, 4236));
            }
            sitesgeog = SqlGeography.Point((double)site.latitude, (double)site.longitude, 4326);
            double.TryParse(site.ant_gain, out sAntGain);
            double.TryParse(site.height, out sHeight);
            sPathLoss = okumh.PathLoss2Distance((double)site.band, (double)sHeight, (double)mobileHight, (double)(sPowerN + sAntGain - sPowerControl - sRxlev));

            Console.WriteLine(sPathLoss * 1000);

            okumbuffersgeog = sitesgeog.STBuffer(sPathLoss * 1000);

            celltracing = dc_tmap.CellTracing.Where(e => e.cell == sCell).FirstOrDefault();

            //if (abc == null) return ngeo;

            celltracingsgeom = celltracing.SP_GEOMETRY;

            celltracingsgeog = SqlGeography.STGeomFromWKB(celltracingsgeom.STAsBinary(), 4326);

            Console.WriteLine(okumbuffersgeog.STArea());
            Console.WriteLine(celltracingsgeog.STArea());

            if (celltracingsgeog.STArea() > 0)
            {
                return(okumbuffersgeog.STIntersection(celltracingsgeog));   // 用圆和扇形相交
            }
            else
            {
                return(okumbuffersgeog);    //返回圆
            }
        }
        public SqlGeography getCellGeo()
        {
            site = dc_oss.SITE.Where(e => e.cell == this.sCell).FirstOrDefault();
            if (site == null) return SqlGeography.Point(0, 0, 4236);
            sitesgeog = SqlGeography.Point((double)site.latitude, (double)site.longitude, 4326);
            double.TryParse(site.ant_gain, out sAntGain);
            double.TryParse(site.height, out sHeight);
            sPathLoss = okumh.PathLoss2Distance((double)site.band, (double)sHeight, (double)mobileHight, (double)(sPowerN + sAntGain - sPowerControl - sRxlev));

            Console.WriteLine(sPathLoss * 1000);

            okumbuffersgeog = sitesgeog.STBuffer(sPathLoss * 1000);

            celltracing = dc_tmap.CellTracing.Where(e => e.cell == sCell).FirstOrDefault();

            //if (abc == null) return ngeo;

            celltracingsgeom = celltracing.SP_GEOMETRY;

            celltracingsgeog = SqlGeography.STGeomFromWKB(celltracingsgeom.STAsBinary(), 4326);

            Console.WriteLine(okumbuffersgeog.STArea());
            Console.WriteLine(celltracingsgeog.STArea());

            if (celltracingsgeog.STArea() > 0)
                return okumbuffersgeog.STIntersection(celltracingsgeog);   // 用圆和扇形相交
            else
                return okumbuffersgeog;    //返回圆
        }