当前位置: 首页>>代码示例>>C#>>正文


C# SharpMap.ToString方法代码示例

本文整理汇总了C#中SharpMap.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# SharpMap.ToString方法的具体用法?C# SharpMap.ToString怎么用?C# SharpMap.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SharpMap的用法示例。


在下文中一共展示了SharpMap.ToString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FindGeoNearPoint

        public SharpMap.Data.FeatureDataRow FindGeoNearPoint(SharpMap.Geometries.Point pos, double amountGrow, ref double DistanceToSelected)
        {
            SharpMap.Geometries.BoundingBox bbox = pos.GetBoundingBox().Grow(amountGrow);
            SharpMap.Data.FeatureDataSet ds = new SharpMap.Data.FeatureDataSet();
            DataSource.ExecuteIntersectionQuery(bbox, ds);
            System.Data.DataTable tbl = ds.Tables[0] as SharpMap.Data.FeatureDataTable;
            GisSharpBlog.NetTopologySuite.IO.WKTReader reader = new GisSharpBlog.NetTopologySuite.IO.WKTReader();
            GeoAPI.Geometries.IGeometry point = reader.Read(pos.ToString());
            if (tbl.Rows.Count == 0)
                return null;

            double distance = point.Distance(reader.Read((tbl.Rows[0] as SharpMap.Data.FeatureDataRow).Geometry.ToString()));
            SharpMap.Data.FeatureDataRow selectedFeature = tbl.Rows[0] as SharpMap.Data.FeatureDataRow;

            if (tbl.Rows.Count > 1)
                for (int i = 1; i < tbl.Rows.Count; i++)
                {
                    GeoAPI.Geometries.IGeometry line = reader.Read((tbl.Rows[i] as SharpMap.Data.FeatureDataRow).Geometry.ToString());
                    if (point.Distance(line) < distance)
                    {
                        distance = point.Distance(line);
                        selectedFeature = tbl.Rows[i] as SharpMap.Data.FeatureDataRow;
                    }
                }
            DistanceToSelected = distance;
            return selectedFeature;
        }
开发者ID:diegowald,项目名称:intellitrack,代码行数:27,代码来源:VectorLayer.cs

示例2: mapBox1_GeometryDefined

        void mapBox1_GeometryDefined(SharpMap.Geometries.Geometry geometry)
        {
            MessageBox.Show("Geometry defined!\r\n"+geometry.ToString());

            geoProvider.Geometries.Add(geometry);

            this.mapBox1.ActiveTool = SharpMap.Forms.MapBox.Tools.Pan;
            this.mapBox1.Refresh();

        }
开发者ID:lishxi,项目名称:_SharpMap,代码行数:10,代码来源:FormDemoDrawGeometries.cs


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