geoJson格式说明

GeoJSON

GeoJSON是一种对各种地理数据结构进行编码的格式,GeoJSON对象可以表示几何、特征或者特征集合

GeoJSON支持下面几何类型:点、线、面、多点、多线、多面和几何集合

GeoJSON里的特征包含一个几何对象和其他属性,特征集合表示一系列特征。


注:

  • GeoJSON对象可能有任何数目成员(名/值对

  • GeoJSON对象必须由一个名字为type的成员,值必须是下面之一:

    1
    2
    Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon,
    GeometryCollection, Feature, FeatureCollection
  • GeoJSON对象可能有一个可选的crs成员,它的值必须是一个坐标参考系统的对象

  • GeoJSON对象可能有一个bbox成员,它的值必须是边界框数组


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
"type": "FeatureCollection",
"features": [
// 点
{
"type": "Feature",
"geometry": {"type": "Point", "coordinates": [102.0, 0.5]},
"properties": {"prop0": "value0"}
},
// 线
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[102.0, 0.0],
[103.0, 1.0],
[104.0, 0.0],
[105.0, 1.0]
]
},
"properties": {
"prop0": "value0",
"prop1": 0.0
}
},
// 面
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[100.0, 0.0],
[101.0, 0.0],
[101.0, 1.0],
[100.0, 1.0],
[100.0, 0.0]
]
]
},
"properties": {
"prop0": "value0",
"prop1": {"this": "that"}
}
}
]
}


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{
"type":"Feature",
"properties":{

},
"geometry":{
"type":"MultiPolygon",
"coordinates":[
// 多个Polygon
[
[
[101.6455078125,27.68352808378776],
[114.78515624999999,27.68352808378776],
[114.78515624999999,35.209721645221386],
[101.6455078125,35.209721645221386],
[101.6455078125,27.68352808378776]
]
],
[
[
[104.2822265625,30.107117887092357],
[108.896484375,30.107117887092357],
[108.896484375,33.76088200086917],
[104.2822265625,33.76088200086917],
[104.2822265625,30.107117887092357]
]
]
]
}
}


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
"type":"Feature",
"properties":{

},
"geometry":{
"type":"MultiPolygon",
"coordinates":[
[
// 多个LineString
[
[101.6455078125,27.68352808378776],
[114.78515624999999,27.68352808378776],
[114.78515624999999,35.209721645221386],
[101.6455078125,35.209721645221386],
[101.6455078125,27.68352808378776]
],
[
[104.2822265625,30.107117887092357],
[108.896484375,30.107117887092357],
[108.896484375,33.76088200086917],
[104.2822265625,33.76088200086917],
[104.2822265625,30.107117887092357]
]
]
]
}
}

传送门:GeoJson在线预览GeoJson在线获取