10

geo-json 格式有复杂的 GeometryCollection。它包含点和多边形。是否有任何众所周知的 .net 库可以帮助将其转换为 Wkt 格式?

{"geometries":[{"coordinates":[-76.92864,38.84465],"type":"Point"},{"coordinates":[-76.93066,38.84352],"type":"Point"},{"coordinates":[-76.93685,38.85339],"type":"Point"},{"coordinates":[-76.93865,38.8546],"type":"Point"},{"coordinates":[-76.94017,38.85542],"type":"Point"},{"coordinates":[-77.0517,38.85779],"type":"Point"},{"coordinates":[-77.05555,38.87055],"type":"Point"},{"coordinates":[-77.05556,38.87064],"type":"Point"},{"coordinates":[-77.05558,38.8705],"type":"Point"},{"coordinates":[-77.05558,38.8705],"type":"Point"},{"coordinates":[-77.05559,38.8705],"type":"Point"},{"coordinates":[[[-77.06071,38.89092],[-77.06408,38.8897]]],"type":"Polygon"},{"coordinates":[[[-77.06658,38.89959],[-77.05996,38.89806],[-77.06162,38.89953],[-77.06242,38.89955],[-77.063,38.89994],[-77.06486,38.89961],[-77.06583,38.89991],[-77.06658,38.89959]]],"type":"Polygon"},{"coordinates":[-77.08622,38.9858],"type":"Point"},{"coordinates":[-77.11485,38.84505],"type":"Point"},{"coordinates":[[[-77.1194,38.93491],[-77.11622,38.93155],[-77.11581,38.92891],[-77.11411,38.92713],[-77.11308,38.9266],[-77.11259,38.94019],[-77.11673,38.93688],[-77.1194,38.93491]]],"type":"Polygon"},{"coordinates":[-77.13694,39.02613],"type":"Point"},{"coordinates":[-77.23124,38.87993],"type":"Point"},{"coordinates":[[[-77.46487,38.91975],[-77.42261,38.96258],[-77.42482,38.96293],[-77.42615,38.96359],[-77.42764,38.96264],[-77.42788,38.96403],[-77.43069,38.96369],[-77.43093,38.96106],[-77.43192,38.96],[-77.432,38.95341],[-77.46487,38.91975]]],"type":"Polygon"}],"type":"GeometryCollection"}

谢谢

4

1 回答 1

-4

根据您使用的上下文,您可以将这些 JSON 对象转换为 C# 对象,可以是自定义对象,也可以是此处描述的对象。该框架 (.NET) 具有来自 JSON(在 MVC 中)的内置序列化程序,或者您可以使用第三方库

于 2012-12-08T03:51:22.747 回答