将多边形数量合并为多边形

时间:2019-07-09 14:57:37

标签: python json geojson

我有一个包含数千个json多边形几何的列表,如下所示:

{"type":"Polygon","coordinates":[[[-3.74761249275648,48.1553321393883],[-3.7487037670057,48.1549328094763],[-3.74881026067484,48.1551269441743],[-3.7489842306003,48.1562730580435],[-3.74891349344581,48.1564591451586],[-3.74808156498281,48.1564431307103],[-3.74508499799638,48.1571063739741],[-3.74469509883265,48.1569830965023],[-3.74442860883604,48.156338388502],[-3.7456218240484,48.1559377887423],[-3.74765763078163,48.1556344996134],[-3.74761249275648,48.1553321393883]]]}
{"type":"Polygon","coordinates":[[[-3.74761249275648,48.1553321393883],[-3.7487037670057,48.1549328094763],[-3.74881026067484,48.1551269441743],[-3.7489842306003,48.1562730580435],[-3.74891349344581,48.1564591451586],[-3.74808156498281,48.1564431307103],[-3.74508499799638,48.1571063739741],[-3.74469509883265,48.1569830965023],[-3.74442860883604,48.156338388502],[-3.7456218240484,48.1559377887423],[-3.74765763078163,48.1556344996134],[-3.74761249275648,48.1553321393883]]]}
{"type":"Polygon","coordinates":[[[-3.74761249275648,48.1553321393883],[-3.7487037670057,48.1549328094763],[-3.74881026067484,48.1551269441743],[-3.7489842306003,48.1562730580435],[-3.74891349344581,48.1564591451586],[-3.74808156498281,48.1564431307103],[-3.74508499799638,48.1571063739741],[-3.74469509883265,48.1569830965023],[-3.74442860883604,48.156338388502],[-3.7456218240484,48.1559377887423],[-3.74765763078163,48.1556344996134],[-3.74761249275648,48.1553321393883]]]}

结果应类似于以下内容:

{
"type": "FeatureCollection",
"features": [
{ "type": "Feature", "properties": {}, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 14.099648300117231, 10.223915592028142 ], [ 15.684642438452517, 10.49589683470106 ], [ 16.191090269636575, 7.447831184056278 ], [ 14.690504103165296, 7.419695193434941 ], [ 14.099648300117231, 10.223915592028142 ] ] ] ] } },
{ "type": "Feature", "properties": {}, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 17.841735052754977, 10.355216881594378 ], [ 21.030480656506445, 10.130128956623686 ], [ 19.454865181711604, 6.172332942555691 ], [ 17.597889800703395, 6.997655334114894 ], [ 17.841735052754977, 10.355216881594378 ] ] ] ] } }
]
}

我想始终将50行合并为多面体。 我想我必须做与此https://stackoverflow.com/a/55412100/10437064类似的事情,但是我不知道如何在没有“特征”和“几何”的情况下获得“类型”和“坐标”。

谢谢!

0 个答案:

没有答案
相关问题