Exemplo n.º 1
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.º 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);
        }