【发布时间】:2017-05-20 21:55:10
【问题描述】:
我有一个包含太多 JSON 数据对象的文件,格式如下:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-37.880859375,
78.81903553711727
],
[
-42.01171875,
78.31385955743478
],
[
-37.6171875,
78.06198918665974
],
[
-37.880859375,
78.81903553711727
]
]
]
}
},
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-37.6171875,
78.07107600956168
],
[
-35.48583984375,
78.42019327591201
],
[
-37.880859375,
78.81903553711727
],
[
-37.6171875,
78.07107600956168
]
]
]
}
}
]
}
我想拆分大文件,以便每个要素对象都有自己的文件,其中包含其类型对象和要素(坐标)对象。所以本质上,我正在尝试获得其中的许多:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-37.6171875,
78.07107600956168
],
[
-35.48583984375,
78.42019327591201
],
[
-37.880859375,
78.81903553711727
],
[
-37.6171875,
78.07107600956168
]
]
]
}
}
]
}
【问题讨论】:
-
你已经给了你的目标,但你要的是什么?完成此任务的确切 JavaScipt 是什么?
-
所有随机标签是怎么回事...它们应该用于缩小解决方案的范围...选择一些东西...
标签: javascript python json powershell jq