dxf geojson 转换_将Geopandas中geojson文件的linestring转换为polygon
我有dxf格式的以下CAD文件,它以autocad顯示,如下所示:
我用gdalorg2org將它轉換成geojson格式的文件,名為test.geojson,但都是type: LineString{
"type": "FeatureCollection",
"name": "entities",
"features": [
{ "type": "Feature", "properties": { "Layer": "0" }, "geometry": { "type": "LineString", "coordinates": [ [ 30.0, 0.0 ], [ 30.0, 9.0 ] ] } },
{ "type": "Feature", "properties": { "Layer": "0" }, "geometry": { "type": "LineString", "coordinates": [ [ 16.0, 47.0 ], [ 16.0, 34.0 ] ] } },
{ "type": "Feature", "properties": { "Layer": "0" }, "geometry": { "type": "LineString", "coordinates": [ [ 16.0, 13.0 ], [ 16.0, 0.0 ] ] } },
{ "type": "Feature", "properties": { "Layer": "0" }, "geometry": { "type": "LineString", "coordinates": [ [ 0.0, 31.0 ], [ 9.0, 31.0 ] ] } },
{ "type": "Feature", "properties": { "Layer": "0" }, "geometry": { "type": "LineString", "coordinates": [ [ 30.0, 31.0 ], [ 39.0, 31.0 ] ] } },
{ "type": "Feature", "properties": { "Layer": "0" }, "geometry": { "type": "LineString", "coordinates": [ [ 0.0, 23.0 ], [ 9.0, 23.0 ] ] } },
{ "type": "Feature", "properties": { "Layer": "0" }, "geometry": { "type": "LineString", "coordinates": [ [ 30.0, 23.0 ], [ 39.0, 23.0 ] ] } },
{ "type": "Feature", "properties": { "Layer": "0" }, "geometry": { "type": "LineString", "coordinates": [ [ 0.0, 16.0 ], [ 9.0, 16.0 ] ] } },
{ "type": "Feature", "properties": { "Layer": "0" }, "geometry": { "type": "LineString", "coordinates": [ [ 30.0, 16.0 ], [ 39.0, 16.0 ] ] } },
{ "type": "Feature", "properties": { "Layer": "0" }, "geometry": { "type": "LineString", "coordinates": [ [ 0.0, 0.0 ], [ 39.0, 0.0 ], [ 39.0, 47.0 ], [ 0.0, 47.0 ], [ 0.0, 0.0 ] ] } },
{ "type": "Feature", "properties": { "Layer": "0" }, "geometry": { "type": "LineString", "coordinates": [ [ 9.0, 38.0 ], [ 11.0, 38.0 ], [ 11.0, 34.0 ], [ 28.0, 34.0 ], [ 28.0, 38.0 ], [ 30.0, 38.0 ], [ 30.0, 9.0 ], [ 28.0, 9.0 ], [ 28.0, 13.0 ], [ 11.0, 13.0 ], [ 11.0, 9.0 ], [ 9.0, 9.0 ], [ 9.0, 38.0 ] ] } },
{ "type": "Feature", "properties": { "Layer": "0" }, "geometry": { "type": "LineString", "coordinates": [ [ 11.0, 32.0 ], [ 17.0, 32.0 ], [ 17.0, 15.0 ], [ 11.0, 15.0 ], [ 11.0, 32.0 ] ] } },
{ "type": "Feature", "properties": { "Layer": "0" }, "geometry": { "type": "LineString", "coordinates": [ [ 20.0, 32.0 ], [ 28.0, 32.0 ], [ 28.0, 15.0 ], [ 20.0, 15.0 ], [ 20.0, 32.0 ] ] } }
]
}
我想把它轉換成type: polygon,顯示如下圖:
在地質公園我怎么能做到呢?謝謝。在
順便說一句,我讀了test.geojson文件,它看起來像:
^{pr2}$
輸出:Layer SubClasses EntityHandle geometry
0 0 AcDbEntity:AcDbPolyline 106 LINESTRING (30.35270412013777 0.79246615687498...
1 0 AcDbEntity:AcDbPolyline 107 LINESTRING (16.16520412013776 47.1049661568749...
2 0 AcDbEntity:AcDbPolyline 108 LINESTRING (16.16520412013776 13.4799661568749...
3 0 AcDbEntity:AcDbPolyline 109 LINESTRING (0.665204120137787 31.2924661568749...
4 0 AcDbEntity:AcDbPolyline 10A LINESTRING (30.35270412013777 31.2924661568749...
總結
以上是生活随笔為你收集整理的dxf geojson 转换_将Geopandas中geojson文件的linestring转换为polygon的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: android微信小程序自动填表_微信小
- 下一篇: 英伟达账号为什么登录不了_告别视频通话“