sql-server – sql地理位置到dbgeography?

也许我错过了一些东西.我有一个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();

希望有帮助!

相关文章

SELECT a.*,b.dp_name,c.pa_name,fm_name=(CASE WHEN a.fm_n...
if not exists(select name from syscolumns where name=&am...
select a.*,pano=a.pa_no,b.pa_name,f.dp_name,e.fw_state_n...
要在 SQL Server 2019 中设置定时自动重启,可以使用 Window...
您收到的错误消息表明数据库 'EastRiver' 的...
首先我需要查询出需要使用SQL Server Profiler跟踪的数据库标...