本文整理汇总了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;
}
示例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();
}