10 votes

Comment convertir un geo-json complexe en wkt en c# ?

Il existe une collection complexe de géométries au format geo-json. Elle contient des points et des polygones. Existe-t-il une bibliothèque .net bien connue qui puisse aider à la convertir au format 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"}

Remerciements

-4voto

rae1 Points 4603

En fonction du contexte que vous utilisez, vous pouvez convertir ces objets JSON en objets C#, soit des objets personnalisés, soit des objets comme ceux décrits ci-dessous. aquí . Le framework (.NET) dispose de sérialiseurs intégrés à partir de JSON (dans MVC) ou vous pouvez utiliser bibliothèques tierces .

Prograide.com

Prograide est une communauté de développeurs qui cherche à élargir la connaissance de la programmation au-delà de l'anglais.
Pour cela nous avons les plus grands doutes résolus en français et vous pouvez aussi poser vos propres questions ou résoudre celles des autres.

Powered by:

X