geojson 文件生成


线要素  (注意大括号后面的多余逗号要去掉,不然QGIS会打不开)

 {"type": "FeatureCollection",
     "features": [
         {"type": "Feature",
              "geometry": {
                  "type": "LineString",
                  "coordinates": [
                      [115.1866, 30.9716], [114.8311, 30.8155], [114.7447, 30.3861], [114.6661, 29.9919],
                      [115.1036, 29.9252], [115.5574, 30.2716], [115.5325, 30.8211], [115.1866, 30.9716]
                  ]
              }
         }
     ]
 }

多点要素

 {"type": "FeatureCollection",
     "features": [
         {"type": "Feature",
              "geometry": {
                  "type": "MultiPoint",
                  "coordinates": [
                      [114.7516, 30.1502], [114.9844, 30.6019], [115.2669, 30.4338]
                  ]
              }
         }
     ]
 }

点要素

 {"type": "FeatureCollection",
     "features": [
         {"type": "Feature",
              "geometry": {
                  "type": "Point",
                  "coordinates": [114.7447, 30.3861]
              }
         }
     ]
 }

官方:https://geojson.org/

参考:https://www.jianshu.com/p/852d7ad081b3