我有一个"简单"的场景:读取一些JSON文件,过滤或更改一些值并将结果写回json,而不更改原始格式.
所以例如改变这个:
{
"type": "FeatureCollection",
"crs": {
"type": "EPSG",
"properties": {
"code": 28992
}
},
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
149886.192,
374554.705
],
[
149728.583,
374473.112
],
[
149725.476,
374478.215
]
]
]
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
进入:
{
"type": "FeatureCollection",
"crs": {
"type": "EPSG",
"properties": {
"code": 28992
}
},
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates":
[
149886.192,
374554.705
]
}
}
]
}
Run Code Online (Sandbox Code Playgroud)
我已经尝试过newtonsoft等JSON.Net,但我能找到的只有: