我試圖反序列化GeoJson,所以我可以將其分解並存儲在Db中。當我嘗試反序列化它時,coordinates
的反序列化失敗。如何反序列化嵌套的JSON數組?
我使用下面的類幾何:
public class GeoJsonGeometry {
public string type { get; set; }
public string[, ,] coordinates { get; set; }
}
"geometry": { "type": "Polygon", "coordinates": [ [ [ -85.388717, 33.913044 ], [ -85.380885, 33.873508 ], [ -85.379455, 33.866291 ], [ -85.377426, 33.856047 ], [ -85.376403, 33.850656 ], [ -85.364595, 33.788446 ], [ -85.361844, 33.773951 ], [ -85.360491, 33.767958 ], [ -85.357402, 33.750104 ], [ -85.355252, 33.739245 ], [ -85.344054, 33.682684 ], [ -85.342722, 33.675953 ], [ -85.323792, 33.580339 ], [ -85.315340, 33.537646 ], [ -85.314994, 33.535898 ], [ -85.314843, 33.534951 ], [ -85.314091, 33.530218 ], [ -85.313999, 33.529807 ], [ -85.304439, 33.482884 ], [ -85.308211, 33.481579 ], [ -85.309250, 33.483137 ], [ -85.314852, 33.487603 ],...]]]
我試過double [,,]
但它也不能工作。
我很困惑,因爲它看起來應該很好地序列化,因爲它是嵌套數組,但事實並非如此。任何幫助,將不勝感激。
我也試過List<List<List<double>>>
和double[][][]
,它總是失敗。
不能理解爲什麼這個問題被拒絕投票,我有同樣的問題,這個職位幫助。 – Luther