相关疑难解决方法(0)

在.net 4.5中有类似dbgeometry makevalid的东西吗?

我正在尝试计算折线的面积

    string poly = "POLYGON ((637604.918432772 2230520.64934531,
637622.257266129 2230419.44632915, 637279.107128549 2230192.04910755, 636765.470527745 2230179.6468564, 636778.005055813 2229861.77192838, 636529.81646905 2229464.29327025, 635813.486592791 2229523.30345774, 636017.385069448 2229974.32341381, 636267.323659164 2230070.32127916, 637035.026966561 2230404.70764784, 637275.265066307 2230401.13408429, 637604.918432772 2230520.64934531, 637604.918432772 2230520.64934531))";
     DbGeometry gm = DbGeometry.FromText(poly, 32637);
double area= gm.Area.Value; // here I got the error Exception has been thrown by the target of an invocation.
Run Code Online (Sandbox Code Playgroud)

我后来注意到dbgeometry无效的错误共鸣我尝试ms sql 2012中的代码也给我错误但是当我尝试那样的时候

SELECT @gm.MakeValid().STArea()
Run Code Online (Sandbox Code Playgroud)

多数民众赞成在sql工作我的问题是,有什么东西使几何有效.net谢谢你

c# sql spatial geospatial .net-4.5

3
推荐指数
2
解决办法
4942
查看次数

标签 统计

.net-4.5 ×1

c# ×1

geospatial ×1

spatial ×1

sql ×1