sql-server – sql地理位置到dbgeography?
发布时间:2020-12-12 16:32:16 所属栏目:MsSql教程 来源:网络整理
导读:也许我错过了一些东西.我有一个sql server列的“地理”数据类型. 我想在我的c#代码中使用DbGeography类型.任何方式来转换或转换从sql的地理位置到数据挖掘? 解决方法 对于迟到的回应抱歉,但是在寻找别的东西时看到了这一点. 只需执行以下操作: SqlGeography
也许我错过了一些东西.我有一个sql server列的“地理”数据类型.
我想在我的c#代码中使用DbGeography类型.任何方式来转换或转换从sql的地理位置到数据挖掘? 解决方法对于迟到的回应抱歉,但是在寻找别的东西时看到了这一点.只需执行以下操作: SqlGeography theGeography; int srid = 4326; // or alternative DbGeography newGeography = DbGeography.FromText(theGeography.ToString(),srid); 要扭转它: DbGeography theGeography; SqlGeography newGeography = SqlGeography.Parse(theGeography.AsText()).MakeValid(); 希望有帮助! (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |