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;    //返回圆
        }
Exemplo n.º 2
0
        public SqlGeography MergePoint(SITE site)
        {
            //SectorCovarage(6, (double)site.Height, (double)site.Tilt);
            //if (site.SP_GEOMETRY != null)
            //{
            //基站覆盖范围的计算?????
            //Enter Antenna Vertical (3dB) Beamwidth (? =6 °)
            //double.TryParse(site.band, out frequency);
            this.frequency = (double)site.band;
            this.power = (double)site.power;
            double.TryParse(site.ant_gain, out antGain);
            double.TryParse(site.height, out height);
            double.TryParse(site.tilt.ToString(), out this.tilt);

            //this.antGain = (double)site.ant_gain;
            pathLoss = this.power + this.antGain - this.pre_rxlev;

            SectorCoverage sc = new SectorCoverage(frequency, this.height, mobileHight, pathLoss);

            Console.WriteLine("{0}...{1}...", frequency, sc.DistanceOkumuraHata);
            //sc.SectorPoint = SqlGeometry.Point(0, 0, 4326);
            sc.Latitude = (double)site.latitude;
            sc.Longtitude = (double)site.longitude;
            //Console.WriteLine("{0}...", sc.SectorPoint.Long);
            sc.Direction = (double)site.dir;
            sc.DownTilt = this.tilt;
            //sc.SectorPoint = SqlGeography.STGeomFromWKB(site.SP_GEOMETRY.STAsBinary(), 4326);
            sc.HorizontalBeamwidth = (double)site.ant_bw;
            sc.VerticalBeamwidth = verticalBeamwidth;
            sc.getSectorRadius();
            sc.getSectorCoveragePoint();

            sgeog = SqlGeography.Point(sc.Latitude, sc.Longtitude, 4326);
            //SqlGeometry sgeo = new SqlGeometry();
            Console.WriteLine("{0}...{1}...", site.latitude, site.longitude);
            foreach (var m in sc.STSectorCoverageRegion)
            {
                //Console.WriteLine("{0}...{1}", m.Lat, m.Long);
                //SqlGeometry mgeo=SqlGeometry.STPointFromWKB(m.STAsBinary(),4326);
                sgeog = sgeog.STUnion(m);

            }
            return sgeog;
        }
Exemplo n.º 3
0
        public SqlGeography MergePoint(SITE site)
        {
            //SectorCovarage(6, (double)site.Height, (double)site.Tilt);
            //if (site.SP_GEOMETRY != null)
            //{
            //基站覆盖范围的计算?????
            //Enter Antenna Vertical (3dB) Beamwidth (? =6 °)
            //double.TryParse(site.band, out frequency);
            this.frequency = (double)site.band;
            this.power     = (double)site.power;
            double.TryParse(site.ant_gain, out antGain);
            double.TryParse(site.height, out height);
            double.TryParse(site.tilt.ToString(), out this.tilt);

            //this.antGain = (double)site.ant_gain;
            pathLoss = this.power + this.antGain - this.pre_rxlev;

            SectorCoverage sc = new SectorCoverage(frequency, this.height, mobileHight, pathLoss);

            Console.WriteLine("{0}...{1}...", frequency, sc.DistanceOkumuraHata);
            //sc.SectorPoint = SqlGeometry.Point(0, 0, 4326);
            sc.Latitude   = (double)site.latitude;
            sc.Longtitude = (double)site.longitude;
            //Console.WriteLine("{0}...", sc.SectorPoint.Long);
            sc.Direction = (double)site.dir;
            sc.DownTilt  = this.tilt;
            //sc.SectorPoint = SqlGeography.STGeomFromWKB(site.SP_GEOMETRY.STAsBinary(), 4326);
            sc.HorizontalBeamwidth = (double)site.ant_bw;
            sc.VerticalBeamwidth   = verticalBeamwidth;
            sc.getSectorRadius();
            sc.getSectorCoveragePoint();

            sgeog = SqlGeography.Point(sc.Latitude, sc.Longtitude, 4326);
            //SqlGeometry sgeo = new SqlGeometry();
            Console.WriteLine("{0}...{1}...", site.latitude, site.longitude);
            foreach (var m in sc.STSectorCoverageRegion)
            {
                //Console.WriteLine("{0}...{1}", m.Lat, m.Long);
                //SqlGeometry mgeo=SqlGeometry.STPointFromWKB(m.STAsBinary(),4326);
                sgeog = sgeog.STUnion(m);
            }
            return(sgeog);
        }
Exemplo n.º 4
0
        public void getLiJiaoSite(Linq2SqlGeography.LinqSql.FromMap.DataClasses1DataContext dc, SITE site, List<LiJiaoSite> lijiaosites)
        {
            var sp = SqlGeography.Point((double)site.latitude, (double)site.longitude, 4326);
            var sitebuffer = sp.STBuffer(50);   //类型转换以后没有问题,单位是米
            foreach (var lj in dc.城市内部主要交通干道)
            {
                if (lj.SP_GEOMETRY != null)
                {
                    //SqlGeometry ->SqlGeography
                    var ljp = SqlGeography.STGeomFromWKB(lj.SP_GEOMETRY.STAsBinary(), 4326);

                    /*
                     1.掉话和立交的距离?
                     2.切换失败和立交的距离?
                     3.未接通和立交的距离?

                        异常事件类型	触发次数
                        SDCCH掉话	71
                        TCH掉话	215
                        未接通	208
                        切换失败	633
                        上行连续弱覆盖	5122
                        下行连续弱覆盖	783
                        上行连续质差	417
                        下行连续质差	510

                     * */

                    //基站和立交的距离?

                    if (ljp.STIntersects(sitebuffer))
                    {
                        LiJiaoSite lijiaosite = new LiJiaoSite();
                        lijiaosite.lj = lj;
                        lijiaosite.site = site;
                        lijiaosites.Add(lijiaosite);
                    }
                }
            }
            Console.WriteLine(lijiaosites.Count());
            WriteConsoleLine(lijiaosites);
        }
Exemplo n.º 5
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);    //返回圆
            }
        }
Exemplo n.º 6
0
        public void getLiJiaoSite(Linq2SqlGeography.LinqSql.FromMap.DataClasses1DataContext dc, SITE site, List <LiJiaoSite> lijiaosites)
        {
            var sp         = SqlGeography.Point((double)site.latitude, (double)site.longitude, 4326);
            var sitebuffer = sp.STBuffer(50);   //类型转换以后没有问题,单位是米

            foreach (var lj in dc.城市内部主要交通干道)
            {
                if (lj.SP_GEOMETRY != null)
                {
                    //SqlGeometry ->SqlGeography
                    var ljp = SqlGeography.STGeomFromWKB(lj.SP_GEOMETRY.STAsBinary(), 4326);

                    /*
                     * 1.掉话和立交的距离?
                     * 2.切换失败和立交的距离?
                     * 3.未接通和立交的距离?
                     *
                     *  异常事件类型	触发次数
                     *  SDCCH掉话	71
                     *  TCH掉话	215
                     *  未接通	208
                     *  切换失败	633
                     *  上行连续弱覆盖	5122
                     *  下行连续弱覆盖	783
                     *  上行连续质差	417
                     *  下行连续质差	510
                     *
                     * */

                    //基站和立交的距离?

                    if (ljp.STIntersects(sitebuffer))
                    {
                        LiJiaoSite lijiaosite = new LiJiaoSite();
                        lijiaosite.lj   = lj;
                        lijiaosite.site = site;
                        lijiaosites.Add(lijiaosite);
                    }
                }
            }
            Console.WriteLine(lijiaosites.Count());
            WriteConsoleLine(lijiaosites);
        }