• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# GeoPoint类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中GeoPoint的典型用法代码示例。如果您正苦于以下问题:C# GeoPoint类的具体用法?C# GeoPoint怎么用?C# GeoPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GeoPoint类属于命名空间,在下文中一共展示了GeoPoint类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: GeoDistanceBucketAggregation

 public GeoDistanceBucketAggregation(string name, string field, GeoPoint origin, List<RangeAggregationParameter<uint>> ranges)
     : base("geo_distance", name)
 {
     _field = field;
     _origin = origin;
     _ranges = ranges;
 }
开发者ID:jnus,项目名称:ElasticsearchCRUD,代码行数:7,代码来源:GeoDistanceBucketAggregation.cs


示例2: ParseGoogleEncodedPolyline

        public static List<GeoPoint> ParseGoogleEncodedPolyline(String encoded)
        {
            var poly = new List<GeoPoint>();
            int index = 0, len = encoded.Length;
            int lat = 0, lng = 0;

            while (index < len)
            {
                int b, shift = 0, result = 0;
                do
                {
                    b = encoded[index++] - 63;
                    result |= (b & 0x1f) << shift;
                    shift += 5;
                } while (b >= 0x20);
                int dlat = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
                lat += dlat;

                shift = 0;
                result = 0;
                do
                {
                    b = encoded[index++] - 63;
                    result |= (b & 0x1f) << shift;
                    shift += 5;
                } while (b >= 0x20);
                var dlng = ((result & 1) != 0 ? ~(result >> 1) : (result >> 1));
                lng += dlng;

                var p = new GeoPoint(lat / 1E5, lng / 1E5);
                poly.Add(p);
            }

            return poly;
        }
开发者ID:boxbinary,项目名称:RavenBurgerCo,代码行数:35,代码来源:PolylineHelper.cs


示例3: IsInside

        public Boolean IsInside(GeoPoint point)
        {
            if ( point == null )
            {
                throw new ArgumentNullException("point");
            }

            GeoPoint a = NorthWestCorner;
            GeoPoint b = SouthWestCorner;
            GeoPoint c = NorthEastCorner;
            Double bax = b.Latitude - a.Latitude;
            Double bay = b.Longitude - a.Longitude;
            Double cax = c.Latitude - a.Latitude;
            Double cay = c.Longitude - a.Longitude;

            if ( (point.Latitude - a.Latitude) * bax + (point.Longitude - a.Longitude) * bay < 0.0 )
                return false;
            if ( (point.Latitude - b.Latitude) * bax + (point.Longitude - b.Longitude) * bay > 0.0 )
                return false;
            if ( (point.Latitude - a.Latitude) * cax + (point.Longitude - a.Longitude) * cay < 0.0 )
                return false;
            if ( (point.Latitude - c.Latitude) * cax + (point.Longitude - c.Longitude) * cay > 0.0 )
                return false;
            return true;
        }
开发者ID:PaulCharlton,项目名称:tambon,代码行数:25,代码来源:GeoFrameBase.cs


示例4: shpRead

        public GeoProject shpRead()
        {
            //IFeatureSet fs = FeatureSet.Open(shppath);
            string str = fs.ProjectionString;
            ProjectionInfo info = fs.Projection;
            project = new GeoProject();
            for (int i = 0; i < fs.Features.Count; i++) {
                Geometries geometries = new Geometries();
                IList<Coordinate> vertics = fs.Features[i].Coordinates;
                GeoPolygon polygon = new GeoPolygon();
                int circle = 1;
                foreach (Coordinate vertic in vertics) {
                    GeoPoint point = new GeoPoint();
                    point.X = vertic.X;
                    point.Y = vertic.Y;
                    if (polygon.Points.Contains(point)) {
                        polygon.Circle = circle;
                        geometries.Polygons.Add(polygon);
                        circle++;
                        polygon = new GeoPolygon();
                    }
                    polygon.Points.Add(point);
                }
                polygon.Circle = circle;
                geometries.Polygons.Add(polygon);
                project.Geometries.Add(geometries);
            }

            return project;
        }
开发者ID:freaky0112,项目名称:GeoManage,代码行数:30,代码来源:GeoEdit.cs


示例5: Contains

        public override bool Contains(GeoPoint location)
        {
            bool inside = false;

            var v1 = Points[Points.Count - 1];

            foreach (var v0 in Points)
            {
                double d1 = (location.Longitude - v0.Longitude) * (v1.Latitude - v0.Latitude);
                double d2 = (location.Latitude - v0.Latitude) * (v1.Longitude - v0.Longitude);

                if (location.Longitude < v1.Longitude)
                {
                    if (v0.Longitude <= location.Longitude)
                    {
                        if (d1 > d2)
                        {
                            inside = !inside;
                        }
                    }
                }
                else if (location.Longitude < v0.Longitude)
                {
                    if (d1 < d2)
                    {
                        inside = !inside;
                    }
                }

                v1 = v0; //Store previous endpoint as next startpoint
            }

            return inside; 
        }
开发者ID:AlejandroGC,项目名称:SharpLocation,代码行数:34,代码来源:PolygonalGeofence.cs


示例6: SortGeoDistance

 public SortGeoDistance(string field, DistanceUnitEnum distanceUnit, GeoPoint geoPoint)
 {
     _field = field;
     Order = OrderEnum.asc;
     Unit = distanceUnit;
     GeoPoint = geoPoint;
 }
开发者ID:jnus,项目名称:ElasticsearchCRUD,代码行数:7,代码来源:SortGeoDistance.cs


示例7: GeoDecayBaseScoreFunction

 protected GeoDecayBaseScoreFunction(string field, GeoPoint origin, DistanceUnit scale, string decayType)
 {
     _field = field;
     _origin = origin;
     _scale = scale;
     _decayType = decayType;
 }
开发者ID:jnus,项目名称:ElasticsearchCRUD,代码行数:7,代码来源:GeoDecayBaseScoreFunction.cs


示例8: GetSouthEastCorner

 protected override GeoPoint GetSouthEastCorner()
 {
     GeoPoint southEastCorner = new GeoPoint(NorthWestCorner);
     southEastCorner.Latitude -= LatitudeExtendDegree;
     southEastCorner.Longitude += LongitudeExtendDegree;
     return southEastCorner;
 }
开发者ID:PaulCharlton,项目名称:tambon,代码行数:7,代码来源:RtsdMapFrame.cs


示例9: FromBodyTestAsync

     /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
     /// <exception cref="GeoClientException">A server side error occurred.</exception>
     public async System.Threading.Tasks.Task FromBodyTestAsync(GeoPoint location, System.Threading.CancellationToken cancellationToken)
     {
         var url_ = string.Format("{0}/{1}", BaseUrl, "api/Geo/FromBodyTest");
 
         using (var client_ = await CreateHttpClientAsync(cancellationToken).ConfigureAwait(false))
 		{
 			var request_ = await CreateHttpRequestMessageAsync(cancellationToken).ConfigureAwait(false);
 			PrepareRequest(client_, ref url_);
 			var content_ = new System.Net.Http.StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(location, new Newtonsoft.Json.JsonConverter[] { new Newtonsoft.Json.Converters.StringEnumConverter(), new JsonExceptionConverter() }));
 			content_.Headers.ContentType.MediaType = "application/json";
 			request_.Content = content_;
 			request_.Method = new System.Net.Http.HttpMethod("POST");
 			request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);
 			var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseContentRead, cancellationToken).ConfigureAwait(false);
 			ProcessResponse(client_, response_);
 
 			var responseData_ = await response_.Content.ReadAsByteArrayAsync().ConfigureAwait(false); 
 			var status_ = ((int)response_.StatusCode).ToString();
 
 			if (status_ == "204") 
 			{
 				return;
 			}
 			else
 			if (status_ != "200" && status_ != "204")
 				throw new GeoClientException("The HTTP status code of the response was not expected (" + (int)response_.StatusCode + ").", status_, responseData_, null);
 		}
 	}
开发者ID:NSwag,项目名称:NSwag,代码行数:30,代码来源:ServiceClients.cs


示例10: TestMovePoint_50m_Northeast

 public void TestMovePoint_50m_Northeast()
 {
     GeoPoint origin = new GeoPoint(112.1, 23.1);
     IGeoPoint<double> point = origin.Move(50, 45);
     Assert.AreEqual(point.Longtitute, 112.1010860, 1E-6);
     Assert.AreEqual(point.Lattitute, 23.101086, 1E-6);
 }
开发者ID:ouyh18,项目名称:LteTools,代码行数:7,代码来源:MovePointTest.cs


示例11: GeohashCellFilter

		public GeohashCellFilter(string field, GeoPoint location, int precision, bool neighbors)
		{
			_field = field;
			_location = location;
			_precision = precision;
			_neighbors = neighbors;
		}
开发者ID:cuulee,项目名称:ElasticsearchCRUD,代码行数:7,代码来源:GeohashCellFilter.cs


示例12: TestMovePoint_50m_Southwest

 public void TestMovePoint_50m_Southwest()
 {
     GeoPoint origin = new GeoPoint(112.1, 23.1);
     IGeoPoint<double> point = origin.Move(50, 225);
     Assert.AreEqual(point.Longtitute, 112.0989140, 1E-6);
     Assert.AreEqual(point.Lattitute, 23.098914, 1E-6);
 }
开发者ID:ouyh18,项目名称:LteTools,代码行数:7,代码来源:MovePointTest.cs


示例13: edit_MGRS_TextChanged

 private void edit_MGRS_TextChanged(object sender, EventArgs e)
 {
     if ( !_Changing )
     {
         String value = TambonHelper.ReplaceThaiNumerals(edt_MGRS.Text.ToUpper()).Trim();
         GeoPoint geoPoint = null;
         UtmPoint utmPoint = null;
         try
         {
             _Changing = true;
             if ( !TambonHelper.IsNumeric(value.Substring(0, 2)) )
             {
                 value = ZoneForThailandMgrs(value) + value;
             }
             utmPoint = UtmPoint.ParseMgrsString(value);
             geoPoint = new GeoPoint(utmPoint, (GeoDatum)cbx_datum.SelectedItem);
             geoPoint.Datum = GeoDatum.DatumWGS84();
         }
         catch
         {
             // invalid string
             utmPoint = null;
             geoPoint = null;
         }
         SetValues(geoPoint, utmPoint, sender);
         _Changing = false;
     }
 }
开发者ID:PaulCharlton,项目名称:tambon,代码行数:28,代码来源:GeoCoordinateForm.cs


示例14: GeoDistanceRangeFilter

 /// <summary>
 /// Filters documents that include only hits that exists within a specific distance from a geo point. 
 /// </summary>
 /// <param name="field">name of the field used for the geo point</param>
 /// <param name="location">GeoPoint location</param>
 /// <param name="from">from in distance units</param>
 /// <param name="to">to in distance units</param>
 public GeoDistanceRangeFilter(string field, GeoPoint location, DistanceUnit from, DistanceUnit to)
 {
     _field = field;
     _location = location;
     _from = @from;
     _to = to;
 }
开发者ID:jnus,项目名称:ElasticsearchCRUD,代码行数:14,代码来源:GeoDistanceRangeFilter.cs


示例15: TestDatumConversion

 public void TestDatumConversion()
 {
     // example as of http://www.colorado.edu/geography/gcraft/notes/datum/gif/molodens.gif
     GeoPoint point = new GeoPoint(30, -100, 232, GeoDatum.DatumNorthAmerican27MeanConus());
     point.Datum = GeoDatum.DatumWGS84();
     GeoPoint expected = new GeoPoint(30.0002239, -100.0003696, 194.816, GeoDatum.DatumWGS84());
     Assert.IsTrue(expected.Equals(point));
 }
开发者ID:PaulCharlton,项目名称:tambon,代码行数:8,代码来源:GeoPoint_Test.cs


示例16: OnLocationChanged

        public void OnLocationChanged(Location location)
        {
            var currentLocation = new GeoPoint((int) (location.Latitude * 1e6), (int) (location.Longitude * 1e6));

            _mapOverlay.Add(currentLocation, "Current Location");

            _map.Controller.AnimateTo(currentLocation);
        }
开发者ID:jorik041,项目名称:MobileDevelopmentInCSharpBook,代码行数:8,代码来源:LocationActivity.cs


示例17: InitMap

 private void InitMap()
 {
     mMapView = (Android.Runtime.Extensions.JavaCast<SupportMapFragment>(SupportFragmentManager
             .FindFragmentById(Resource.Id.map)).MapView);
     GeoPoint p = new GeoPoint((int)(39.945 * 1E6), (int)(116.404 * 1E6));
     mMapView.Controller.SetCenter(p);
     mMapView.Controller.SetZoom(13);
 }
开发者ID:hnhhzy,项目名称:BaiduMap_SDK_DEMO_for_Xamarin.Android,代码行数:8,代码来源:PanoramaPoiSelectorActivity.cs


示例18: DecodePolylinePoints

        public static List<GeoPoint> DecodePolylinePoints(string encodedPoints)
        {
            if (encodedPoints == null || encodedPoints == "") return null;
            List<GeoPoint> poly = new List<GeoPoint>();
            char[] polylinechars = encodedPoints.ToCharArray();
            int index = 0;

            int currentLat = 0;
            int currentLng = 0;
            int next5bits;
            int sum;
            int shifter;

            try
            {
                while (index < polylinechars.Length)
                {
                    // calculate next latitude
                    sum = 0;
                    shifter = 0;
                    do
                    {
                        next5bits = (int)polylinechars[index++] - 63;
                        sum |= (next5bits & 31) << shifter;
                        shifter += 5;
                    } while (next5bits >= 32 && index < polylinechars.Length);

                    if (index >= polylinechars.Length)
                        break;

                    currentLat += (sum & 1) == 1 ? ~(sum >> 1) : (sum >> 1);

                    //calculate next longitude
                    sum = 0;
                    shifter = 0;
                    do
                    {
                        next5bits = (int)polylinechars[index++] - 63;
                        sum |= (next5bits & 31) << shifter;
                        shifter += 5;
                    } while (next5bits >= 32 && index < polylinechars.Length);

                    if (index >= polylinechars.Length && next5bits >= 32)
                        break;

                    currentLng += (sum & 1) == 1 ? ~(sum >> 1) : (sum >> 1);
                    GeoPoint p = new GeoPoint();
                    p.lat = Convert.ToDouble(currentLat) / 100000.0;
                    p.lng = Convert.ToDouble(currentLng) / 100000.0;
                    poly.Add(p);
                }
            }
            catch (Exception)
            {
                // logo it
            }
            return poly;
        }
开发者ID:JavierSantosSuarez,项目名称:cal,代码行数:58,代码来源:Wasmcom.GMap.cs


示例19: EdgeIntersection

 //两点与线相交的那个点
 private static Point2D EdgeIntersection(Point2D p0, Point2D p1, Edge edge)
 {
     GeoPoint point = new GeoPoint(p1.X - p0.X, p1.Y - p0.Y);
     if (edge.IsHorisontal)
     {
         return new Point2D(p0.X + ((point.X / point.Y) * (edge.Value - p0.Y)), edge.Value);
     }
     return new Point2D(edge.Value, p0.Y + ((point.Y / point.X) * (edge.Value - p0.X)));
 }
开发者ID:SuperMap,项目名称:iClient-for-Silverlight,代码行数:10,代码来源:GeoRegionClip.cs


示例20: OnMapClick

 public void OnMapClick(GeoPoint point)
 {
     //在此处理地图点击事件 
     //消隐pop
     if (busLineSearchDemo.pop != null)
     {
         busLineSearchDemo.pop.HidePop();
     }
 }
开发者ID:hnhhzy,项目名称:BaiduMap_SDK_DEMO_for_Xamarin.Android,代码行数:9,代码来源:BusLineSearchDemo.cs



注:本文中的GeoPoint类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# GeoPositionChangedEventArgs类代码示例发布时间:2022-05-24
下一篇:
C# GeoCoordinateWatcher类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap