第一步:先熟悉geojson的数据结构
geojson将所有的地理要素分为Point、MultiPoint、LineString、MultiLineString、Polygon、MultiPolygon、GeometryCollection。
感觉有篇博文讲的挺好,大家可以去看一下geojson数据结构讲解
第二步:试图使用Java代码去获取json里面你想要的图层里面的数据
我之前写过一篇根据Java代码获取json数据的文章,大家可以去看一下java操作json文件
第三步:开始分析你想要找的图标有什么特点
//这代表一个三角形
{
"geometry": {
"geometries": [{
"coordinates": [
[19776.669056702118, 32717.534270796306, 9.181425E-9],
[20103.606839973643, 32717.534325811146, 9.181425E-9]
],
"type": "LineString"
}, {
"coordinates": [
[19776.669056702118, 32717.534270796306, 9.181425E-9],
[19940.13805881275, 32417.534298303737, 9.181425E-9]
],
"type": "LineString"
}, {
"coordinates": [
[19940.13805881275, 32417.534298303737, 9.181425E-9],
[20103.606839973643, 32717.534325811146, 9.181425E-9]
],
"type": "LineString"
}, {
"coordinates": [
[19834.25117925165, 32717.534280485826, 9.181425E-9],
[19834.251181033436, 32706.94559757729, 9.181425E-9]
],
"type": "LineString"
},
。。。。。。。。
, {
"coordinates": [
[19940.138027930516, 32601.05878631602, 9.181425E-9],
[19940.138045748416, 32495.171957236857, 9.181425E-9]
],
"type": "LineString"
}, {
"coordinates": [
[20046.02483741, 32717.53431612164, 9.181425E-9],
[20046.02483919179, 32706.945633213105, 9.181425E-9]
],
"type": "LineString"
}, {
"coordinates": [19940.138045748416, 32495.171957236857, 9.181425E-9],
"type": "Point"
}, {
"coordinates": [19940.138010112612, 32706.945615395198, 9.181425E-9],
"type": "Point"
}],
"type": "GeometryCollection"
},
"type": "Feature",
"properties": {
"ExtendedEntity": null,
"SubClasses": "AcDbEntity:AcDbBlockReference",
"Text": null,
"EntityHandle": "3DA17",
"Linetype": null,
"Layer": "I-POWER"
}
},
这是一个三角形在json文件中的数据结构,我找了几个对比了一下,发现每个三角形的三个边都是三条线组成
{
"coordinates": [
[