Tag: 空间

DbGeography相交方法不起作用

System.Data.Spatial.DbGeography.Intersects方法似乎总是为我返回true。 我不确定为什么会这样。 我在下面创建了一个简单的命令行代码段,导致下面的控制台输出 Intersects Intersects 这一点显然不在界限附近,因此不应该相交。 DbGeography bounds = DbGeography.PolygonFromText(“POLYGON ((146 -20,148 -20,148 -22,146 -22,146 -20))”, 4326); DbGeography point = DbGeography.PointFromText(“POINT (0 0)”, 4326); if (point.Intersects(bounds) == true) Console.WriteLine(“Intersects”); else Console.WriteLine(“Does NOT intersect”); if (bounds.Intersects(point) == true) Console.WriteLine(“Intersects”); else Console.WriteLine(“Does NOT intersect”);

包含SqlGeometry的数据表导致存储过程执行失败…为什么?

我正在尝试将一系列SqlGeometry值保存到SQL Server 2008数据库。 基本上我在SQL Server存储过程中有一个tabletype,如下所示: CREATE TYPE [dbo].[TableType_Example] AS TABLE ( [SpatialID] [bigint] NOT NULL, [RecordID] [bigint] NOT NULL, [geom] [geometry] NOT NULL ) 然后我在C#中构建一个数据表并像这样发送: public static bool SaveSpatialDataElements(long recordID, List featureList) { //Setup features datatable DataTable dtFeatures = new DataTable(); dtFeatures.Columns.Add(“SpatialID”, typeof(SqlInt64)); dtFeatures.Columns.Add(“RecordID”, typeof(SqlInt64)); dtFeatures.Columns.Add(“geom”, typeof(SqlGeometry)); foreach(var curFeature in featureList) { object[] curRowObjects = […]

RichTextBox中新行之后的空格

当用户按下回车键或插入文本时,RichTextBox会在行之间放置额外的空间,而这正是我想要摆脱的。 我四处寻找,我找到的唯一合适的解决方案就是这个: Setter SetParagraphMargin = new Setter(); SetParagraphMargin.Property = Paragraph.MarginProperty; SetParagraphMargin.Value = new Thickness(0); Style style = new Style(); style.TargetType = typeof(Paragraph); style.Setters.Add(SetParagraphMargin); rtb.Resources.Add(“Style”, style); 但这仍然行不通。 有没有人对我有任何提示?

DatagridView:删除未使用的空间?

我想知道是否可以在C#中删除DataGridView控件的未使用空间(灰色空间)。 我必须使DataGridView只显示白表。 alt text http://sofzh.miximages.com/c%23/datagridview-to-excel-1.gif 有什么建议 ?

entity framework:SqlGeography与DbGeography

这两个对象在Microsoft SQL数据库中表示相同Geography数据类型的区别或预期目的是什么? System.Data.Entity.Spatial.DbGeography 和 Microsoft.SqlServer.Types.SqlGeography 它们不能在彼此之间进行转换,但是在创建点,多边形等时, SqlGeography还有其他命令。 我认为System.Data.Entity仅用于Entity Framework,而Microsoft.SqlServer是直接使用SqlCommand时使用的?

知道任何C#空间数据库吗?

我正在寻找在.NET中实现空间查询而不使用SQL2008。 第一个要求是能够创建(BTree样式)空间索引并能够查询它。 尽管SQL 2008附带了用于类型的.NET库,但您需要将SQL用于空间索引。 是否有人使用任何.NET库来处理空间数据(操作系统或商业)? 我正在看NetTopologySuite,但它看起来很安静,我不想要一个死库。

validationWindows窗体应用程序中的文本框

我的情景是: 输入一个或多个字符后,不允许在文本框的起始位置使用空格文本框允许使用空格 以下不适用于我的场景。 private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if (e.Handled = (e.KeyChar == (char)Keys.Space)) { MessageBox.Show(“Spaces are not allowed”); } } textBox1.Text.TrimStart()

如何通过正则表达式删除字符串中的额外返回和空格?

我将HTML代码转换为纯文本。但是有很多额外的返回和空格。如何删除它们?

如何托管Powershell脚本或应用程序,以便可以通过WSManConnectionInfo访问它? (如Office 365)

我知道连接到远程运行空间的唯一方法包括以下参数 WSManConnectionInfo connectionInfo = new WSManConnectionInfo(false, “localhost”, 80, “/Powershell”, “http://schemas.microsoft.com/powershell/Microsoft.Exchange”, credential); 要么 WSManConnectionInfo connectionInfo = new WSManConnectionInfo(false, “localhost”, 5985, “/wsman”, “http://schemas.microsoft.com/powershell/Microsoft.Powershell”, credential); 如何设置我自己的自定义Powershell对象,以便通过HTTP公开它? 使用的正确参数是什么以及如何设置它们?