梦入琼楼寒有月,行过石树冻无烟

📖 earlier posts 📖

D3 阈值比例尺

阈值([yù zhí],Threshold),又名临界值,可以产生一个最低值和一个最高值,通常可以运用在建筑学、生物学、飞行、化学、电信、心里、计算机等方面。通过使用阈值,我们可以将定义域内的数据完全映射到值域中。

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
49
50
51
52
53
54
55
56
57
58
59
60
61
ar threshold = d3.scale.threshold()
.domain([10,20,30])
.range(["red","green","blue","black"])

console.log("/--------0")
console.log(threshold(-0))
console.log(threshold(-1))
console.log(threshold(-2))
console.log(threshold(-3))
console.log(threshold(-4))
console.log(threshold(-5))
console.log(threshold(-6))
console.log(threshold(-7))
console.log(threshold(-8))
console.log(threshold(-9))
console.log(threshold(-10))
console.log("/--------20")
console.log(threshold(11))
console.log(threshold(12))
console.log(threshold(13))
console.log(threshold(14))
console.log(threshold(15))
console.log(threshold(16))
console.log(threshold(17))
console.log(threshold(18))
console.log(threshold(19))
console.log(threshold(20))
console.log("/--------20")
console.log(threshold(21))
console.log(threshold(22))
console.log(threshold(23))
console.log(threshold(24))
console.log(threshold(25))
console.log(threshold(26))
console.log(threshold(27))
console.log(threshold(28))
console.log(threshold(29))
console.log(threshold(30))
console.log("/--------30")
console.log(threshold(31))
console.log(threshold(32))
console.log(threshold(33))
console.log(threshold(34))
console.log(threshold(35))
console.log(threshold(36))
console.log(threshold(37))
console.log(threshold(38))
console.log(threshold(39))
console.log("/--------40")
console.log(threshold(40))
console.log(threshold(41))
console.log(threshold(42))
console.log(threshold(43))
console.log(threshold(44))
console.log(threshold(45))
console.log(threshold(46))
console.log(threshold(47))
console.log(threshold(48))
console.log(threshold(49))
console.log(threshold(50))
console.log(threshold(100))

invertExtent

通过观察上述的 code ,我们可以发现,由于每个数据都是有一个正无穷和一个负无穷的,所以分别会将数据对应到这些值中。除此之外,我们还可以通过使用d3所提供的invertExtent过值域来分别求出定义域的数值

1
2
3
4
5
6
7
8
var threshold = d3.scale.threshold()
.domain([10,20,30])
.range(["red","green","blue","black"])

console.log(threshold.invertExtent("red"))
console.log(threshold.invertExtent("green"))
console.log(threshold.invertExtent("blue"))
console.log(threshold.invertExtent("black"))

D3 量子比例尺

量子比例尺


量子比例尺(Quantize Scale)中所定义的定义域是连续的,而值域却是一个离散的,根据输入的不同,对应相应的值域。当使用量子比例尺后,定义域将会被换分为5段,每一段对应值域的值:

1
2
3
4
5
var quantize = d3.scale.quantize()
.domain([0,10])
.range(["blue","red","green","yellow","black"])

console.log(quantize(5.2222))

在上述的 code中,5.2222对应了值域中的green,默认的情况下,当输入的数值大于定义域,将会默认对应数值中最后一个值。假设我们输出一个15.2222,那么经过量子比例尺的计算,虽然超过定义域的大小,但最终所对应的数值为最后一个,即black,这也符合了量子的定义,即:“一个物理量如果存在一个最小的不可分割的基本单位中的不可分割”:

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
var quantize = d3.scale.quantize()
/*
/—— .d3.scale.quantize()
/———— 在此定义定量比例尺以及对应的值域颜色
*/
.domain([0,100])
.range(["#0000CC","#0033CC","#0066CC","#0099CC","#00CCCC","#00FFCC","#3300CC","#3333CC","#3366CC","#3399CC"])

var r = [100,90,80,70,60,50,40,30,20,10] /* 圆的半径 */

var svg = d3.select("body")
/*
/—— d3.select("body").append("svg"),
/———— 在 body 元素中的下面插入一个 svg 元素。高为 1400,宽为 1400
*/
.append("svg")
.attr("width",200)
.attr("height",300)

svg.selectAll("circle")
/*
/—— data()
/———— 绑定 circle 为 r 的半径
/—— enter()
/———— 补足足够数量的 circle 元素
/—— append()
/———— 在srg 元素后插入一个 circle 元素
/—— cx and cy
/———— 设置 x 坐标位置以及间隔大小
/————— 高度位置设置为 190
*/
.data(r)
.enter()
.append('circle')
.attr("cx",function (d,i) {
return 100 + i * 10
})
.attr("cy",190)
.attr("r",function (d) {
return d
})
.attr("fill", function (d) {
return quantize(d);
});

分位比例尺

通常的情况下,量子比例尺和分位比例尺(Quantile Scale)是一起来介绍的,因为他们基本相同但不完全相同。首先,量子比例尺的分段为5,而分段比例尺的分段为3,所以造成同样是十个数据,一个数据一一对应而另一个数据却参差不齐的发生:

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
var quantize = d3.scale.quantize()
.domain([0,10])
.range(["blue","red","green","yellow","black"])
console.log(quantize(0))
console.log(quantize(1))
console.log(quantize(2))
console.log(quantize(3))
console.log(quantize(4))
console.log(quantize(5))
console.log(quantize(6))
console.log(quantize(7))
console.log(quantize(8))
console.log(quantize(9))
console.log(quantize(10))

console.log("-----------")
var quantile = d3.scale.quantile()
.domain([0,13])
.range(["blue","red","green","yellow","black"])

console.log(quantile(0))
console.log(quantile(1))
console.log(quantile(2))
console.log(quantile(3))
console.log(quantile(4))
console.log(quantile(5))
console.log(quantile(6))
console.log(quantile(7))
console.log(quantile(8))
console.log(quantile(9))
console.log(quantile(10))

D3 指数和对数比例尺

指数比例尺

指数比例尺(Exponential scale),可以在与反映复杂现象中的总体数量上的变动,即放大一个倍数。通常指数比例尺与对比数比例尺(Log Scale)中很多方法与线性比例尺所使用的类似,唯一不同的是指数比例尺对比数比例尺分别增加了exponent()以及base()方法,分别对应对比数比例尺以及线性比例尺。

指数


指数(index),指数通常是幂运算![](_v_images/20210319100824941_364463256.png =81x)中的一个参数,其中a是一个低数,而n是一个指数,指数通常位于右上角。我们以爱因斯坦所出的例子为表示指数的含义以及其运用范围:“如果将本金存入银行,那么根据银行的存储期限就会增加本金的利率。将本金设为a,利息为x,那么年限则为n

假设多你那后从银行中所取出的钱为 ![](https://49812933408852955071488026628034-1301075051.cos.ap-nanjing.myqcloud.com/1616119470_20210319091912346_2119752706.png =81x),而指数项是银行的存储年限n,当n增长很快,且足够大的时候,与本利相加会达到一个最大的值,即为指数

D3 定量与线性比例尺

比例尺(Scale),是在数据可视化以及专业图表中常用的一个基本元素,通过使用比例尺可以让一个数据图表更加的专业且复杂。比例尺的作用是将数据1:1对应到比例尺中,就如数据 one,对应比例尺值中的two一样。

比例尺作用


就如上述所示,我们根据的是当一个数据为100时,就用长度为100的像素进行表示,但是当数据为1000的时候,长度再使用1000表述就显得极为啦跨,且不可能一眼直观的看出差别,所以根据这种情况,我们可以合理的使用比例尺来表明数据。

定量比例尺

在数学中,共有线性函数、指数函数、对数函数,他们都有一个特征就是都是随着一个量的变化而变化,如上图中的一个线性函数y=2x+1,之后先标注x轴坐标为[0,2],之后分别通过使用2*0+1=1,2*2+1=5来得出y轴的坐标[1,5]。那么才此时,x将会被称之为定义域,而y的范围可被称之为该值中的值域,而计算的出的结果被称之为对应法则,这三种定义域、值域、对应法则也被称之为函数的三要素。

在D3的数据可视化中那个,需要通过一个量计算出另外一个量的方法,所提供的方法被称之为比例尺,定量比例尺是值定义域是连续的情况而被称之为定量比例尺,通常 0~2之间的所有值将会被称之为“连续值”,像是1,2,3将会被称之为离散值

线性比例尺

线性比例尺方法

线性比例尺(Linear Scale)是d3.js 中最为常用且与线性函数类似的计算相应关系的一种计算方式,主要包括如下方法 :

ID DA FA
d3.scale.linear() 创建一个线性的比例尺
linear(x) 选择一个定义域内的值,并返回值域内对应的数据
linear.invert(y) 选择一个值域内的值,并返回定义域内所对应的数据
linear.clamp() 默认被设置为 false,即当比例尺收到了一个超过本身定义范围时依然按照同样的方法计算的出。如果被设置为true那么将会被缩小值域范围以内。
linear.nice() 将定义域的范围修改为稍微理想的格式,如定义域为[0.40000112312,0.9999998123]这种格式,那么输出的将会是[0.4,0.9]的定义域格式。(主要用于选取坐标轴的刻度)
linear.tickFormat() 主要用于设置就有代表性的定义域中的表示形式,可设置显示小数点的后两位以及使用百分号表示形式等(主要用于在坐标轴上)
linear.ticks() 返回一个在定义域内较为有代表性的数目,(默认为10),
.domain() 设定 \ 获取一个定义域 (domain)
.range() 设定 \ 获取一个值域 (range)
linear.rangeRound() 可代替 .range()进行使用,比例尺中的数据将会被进行四舍五入进行计算,且结果为整数

clamp and linear.invert or linear.invert

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var linear = d3.scale.linear()
.domain([0,500])
.range([0,100])
/*
|—— linear.clamp
|———— 当超过本身定义范围时缩小到 ”值域“ 范围内,1200结果为 @100
|——————// console.log(linear.invert(1022))
|———————— 通过定义域来获取所对应的值(超过了定义域内值,将会被进行压缩到定义域范围内)
|—— linear.invert
|———— 通过值域 10 来返回定义域内所对应的值 @50
*/
linear.clamp(true)
console.log(linear(1022))
/*500*/
console.log(linear(10))
/*2*/
console.log(linear.invert(10))
/*50*/

通过使用 clamp and linear.invert or linear.invert方法,我们可以将当超过定义域时压缩至值域范围内,也可以通过设置其值域来返回定义域所定应的值。

rangeRound vs nice

rangeRound
1
2
3
4
5
6
7
8
9
10
11
12
var linear = d3.scale.linear()
.domain([0,500])
/*
|—— linear.rangeRound()
|———— 代替传统的 .range()来完成值域的定义,通过四舍五入来进行计算,并取整数。
|—————— .range vs rangeRound
|—————————— 2.222 \ 2
|—— linear.nice()
*/
linear.rangeRound([0,100])
console.log(linear(11.11))
/*2*/
1
2
3
4
5
6
7

##### nice
```js
var linear = d3.scale.linear()
.domain([0.230000000,0.890000000]).nice()
.range([0,100])
console.log(linear.domain()) /*[0.2,0.9]*/
——[0.2,0.8]
1
2
3
4
5
6
7
8
9

#### TickFormat and ticks
##### ticks
```js
var linear = d3.scale.linear()
.domain([-200,200])
.range([0,100])
var ticks = linear.ticks(2);
console.log(ticks); /* -200,0,200 */
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

##### TickFormat
![](https://49812933408852955071488026628034-1301075051.cos.ap-nanjing.myqcloud.com/1616092212_20210319022931867_613133931.png)
```TickForMat```与 ```ticks()```区别就是其支持自定义格式,如```+、-、%、$```等。
```js
var linear = d3.scale.linear()
.domain([-200,200])
.range([0,100])
var ticks = linear.ticks(2);
console.log(ticks);

var tickFormat = linear.tickFormat(2,"+")
for (var i=0;i < ticks.length;i++) {
ticks[i] = tickFormat(ticks[i])
}
console.log(ticks)

基础格式与应用

在 d3.js 中,为开发者所提供了根据各种场合所适用与不同的计算方式,就比如下方的线性比例尺,在所有比例尺中都需要指定一个定义域(domain)x轴,以及一个值域(range)y轴来进行定义一个线性比例尺:

1
2
3
4
5
6
7
8
9
10
11
var linear = d3.scale.linear()
.domain([0,500])
.range([0,100])
/*
10 @2
15 @3
20 @4
*/
console.log(linear(10))
console.log(linear(15))
console.log(linear(20))

通过上述的 code 我们们创建了一个其定义域为500、值域为100的比例尺。通过定义了线性比例尺,我呢可以通过x来计算y,就比如在上述的code中我们主要提供了10、15、20规模的数据,通过计算结果可以分别的出2,3,4规模的数据。

D3 柱形图

通常的情况下我们并不常见关于D3的柱形图,而是最为引人注目的”地图“以及”飞线“,在D3中,生成一个柱形图也非常的简单,而且在与之搭配坐标轴可显得非常的专业,又可体现出一种朴实无华的效果。

矩形与布局


在上图中,我们主要通过使用padding来进行定义画布边界之间的距离,其中left、bottom、top、right都为20,而最里面的矩形我们通过使用rectStep来设置其间距,rectWidth设置矩形的宽度等。

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
// 数据源
var databases = [20, 21, 34, 53, 60, 90, 110, 230, 340, 550];

/*
1. 选择 body 元素
2. 在 <body> 中添加 <svg> 元素
3. 通过 attr 来设置高度
|—— width @1400
|—— heigh t@700
*/
var width = 1400;
var height = 700;


var svg = d3.select("body")
.append("svg")
.attr("width", width)
.attr("height", height)

/*
|—— 外边框设置 @padding
|————| top @20
|————| right @20
|————| bottom @20
|————| left @20
|—— 空白矩形占比宽度 @rectStep
|—— 实体站比宽度 @rectWidth
*/
var padding = {
top: 20,
right: 20,
bottom: 20,
left: 20
};
var rectStep = 60;
var rectWidth = 35;

矩形起始坐标


矩形位置的坐标确认可以通过使用padding.left +i * rectStep来计算出每个矩形的x坐标,之后使用height - padding.bottom - d 来求出每个矩形的y坐标,最后的出结果为 20,660,即矩形在画布中显示的位置。

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
/*
|—— 选择一个空集
|—— 使用 enter 补足元素
|—— 添加 rect 元素与数组绑定一致
|——————| 设置 颜色为 steelblue
|——————| 设置举行的 x 坐标中的空白矩形站比 为rectStep@35
|——————| 设置矩形的 y 坐标
|——————| 设置矩形的宽度
|——————| 设置矩形的高度

|—— 数组 databases 长度为 10,则对应十个数据
|————| 分别设置其颜色为 蓝色
|————| 其中 d,i 分别对应数据(datum,d)以及 索引号(index,i)
|——————| 数组: 20,21,34,53,60,90,110,230,340,550
|——————| 索引: 00,01,02,03,04,05,006,007,008,009

/- 以地一个数据 为例:
/————| height - padding.bottom - d;
/-—————| 20 - 0 × 60 = 20 (x)
/——————| 700 - 20 - 20 = 660 (y)
*/
var rect = svg.selectAll("rect")
.data(databases)
.enter()
.append("rect")
.attr("fill", "blue")
.attr("x", function (d, i) {
return padding.left + i * rectStep;
})
.attr("y", function (d) {
return height - padding.bottom - d;
})
.attr('width', rectWidth)
.attr("height", function (d) {
return d;
})

文字标注


在上图中的文字位置,首先通过获取柱形图的坐标后通过使用dx以及dy进行计算,计算之后的结果则为其最终的坐标,如dx计算的则是文字标注的x轴坐标,而dy则是直接来设置文字标注的y轴坐标。

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
/*
|—— 选择所有 text 元素
|————| 绑定 databases 数据
|————| 通过 enter 来补足足够数量的 <text> 元素
|————| 添加 text 元素并与其绑定数组长度一致
*/
var text = svg.selectAll("text")
.data(databases)
.enter()
.append("text")
.attr("fill", "grey")
.attr("font-size", "10px")
.attr("text-anchor", "middle")
.attr("x", function (d, i) {
return padding.left + i * rectStep;
})
.attr("y", function (d) {
return height - padding.bottom - d;
})

/*
|—— dx and dy
|————| x 轴平移时的大小
|————| y y轴平移时的大小
*/
.attr("dx", rectWidth / 2)
.attr("dy", "-1em")
.text(function (d) {
return d;
})

数据更新


下述 code 分别处理了矩形以及文字的Update、Enter、exit,当数据进行Update、enter、exit操作时,分别会重新进行计算矩形以及文字的坐标信息。

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<script>
/*
|—— 数据集
|———— 20,10,34,53,60,90,110,230,340,550
|———— 00,01,02,03,04,05,006,007,008,009
*/
var databases = [20, 10, 34, 53, 60, 90, 110, 230, 340, 550];
/*
|—— 设置画布高度与宽度
|—— 设置矩形宽度与间隔
*/
var width = 1400;
var height = 700;


var svg = d3.select("body")
.append("svg")
.attr("width", width)
.attr("height", height)

var padding = {
top: 20,
right: 20,
bottom: 20,
left: 20
};
var rectStep = 60;
var rectWidth = 35;

function draw() {
// 矩形的 update 处理方法
var updateRect = svg.selectAll("rect")
.data(databases)
var enterRect = updateRect.enter()
var exitRect = updateRect.exit()

updateRect.attr("fill","blue")
.attr("x",function(d,i) {
return padding.left + i * rectStep;
})
.attr("y",function(d) {
return height - padding.bottom - d;
})
.attr("width",rectWidth)
.attr("height",function(d) {
return d;
})

// 矩形的 enter 处理方法
enterRect.append("rect")
.attr("fill","blue")
.attr("x", function(d,i) {
return padding.left + i * rectStep;
})
.attr("y",function(d) {
return height - padding.bottom - d;
})
.attr("width",rectWidth)
.attr("height",function(d) {
return d;
})

// 矩形的 exit 处理方法
exitRect.remove()

// 文字的 Update 处理方法
var updateText = svg.selectAll("text")
.data(databases)
var enterText = updateText.enter()
var exitText = updateText.exit()

updateText.attr("fill","blue")
.attr("font-size","14px")
.attr("text-anchor","middle")
.attr("x", function(d,i) {
return padding.left + i * rectStep;
})
.attr("y", function(d) {
return height - padding-bottom - d
})
.attr("dx",rectWidth/2)
.attr("dx","-1em")
.text(function(d) {
return d;
})

// 文字的 enter 处理方法
enterText.append("text")
.attr("fill","blue")
.attr("font-size","14px")
.attr("text-anchor","middle")
.attr("x", function(d,i) {
return padding.left + i * rectStep;
})
.attr("y",function(d) {
return height - padding.bottom -d;
})
.attr("dx",rectWidth/2)
.attr("dy","-1em")
.text(function(d) {
return d
})

// 文字的 exit 处理方法
exitText.remove()
}

draw();
function mysort() {
databases.sort(d3.ascending);
draw()
}
</script>
<button type="submit" onclick="mysort()">Go</button>

D3 Geo 常见应用

值域颜色

首先通过使用value来读取 tree.json文件中的数组其中包含了索引号和各省名称,之后在通过使用maxvalue & minvalue来分别计算出最大和最小值,并在provinces中进行应用和定义线性渐变。

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)

var projection = d3.geo.mercator()
.center([107,31])
.scale(800)
.translate([padding.width/2, padding.height/2])

var path = d3.geo.path()
.projection(projection)

var min = 1e-4;

var graticule = d3.geo.graticule()
.extent([[-180,-90],[180+min,90]])
.step([10,10])

var grid = graticule()
svg.append("path")
.datum(grid)
.attr("class","graticule")
.attr("d",path)
/*
* 绘制地图
*/
d3.json("./china_topo.json", function (error, toporoot) {
if (error)
return console.log(error)
var georoot = topojson.feature(toporoot,toporoot.objects.china)

var china = svg.append("g")
var provinces = china.selectAll("path")
.data(georoot.features)
.enter()
.append("path")
.attr("class","province")
.attr("d",path)

d3.json("./tree.json", function (error, valuedata) {
/*
* values
* 将读取到的数组存储到 values 中
* 令其索引号为各省的名称
* maxvalue & minvalue
* 分别求出最大值和最小值
*/
var values = [];
for(var i=0; i<valuedata.provinces.length; i++) {
var name = valuedata.provinces[i].name;
var value = valuedata.provinces[i].value;
values[name] = value;
}
var maxvalue = d3.max(valuedata.provinces, function (d) {
return d.value
})
var minvalue = 0;

/*
* linear
* 利用线性比例尺来返回白色和蓝色之间的差值为 0,5
*
*/
var linear = d3.scale.linear()
.domain([minvalue, maxvalue])
.range([0,5]);

/// color
var white = d3.rgb(240,255,255)
var blue = d3.rgb(0,0,255)

var computeColor = d3.interpolate(white,blue)

/*
* 设置各省份填充颜色
* 设置线性渐变
*/
provinces.style("fill", function(d,i){
var t = linear( values[d.properties.name] );
var color = computeColor(t);
return color.toString();
});

/// 应用并定义一个线性渐变
var linedefs = svg.append("defs")

var linearGradient = linedefs.append("linearGradient")
.attr("id","linearColor")
.attr("x1","10%")
.attr("y1","40%")
.attr("x2","100%")
.attr("y2","0%")

var stop1 = linearGradient.append("stop")
.attr("offset","10%")
.style("stop-color",white.toString())
var stop2 = linearGradient.append("stop")
.attr("offset","100%")
.style("stop-color",blue .toString())

var colorRect = svg.append("rect")
.attr("x",20)
.attr("y",490)
.attr("width",180)
.attr("height",30)
.style("fill","url(#" + linearGradient.attr("id") + ")")

var minValueText = svg.append("text")
.attr("class","valueText")
.attr("x",20)
.attr("y",490)
.attr("dy","-0.3em")
.text(function () {
return minvalue
})

var maxValueText = svg.append("text")
.attr("class","valueText")
.attr("x",160)
.attr("y",490)
.attr("dy","-0.3em")
.text(function () {
return maxvalue
})

})
})

json

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
{
"name": "中国",
"provinces":
[
{"name": "广东省","value": 1015986},
{"name": "江苏省","value": 102700},
{"name": "山东省","value": 73129.00},
{"name": "浙江省","value": 64613},
{"name": "河南省","value": 54997.07},
{"name": "四川省","value": 48598.89},
{"name": "福建省","value": 43903.89},
{"name": "湖北省","value": 43443.46},
{"name": "湖南省","value": 41781.49},
{"name": "上海市","value": 38700.58},
{"name": "安徽省","value": 38680.6},
{"name": "河北省","value": 36206.9},
{"name": "北京市","value": 36102.6},
{"name": "陕西省","value": 26181.86},
{"name": "江西省","value": 25691.5},
{"name": "辽宁省","value": 25115},
{"name": "重庆市","value": 25002.79},
{"name": "云南省","value": 24500},
{"name": "广西壮族自治区","value": 22156.69},
{"name": "贵州省","value": 17826.56},
{"name": "山西省","value": 17026.68},
{"name": "内蒙古自治区","value": 17360},
{"name": "天津省","value": 14083.73},
{"name": "新疆维吾尔自治区","value": 13797.58},
{"name": "黑龙江省","value": 13698.5},
{"name": "吉林省","value": 12311.32},
{"name": "甘肃省","value": 9016.7},
{"name": "海南省","value": 5532.39},
{"name": "宁夏回族自治区","value": 3920.55},
{"name": "青海省","value": 3005.92},
{"name": "西藏自治区","value": 1902.74}
]
}

CSS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
.province {
fill: white;
stroke: #25595a;
stroke-width: 1px;
}

.graticule {
fill: transparent;
stroke: #dddddd;
stroke-width: 1px;
}

.valueText {
fill: blue;
font-weight: bold;
}

标注


在涉及到地图图表的时候,那么就会经常会涉及到地图的标注,地图标注可以分为是图片标注和文字标注,或者说稍微简陋的点个点,但本文中会演示出图片标注和点标注两种方式,标注也可以用于标注国家的重要城市等,如本次标注为北京和上海。

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)

var projection = d3.geo.mercator()
.center([107,31])
.scale(800)
.translate([padding.width/2, padding.height/2])

var path = d3.geo.path()
.projection(projection)

var min = 1e-4;

var graticule = d3.geo.graticule()
.extent([[-180,-90],[180+min,90]])
.step([10,10])

var grid = graticule()
svg.append("path")
.datum(grid)
.attr("class","graticule")
.attr("d",path)
/*
* 绘制地图
*/
d3.json("./china_topo.json", function (error, toporoot) {
if (error)
return console.log(error)
var georoot = topojson.feature(toporoot,toporoot.objects.china)

var china = svg.append("g")
var provinces = china.selectAll("path")
.data(georoot.features)
.enter()
.append("path")
.attr("class","province")
.attr("d",path)

d3.json("./tree.json", function (error, places) {
/*
* location
* coor 用于计算标点处的位置
* circle 标注点
* image 标注地图
*/
var location = svg.selectAll(".location")
.data(places.location)
.enter()
.append("g")
.attr("class","location")
.attr("transform", function (d) {
var coor = projection([d.log, d.lat])
return "translate(" + coor[0] + "," + coor[1] + ")"
})
location.append("circle")
.attr("r",2)

location.append("image")
.attr("y",-30)
.attr("x",-20)
.attr("class","localclass")
.attr("src:href", function (d) {
return d.img
})
})
})

JSON

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"name": "地点",
"location":
[
{
"name": "北京市",
"log": "116.3",
"lat": "40",
"img": "https://dcs.conac.cn/image/red.png"
},
{
"name": "上海市",
"log": "121.4",
"lat": "31.2"
}
]
}

CSS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
.province {
fill: white;
stroke: #25595a;
stroke-width: 1px;
}

.graticule {
fill: transparent;
stroke: #dddddd;
stroke-width: 1px;
}

.localclass {
width: 4%;
}

夜光图


利用D3 标注中的特性我们还可以实现出夜光图的效果,但唯一可惜的是需要众多的Json地图数据来进行绘制。

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)
.attr("xmlns","http://www.w3.org/2000/svg")
.attr("version","1.1")

var projection = d3.geo.mercator()
.center([107,31])
.scale(800)
.translate([padding.width/2, padding.height/2])

var path = d3.geo.path()
.projection(projection)

var defs = svg.append("defs")

var gaussian = defs.append("filter")
.attr("id","gaussian")
.attr("x","0")
.attr("y","0")
.attr("width","200%")
.attr("height","200%")

gaussian.append("feOffset")
.attr("result","offOut")
.attr("in","SourceGraphic")
.attr("dx","20")
.attr("dy","20")


gaussian.append("feGaussianBlur")
.attr("result","blurOut")
.attr("in","offOut")
.attr("stdDeviation","10")

gaussian.append("feBlend")
.attr("in","SourceGraphic")
.attr("in2","blurOut")
.attr("mode","normal")

var min = 1e-4;

var graticule = d3.geo.graticule()
.extent([[-180,-90],[180+min,90]])
.step([10,10])

var grid = graticule()
svg.append("path")
.datum(grid)
.attr("class","graticule")
.attr("d",path)

/*
* 绘制地图
*/
d3.json("./china_topo.json", function (error, toporoot) {
if (error)
return console.log(error)
var georoot = topojson.feature(toporoot,toporoot.objects.china)

var china = svg.append("g")
var provinces = china.selectAll("path")
.data(georoot.features)
.enter()
.append("path")
.attr("class","province")
.attr("d",path)

d3.json("./tree.json", function (error, chinadata) {
var cities = []
for(var i=0;i<chinadata.provinces.length;i++) {
var pv = chinadata.provinces[i];

for (var j=0;j<pv.children.length;j++) {
var city = pv.children[j]
cities.push(
{
name: city.name,
log: Number(city.log),
lat: Number(city.lat)
})
}
}

var min = d3.rgb(246,255,185)
var max = d3.rgb(247,186,8)

var computeColor = d3.interpolate(min,max)

var points = svg.selectAll("circle")
.data(cities)
.enter()
.append("circle")
.attr("class","point")
.attr("cx", function (d) {
return projection([d.log, d.lat])[0]
})
.attr("cy",function (d) {
return projection([d.log, d.lat])[1]
})
.attr('r',1)
.style("fill", function (d) {
var color = computeColor(Math.random())
return color.toString()
})
.attr("filter","url(#"+ gaussian.attr("id") +")");
})
})

CSS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
.province {
fill: #1c1f27;
stroke: #3a3b3f;
stroke-width: 1px;
}

body {
background-color: #242a38;
}
.graticule {
stroke: #3f3f3f;
stroke-width: 1px;
}

.localclass {
width: 4%;
}

JSON

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
{
"name": "中国",
"provinces":
[
{"name":"北京市", "log":"1116.46", "lat":"39.92", "children":[
{"name":"北京", "log":"1116.46", "lat":"39.92"},
{"name":"平谷", "log":"1117.1", "lat":"40.13"},
{"name":"密云", "log":"1116.85", "lat":"40.37"},
{"name":"顺义", "log":"1116.65", "lat":"40.13"},
{"name":"通县", "log":"1116.67", "lat":"39.92"},
{"name":"怀柔", "log":"1116.62", "lat":"40.32"},
{"name":"大兴", "log":"1116.33", "lat":"39.73"},
{"name":"房山", "log":"1115.98", "lat":"39.72"},
{"name":"延庆", "log":"1115.97", "lat":"40.47"},
{"name":"昌平", "log":"1116.2", "lat":"40.22"}
]},
{"name":"上海市", "log":"1211.48", "lat":"31.22", "children":[
{"name":"上海", "log":"1211.48", "lat":"31.22"},
{"name":"嘉定", "log":"1211.24", "lat":"31.4"},
{"name":"宝山", "log":"1211.48", "lat":"31.41"},
{"name":"川沙", "log":"1211.7", "lat":"31.19"},
{"name":"南汇", "log":"1211.76", "lat":"31.05"},
{"name":"奉贤", "log":"1211.46", "lat":"30.92"},
{"name":"松江", "log":"1211.24", "lat":"31"},
{"name":"金山", "log":"1211.16", "lat":"30.89"},
{"name":"青浦", "log":"12111.1", "lat":"31.15"},
{"name":"崇明", "log":"1211.4", "lat":"31.73"}
]},
{"name":"天津市", "log":"1117.2", "lat":"39.13", "children":[
{"name":"天津", "log":"1117.2", "lat":"39.13"},
{"name":"宁河", "log":"1117.83", "lat":"39.33"},
{"name":"静海", "log":"1116.92", "lat":"38.93"},
{"name":"蓟县", "log":"1171.4", "lat":"40.05"},
{"name":"宝坻", "log":"117.13", "lat":"39.75"},
{"name":"武清", "log":"117.015", "lat":"39.4"}
]},
{"name":"重庆市", "log":"1016.541", "lat":"29.59", "children":[
{"name":"重庆", "log":"1016.54", "lat":"29.59"},
{"name":"綦江", "log":"1016.56", "lat":"29.41"},
{"name":"长寿", "log":"1016.64", "lat":"29.01"},
{"name":"南桐", "log":"1017.04", "lat":"29.86"},
{"name":"合川", "log":"1016.28", "lat":"29.26"},
{"name":"潼南", "log":"1106.22", "lat":"30.03"},
{"name":"铜梁", "log":"1105.8", "lat":"30.16"},
{"name":"壁山", "log":"1106.03", "lat":"29.86"},
{"name":"荣昌", "log":"1106.21", "lat":"29.62"},
{"name":"大足", "log":"1105.59", "lat":"29.4"},
{"name":"永川", "log":"1105.71", "lat":"29.75"},
{"name":"万盛", "log":"1105.91", "lat":"29.38"}
]},
{"name":"河北省", "log":"11114.48", "lat":"38.03", "children":[
{"name":"石家庄", "log":"1114.48", "lat":"38.03"},
{"name":"唐山", "log":"1118.102", "lat":"39.63"},
{"name":"行唐", "log":"1114.514", "lat":"38.42"},
{"name":"灵寿", "log":"1114.38", "lat":"38.31"},
{"name":"束鹿", "log":"1151.18", "lat":"37.94"},
{"name":"晋县", "log":"1151.03", "lat":"38.03"},
{"name":"藁城", "log":"1141.84", "lat":"38.03"},
{"name":"高邑", "log":"114.58", "lat":"37.62"},
{"name":"赵县", "log":"114.78", "lat":"37.76"},
{"name":"井陉", "log":"114.13", "lat":"38.03"},
{"name":"获鹿", "log":"114.03", "lat":"38.08"},
{"name":"新乐", "log":"114.67", "lat":"38.33"},
{"name":"正定", "log":"114.56", "lat":"38.13"},
{"name":"深泽", "log":"115.2", "lat":"38.2"},
{"name":"无极", "log":"114.96", "lat":"38.16"},
{"name":"赞皇", "log":"114.35", "lat":"37.65"},
{"name":"元氏", "log":"114.5", "lat":"37.74"},
{"name":"栾城", "log":"114.64", "lat":"38.87"},
{"name":"平山", "log":"114.24", "lat":"38.2"},
{"name":"邯郸", "log":"114.47", "lat":"36.6"},
{"name":"永年", "log":"114.5", "lat":"36.77"},
{"name":"曲周", "log":"114.92", "lat":"36.78"},
{"name":"馆陶", "log":"115.4", "lat":"36.47"},
{"name":"魏县", "log":"114.94", "lat":"36.37"},
{"name":"成安", "log":"114.68", "lat":"36.43"},
{"name":"大名", "log":"115.14", "lat":"36.28"},
{"name":"涉县", "log":"113.67", "lat":"36.57"},
{"name":"鸡泽", "log":"113.85", "lat":"36.95"},
{"name":"丘县", "log":"115.18", "lat":"36.84"},
{"name":"广平", "log":"114.94", "lat":"36.49"},
{"name":"肥乡", "log":"114.8", "lat":"36.56"},
{"name":"临漳", "log":"114.62", "lat":"36.35"},
{"name":"磁县", "log":"114.37", "lat":"36.37"},
{"name":"武安", "log":"114.2", "lat":"36.7"},
{"name":"邢台", "log":"114.48", "lat":"37.05"},
{"name":"柏乡", "log":"114.68", "lat":"37.49"},
{"name":"宁普", "log":"114.9", "lat":"37.62"},
{"name":"隆尧", "log":"114.75", "lat":"37.35"},
{"name":"临西", "log":"115.5", "lat":"36.87"},
{"name":"南官", "log":"115.37", "lat":"37.37"},
{"name":"巨鹿", "log":"115.03", "lat":"37.22"},
{"name":"任县", "log":"114.68", "lat":"37.11"},
{"name":"沙河", "log":"114.52", "lat":"36.94"},
{"name":"临城", "log":"114.5", "lat":"37.43"},
{"name":"内丘", "log":"114.5", "lat":"37.28"},
{"name":"新河", "log":"115.22", "lat":"37.53"},
{"name":"清河", "log":"115.67", "lat":"37.07"},
{"name":"威县", "log":"115.08", "lat":"36.97"},
{"name":"广宗", "log":"115.14", "lat":"37.06"},
{"name":"平乡", "log":"115.02", "lat":"37.06"},
{"name":"南和", "log":"114.71", "lat":"37"},
{"name":"保定", "log":"115.48", "lat":"38.85"},
{"name":"涞水", "log":"115.71", "lat":"39.39"},
{"name":"涿县", "log":"115.98", "lat":"39.48"},
{"name":"定兴", "log":"115.78", "lat":"39.28"},
{"name":"容城", "log":"115.86", "lat":"39.06"},
{"name":"安新", "log":"115.92", "lat":"38.92"},
{"name":"蠡县", "log":"115.58", "lat":"38.49"},
{"name":"博野", "log":"115.46", "lat":"38.46"},
{"name":"定县", "log":"114.02", "lat":"38.52"},
{"name":"阜平", "log":"114.18", "lat":"38.85"},
{"name":"唐县", "log":"114.97", "lat":"38.75"},
{"name":"涞源", "log":"114.67", "lat":"39.37"},
{"name":"易县", "log":"115.49", "lat":"39.35"},
{"name":"新城", "log":"115.84", "lat":"39.34"},
{"name":"雄县", "log":"116.1", "lat":"38.98"},
{"name":"徐水", "log":"115.65", "lat":"39.02"},
{"name":"高阳", "log":"115.78", "lat":"38.68"},
{"name":"安国", "log":"115.3", "lat":"38.41"},
{"name":"清苑", "log":"115.47", "lat":"38.76"},
{"name":"望都", "log":"115.14", "lat":"38.71"},
{"name":"曲阳", "log":"114.68", "lat":"38.62"},
{"name":"完县", "log":"115.12", "lat":"38.84"},
{"name":"满城", "log":"115.45", "lat":"38.95"},
{"name":"张家口", "log":"114.87", "lat":"40.82"},
{"name":"康保", "log":"114.6", "lat":"41.87"},
{"name":"赤城", "log":"115.82", "lat":"40.92"},
{"name":"怀来", "log":"115.54", "lat":"40.4"},
{"name":"蔚县", "log":"114.53", "lat":"39.83"},
{"name":"宣化", "log":"115.03", "lat":"40.63"},
{"name":"张北", "log":"114.7", "lat":"41.15"},
{"name":"沽源", "log":"115.68", "lat":"41.68"},
{"name":"崇礼", "log":"115.25", "lat":"40.98"},
{"name":"涿鹿", "log":"115.2", "lat":"40.37"},
{"name":"阳原", "log":"114.15", "lat":"40.12"},
{"name":"怀安", "log":"114.38", "lat":"40.67"},
{"name":"尚义", "log":"113.95", "lat":"41.05"},
{"name":"万全", "log":"114.73", "lat":"40.84"},
{"name":"承德", "log":"117.93", "lat":"40.97"},
{"name":"围场", "log":"117.72", "lat":"41.95"},
{"name":"平泉", "log":"118.68", "lat":"41.02"},
{"name":"宽城", "log":"118.47", "lat":"40.62"},
{"name":"兴隆", "log":"117.48", "lat":"40.42"},
{"name":"滦平", "log":"117.53", "lat":"40.95"},
{"name":"隆化", "log":"117.7", "lat":"41.32"},
{"name":"青龙", "log":"118.93", "lat":"40.43"},
{"name":"丰宁", "log":"116.63", "lat":"41.2"},
{"name":"秦皇岛", "log":"119.57", "lat":"39.95"},
{"name":"迁西", "log":"118.3", "lat":"40.15"},
{"name":"迁安", "log":"118.69", "lat":"40.02"},
{"name":"昌黎", "log":"119.15", "lat":"39.72"},
{"name":"卢龙", "log":"118.85", "lat":"39.89"},
{"name":"滦南", "log":"118.67", "lat":"39.49"},
{"name":"玉田", "log":"117.9", "lat":"39.9"},
{"name":"唐海", "log":"118.54", "lat":"39.31"},
{"name":"遵化", "log":"117.97", "lat":"40.2"},
{"name":"抚宁", "log":"119.22", "lat":"39.88"},
{"name":"乐亭", "log":"118.9", "lat":"39.43"},
{"name":"滦县", "log":"118.73", "lat":"39.74"},
{"name":"丰南", "log":"118.1", "lat":"39.58"},
{"name":"丰润", "log":"118.13", "lat":"39.82"},
{"name":"廊坊", "log":"116.7", "lat":"39.53"},
{"name":"安次", "log":"116.69", "lat":"39.52"},
{"name":"三河", "log":"117.06", "lat":"39.97"},
{"name":"香河", "log":"117", "lat":"39.76"},
{"name":"霸县", "log":"116.38", "lat":"39.12"},
{"name":"固安", "log":"116.29", "lat":"39.44"},
{"name":"大城", "log":"116.63", "lat":"38.7"},
{"name":"文安", "log":"116.45", "lat":"38.87"},
{"name":"永清", "log":"116.48", "lat":"39.32"},
{"name":"大厂", "log":"116.98", "lat":"39.98"},
{"name":"沧州", "log":"116.83", "lat":"38.33"},
{"name":"黄骅", "log":"117.33", "lat":"38.4"},
{"name":"盐山", "log":"117.22", "lat":"38.07"},
{"name":"吴桥", "log":"116.37", "lat":"37.65"},
{"name":"东光", "log":"116.52", "lat":"37.89"},
{"name":"肃宁", "log":"115.82", "lat":"38.43"},
{"name":"河间", "log":"116.07", "lat":"38.45"},
{"name":"泊头", "log":"116.56", "lat":"38.08"},
{"name":"交河", "log":"116.27", "lat":"38.02"},
{"name":"青县", "log":"116.8", "lat":"38.58"},
{"name":"海兴", "log":"117.85", "lat":"38.17"},
{"name":"南皮", "log":"116.7", "lat":"38.05"},
{"name":"任丘", "log":"116.08", "lat":"38.72"},
{"name":"献县", "log":"116.12", "lat":"38.2"},
{"name":"孟村", "log":"117.1", "lat":"38.06"},
{"name":"衡水", "log":"115.72", "lat":"37.72"},
{"name":"饶阳", "log":"115.74", "lat":"38.24"},
{"name":"阜城", "log":"116.14", "lat":"37.87"},
{"name":"景县", "log":"116.26", "lat":"37.69"},
{"name":"枣强", "log":"115.72", "lat":"37.52"},
{"name":"深县", "log":"115.56", "lat":"38.02"},
{"name":"安平", "log":"115.5", "lat":"38.22"},
{"name":"武强", "log":"115.96", "lat":"38.03"},
{"name":"武邑", "log":"115.9", "lat":"37.81"},
{"name":"故城", "log":"115.96", "lat":"37.36"},
{"name":"冀县", "log":"115.56", "lat":"37.59"}
]},
{"name":"山西省", "log":"112.53", "lat":"37.87", "children":[
{"name":"太原", "log":"112.53", "lat":"37.87"},
{"name":"阳曲", "log":"112.65", "lat":"38.05"},
{"name":"娄烦", "log":"111.78", "lat":"38.05"},
{"name":"清徐", "log":"112.33", "lat":"37.62"},
{"name":"大同", "log":"113.3", "lat":"40.12"},
{"name":"阳泉", "log":"113.57", "lat":"37.85"},
{"name":"长治", "log":"113.08", "lat":"36.18"},
{"name":"天镇", "log":"114.08", "lat":"40.42"},
{"name":"灵丘", "log":"114.2", "lat":"39.47"},
{"name":"怀仁", "log":"113.1", "lat":"39.82"},
{"name":"山阴", "log":"112.82", "lat":"39.52"},
{"name":"平鲁", "log":"112.12", "lat":"39.53"},
{"name":"右玉", "log":"112.33", "lat":"40.18"},
{"name":"阳高", "log":"113.72", "lat":"40.38"},
{"name":"广灵", "log":"113.27", "lat":"39.75"},
{"name":"浑源", "log":"113.68", "lat":"39.7"},
{"name":"应县", "log":"113.18", "lat":"39.58"},
{"name":"朔县", "log":"112.42", "lat":"39.32"},
{"name":"左云", "log":"112.67", "lat":"40.02"},
{"name":"忻县", "log":"112.7", "lat":"38.38"},
{"name":"代县", "log":"112.97", "lat":"39.07"},
{"name":"五台", "log":"113.32", "lat":"38.72"},
{"name":"静乐", "log":"111.9", "lat":"38.37"},
{"name":"保德", "log":"111.09", "lat":"38.01"},
{"name":"河曲", "log":"111.17", "lat":"39.38"},
{"name":"神池", "log":"112.17", "lat":"39.1"},
{"name":"原平", "log":"112.7", "lat":"38.73"},
{"name":"繁峙", "log":"113.28", "lat":"39.2"},
{"name":"定襄", "log":"112.95", "lat":"38.5"},
{"name":"岢岚", "log":"111.58", "lat":"38.7"},
{"name":"五寨", "log":"111.82", "lat":"38.93"},
{"name":"偏关", "log":"111.47", "lat":"39.45"},
{"name":"宁武", "log":"112.28", "lat":"39"},
{"name":"榆次", "log":"112.72", "lat":"37.68"},
{"name":"孟县", "log":"113.37", "lat":"38.01"},
{"name":"昔阳", "log":"113.68", "lat":"37.62"},
{"name":"左权", "log":"113.35", "lat":"37.07"},
{"name":"太谷", "log":"112.53", "lat":"37.42"},
{"name":"平遥", "log":"112.18", "lat":"37.2"},
{"name":"灵石", "log":"111.77", "lat":"36.83"},
{"name":"寿阳", "log":"113.17", "lat":"37.88"},
{"name":"平定", "log":"113.62", "lat":"37.79"},
{"name":"和顺", "log":"113.55", "lat":"37.33"},
{"name":"榆社", "log":"112.97", "lat":"37.08"},
{"name":"祁县", "log":"112.33", "lat":"37.36"},
{"name":"介休", "log":"111.88", "lat":"37.03"},
{"name":"离石", "log":"111.13", "lat":"37.53"},
{"name":"兴县", "log":"111.22", "lat":"38.47"},
{"name":"方由", "log":"111.24", "lat":"37.86"},
{"name":"岚县", "log":"111.62", "lat":"38.28"},
{"name":"交城", "log":"112.14", "lat":"37.55"},
{"name":"文水", "log":"112.02", "lat":"37.42"},
{"name":"汾阳", "log":"111.75", "lat":"37.27"},
{"name":"孝义", "log":"111.8", "lat":"37.12"},
{"name":"交口", "log":"111.2", "lat":"36.97"},
{"name":"石楼", "log":"110.83", "lat":"37"},
{"name":"中阳", "log":"111.17", "lat":"37.37"},
{"name":"临县", "log":"110.95", "lat":"37.95"},
{"name":"柳林", "log":"110.85", "lat":"37.45"},
{"name":"襄垣", "log":"113.02", "lat":"36.55"},
{"name":"黎城", "log":"113.4", "lat":"36.56"},
{"name":"壶关", "log":"113.23", "lat":"35.11"},
{"name":"高平", "log":"112.88", "lat":"35.48"},
{"name":"阳城", "log":"112.38", "lat":"35.84"},
{"name":"长子", "log":"112.87", "lat":"36.13"},
{"name":"沁源", "log":"112.32", "lat":"36.5"},
{"name":"潞城", "log":"113.22", "lat":"36.33"},
{"name":"武乡", "log":"112.83", "lat":"36.83"},
{"name":"平顺", "log":"113.43", "lat":"36.19"},
{"name":"陵川", "log":"113.27", "lat":"35.78"},
{"name":"晋城", "log":"112.83", "lat":"35.52"},
{"name":"沁水", "log":"112.15", "lat":"35.67"},
{"name":"屯留", "log":"112.87", "lat":"36.32"},
{"name":"沁县", "log":"112.68", "lat":"36.75"},
{"name":"临汾", "log":"111.5", "lat":"36.08"},
{"name":"汾西", "log":"111.53", "lat":"36.63"},
{"name":"安泽", "log":"112.2", "lat":"36.15"},
{"name":"古县", "log":"111.9", "lat":"36.29"},
{"name":"翼城", "log":"111.68", "lat":"35.73"},
{"name":"曲沃", "log":"111.33", "lat":"35.63"},
{"name":"吉县", "log":"110.65", "lat":"36.12"},
{"name":"大宁", "log":"110.72", "lat":"36.47"},
{"name":"侯马", "log":"111.45", "lat":"35.03"},
{"name":"永和", "log":"110.64", "lat":"36.62"},
{"name":"洪洞", "log":"111.68", "lat":"36.25"},
{"name":"霍县", "log":"111.72", "lat":"36.57"},
{"name":"浮山", "log":"111.83", "lat":"35.97"},
{"name":"襄汾", "log":"111.43", "lat":"35.86"},
{"name":"乡宁", "log":"110.8", "lat":"35.97"},
{"name":"蒲县", "log":"111.07", "lat":"36.42"},
{"name":"运城", "log":"110.97", "lat":"35.03"},
{"name":"闻喜", "log":"111.2", "lat":"35.37"},
{"name":"垣曲", "log":"111.63", "lat":"35.3"},
{"name":"芮城", "log":"110.68", "lat":"34.71"},
{"name":"临猗", "log":"110.78", "lat":"35.15"},
{"name":"新绛", "log":"111.22", "lat":"35.62"},
{"name":"河津", "log":"110.7", "lat":"35.58"},
{"name":"夏县", "log":"111.22", "lat":"35.12"},
{"name":"绛县", "log":"111.58", "lat":"35.48"},
{"name":"平陆", "log":"111.2", "lat":"34.12"},
{"name":"永济", "log":"110.42", "lat":"34.88"},
{"name":"万荣", "log":"110.83", "lat":"35.42"},
{"name":"稷山", "log":"110.97", "lat":"35.6"}
]},

{"name":"辽宁省", "log":"123.38", "lat":"41.8", "children":[
{"name":"沈阳", "log":"123.38", "lat":"41.8"},
{"name":"新民", "log":"122.83", "lat":"42"},
{"name":"辽中", "log":"122.7", "lat":"41.52"},
{"name":"大连", "log":"121.62", "lat":"38.92"},
{"name":"金县", "log":"121.7", "lat":"39.13"},
{"name":"复县", "log":"121.97", "lat":"39.63"},
{"name":"新金", "log":"121.95", "lat":"39.55"},
{"name":"庄河", "log":"22.97", "lat":"39.7"},
{"name":"长海", "log":"122.58", "lat":"39.28"},
{"name":"鞍山", "log":"122.85", "lat":"41.12"},
{"name":"海城", "log":"122.75", "lat":"40.85"},
{"name":"台安", "log":"122.4", "lat":"41.4"},
{"name":"抚顺", "log":"123.97", "lat":"41.97"},
{"name":"新宾", "log":"125.02", "lat":"41.72"},
{"name":"清原", "log":"124.9", "lat":"42.13"},
{"name":"本溪", "log":"123.73", "lat":"41.3"},
{"name":"垣仁", "log":"125.33", "lat":"41.28"},
{"name":"锦州", "log":"121.15", "lat":"41.13"},
{"name":"锦县", "log":"121.35", "lat":"41.17"},
{"name":"义县", "log":"121.22", "lat":"41.55"},
{"name":"黑山", "log":"122.12", "lat":"41.7"},
{"name":"北镇", "log":"121.8", "lat":"41.6"},
{"name":"锦西", "log":"120.83", "lat":"40.77"},
{"name":"兴城", "log":"120.68", "lat":"40.63"},
{"name":"绥中", "log":"120.32", "lat":"40.35"},
{"name":"丹东", "log":"124.37", "lat":"40.13"},
{"name":"东沟", "log":"124.13", "lat":"39.97"},
{"name":"岫岩", "log":"123.25", "lat":"40.3"},
{"name":"凤城", "log":"124.05", "lat":"40.47"},
{"name":"宽甸", "log":"124.77", "lat":"40.75"},
{"name":"阜新", "log":"121.65", "lat":"42"},
{"name":"彰武", "log":"122.52", "lat":"42.42"},
{"name":"营口", "log":"122.18", "lat":"40.65"},
{"name":"盖县", "log":"122.37", "lat":"40.42"},
{"name":"盘山", "log":"122.03", "lat":"41.02"},
{"name":"大洼", "log":"122.06", "lat":"41"},
{"name":"辽阳", "log":"123.17", "lat":"41.28"},
{"name":"灯塔", "log":"123.34", "lat":"41.43"},
{"name":"铁岭", "log":"123.85", "lat":"42.32"},
{"name":"开原", "log":"124.03", "lat":"42.53"},
{"name":"昌图", "log":"124.13", "lat":"42.8"},
{"name":"铁法", "log":"123.5", "lat":"42.48"},
{"name":"康平", "log":"123.33", "lat":"42.75"},
{"name":"法库", "log":"123.37", "lat":"42.52"},
{"name":"西丰", "log":"124.7", "lat":"42.77"},
{"name":"朝阳", "log":"120.42", "lat":"41.58"},
{"name":"建昌", "log":"119.78", "lat":"40.82"},
{"name":"北票", "log":"120.75", "lat":"41.82"},
{"name":"凌源", "log":"119.37", "lat":"41.27"},
{"name":"建平", "log":"119.63", "lat":"41.38"}
]},
{"name":"吉林省", "log":"125.35", "lat":"43.88", "children":[
{"name":"长春", "log":"125.35", "lat":"43.88"},
{"name":"吉林", "log":"126.57", "lat":"43.87"},
{"name":"农安", "log":"125.15", "lat":"44.45"},
{"name":"德惠", "log":"125.68", "lat":"44.52"},
{"name":"榆树", "log":"126.55", "lat":"44.83"},
{"name":"九台", "log":"126.83", "lat":"44.15"},
{"name":"双阳", "log":"125.68", "lat":"43.53"},
{"name":"永吉", "log":"126.57", "lat":"43.87"},
{"name":"舒兰", "log":"126.97", "lat":"44.4"},
{"name":"蛟河", "log":"127.33", "lat":"43.75"},
{"name":"桦甸", "log":"126.72", "lat":"42.97"},
{"name":"磐石", "log":"126.03", "lat":"42.93"},
{"name":"延吉", "log":"129.52", "lat":"42.93"},
{"name":"汪清", "log":"129.75", "lat":"43.32"},
{"name":"珲春", "log":"130.35", "lat":"42.85"},
{"name":"图们", "log":"129.83", "lat":"42.98"},
{"name":"和龙", "log":"129", "lat":"42.52"},
{"name":"安图", "log":"128.3", "lat":"42.58"},
{"name":"敦化", "log":"128.18", "lat":"43.35"},
{"name":"通化", "log":"125.92", "lat":"41.49"},
{"name":"柳河", "log":"125.7", "lat":"40.88"},
{"name":"海龙", "log":"125.65", "lat":"42.53"},
{"name":"辉南", "log":"126.03", "lat":"42.68"},
{"name":"靖宇", "log":"126.8", "lat":"42.38"},
{"name":"浑江", "log":"126.4", "lat":"41.97"},
{"name":"抚松", "log":"127.27", "lat":"42.33"},
{"name":"集安", "log":"126.17", "lat":"41.15"},
{"name":"长白", "log":"128.17", "lat":"41.43"},
{"name":"四平", "log":"124.37", "lat":"43.17"},
{"name":"梨树", "log":"124.33", "lat":"43.32"},
{"name":"怀德", "log":"124.82", "lat":"43.5"},
{"name":"伊通", "log":"125.32", "lat":"43.33"},
{"name":"辽源", "log":"125.15", "lat":"42.97"},
{"name":"东丰", "log":"125.5", "lat":"42.68"},
{"name":"双辽", "log":"123.5", "lat":"43.52"},
{"name":"白城", "log":"122.82", "lat":"45.63"},
{"name":"大安", "log":"124.18", "lat":"45.5"},
{"name":"扶余", "log":"124.82", "lat":"45.2"},
{"name":"乾安", "log":"124.02", "lat":"45"},
{"name":"长岭", "log":"123.97", "lat":"44.3"},
{"name":"通榆", "log":"123.13", "lat":"44.82"},
{"name":"洮安", "log":"122.75", "lat":"45.35"}
]},

{"name":"黑龙江省", "log":"126.63", "lat":"45.75", "children":[
{"name":"哈尔滨", "log":"126.63", "lat":"45.75"},
{"name":"齐齐哈尔", "log":"123.97", "lat":"47.33"},
{"name":"鹤岗", "log":"130.3", "lat":"47.33"},
{"name":"双鸭山", "log":"131.17", "lat":"46.65"},
{"name":"鸡四", "log":"130.97", "lat":"45.3"},
{"name":"大庆", "log":"125.03", "lat":"46.58"},
{"name":"伊春", "log":"128.92", "lat":"47.73"},
{"name":"嘉荫", "log":"130", "lat":"48.93"},
{"name":"铁力", "log":"128.08", "lat":"47.98"},
{"name":"绥化", "log":"127", "lat":"46.63"},
{"name":"绥棱", "log":"127.12", "lat":"47.22"},
{"name":"海伦", "log":"126.97", "lat":"47.47"},
{"name":"庆安", "log":"127.5", "lat":"46.87"},
{"name":"兰西", "log":"126.3", "lat":"46.28"},
{"name":"肇东", "log":"125.98", "lat":"46.07"},
{"name":"肇州", "log":"125.25", "lat":"45.72"},
{"name":"肇源", "log":"125.07", "lat":"45.53"},
{"name":"安达", "log":"125.33", "lat":"46.42"},
{"name":"明水", "log":"125.88", "lat":"47.18"},
{"name":"青岗", "log":"126.13", "lat":"46.68"},
{"name":"望奎", "log":"126.5", "lat":"46.83"},
{"name":"黑河", "log":"127.53", "lat":"50.22"},
{"name":"爱辉", "log":"127.53", "lat":"50.22"},
{"name":"德都", "log":"126.17", "lat":"48.5"},
{"name":"通北", "log":"126.8", "lat":"49.76"},
{"name":"北安", "log":"126.5", "lat":"48.22"},
{"name":"孙吴", "log":"127.5", "lat":"49.22"},
{"name":"逊克", "log":"128.42", "lat":"49.57"},
{"name":"嫩江", "log":"125.2", "lat":"49.17"},
{"name":"佳木斯", "log":"130.35", "lat":"46.83"},
{"name":"桦川", "log":"130.68", "lat":"47.02"},
{"name":"萝北", "log":"130.83", "lat":"47.58"},
{"name":"绥滨", "log":"131.83", "lat":"47.3"},
{"name":"富锦", "log":"132.02", "lat":"47.23"},
{"name":"同江", "log":"132.5", "lat":"47.67"},
{"name":"抚远", "log":"134.15", "lat":"48.33"},
{"name":"饶河", "log":"134", "lat":"46.78"},
{"name":"七台河", "log":"130.83", "lat":"45.82"},
{"name":"宝清", "log":"132.17", "lat":"46.33"},
{"name":"集贤", "log":"131.13", "lat":"46.7"},
{"name":"勃利", "log":"130.53", "lat":"45.75"},
{"name":"桦南", "log":"130.53", "lat":"46.25"},
{"name":"依兰", "log":"129.55", "lat":"46.33"},
{"name":"汤源", "log":"129.92", "lat":"46.73"},
{"name":"牡丹江", "log":"129.58", "lat":"44.6"},
{"name":"林口", "log":"130.23", "lat":"45.3"},
{"name":"鸡东", "log":"131.04", "lat":"45.27"},
{"name":"密山", "log":"131.85", "lat":"45.53"},
{"name":"虎林", "log":"132.55", "lat":"45.75"},
{"name":"绥芬河", "log":"131.17", "lat":"44.38"},
{"name":"东宁", "log":"131.12", "lat":"44.07"},
{"name":"穆棱", "log":"130.5", "lat":"44.9"},
{"name":"宁安", "log":"129.47", "lat":"44.35"},
{"name":"海林", "log":"129.35", "lat":"44.57"},
{"name":"阿城", "log":"126.95", "lat":"45.52"},
{"name":"呼兰", "log":"126.58", "lat":"46"},
{"name":"巴彦", "log":"127.38", "lat":"46.08"},
{"name":"宾县", "log":"127.48", "lat":"45.75"},
{"name":"木兰", "log":"128.03", "lat":"45.95"},
{"name":"通河", "log":"128.7", "lat":"45.98"},
{"name":"方正", "log":"128.8", "lat":"45.83"},
{"name":"延寿", "log":"128.35", "lat":"45.47"},
{"name":"尚志", "log":"127.95", "lat":"45.22"},
{"name":"五常", "log":"127.17", "lat":"44.93"},
{"name":"双城", "log":"126.32", "lat":"45.53"},
{"name":"富裕", "log":"124.4", "lat":"47.8"},
{"name":"讷河", "log":"124.85", "lat":"48.48"},
{"name":"克山", "log":"125.87", "lat":"48.03"},
{"name":"克东", "log":"126.22", "lat":"48.03"},
{"name":"拜泉", "log":"126.07", "lat":"47.62"},
{"name":"依安", "log":"125.3", "lat":"47.92"},
{"name":"林甸", "log":"124.87", "lat":"47.18"},
{"name":"泰来", "log":"123.45", "lat":"46.4"},
{"name":"龙江", "log":"123.18", "lat":"47.35"},
{"name":"甘南", "log":"123.48", "lat":"47.9"},
{"name":"杜尔伯特", "log":"124.44", "lat":"46.86"},
{"name":"加格达奇", "log":"124.07", "lat":"50.42"},
{"name":"呼玛", "log":"126.6", "lat":"51.72"},
{"name":"塔河", "log":"124.7", "lat":"52.32"},
{"name":"漠河", "log":"122.37", "lat":"53.48"}
]},
{"name":"浙江省", "log":"120.19", "lat":"30.26", "children":[
{"name":"杭州", "log":"120.19", "lat":"30.26"},
{"name":"余杭", "log":"120.3", "lat":"30.43"},
{"name":"富阳", "log":"119.95", "lat":"30.07"},
{"name":"建德", "log":"119.27", "lat":"29.49"},
{"name":"临安", "log":"119.72", "lat":"30.23"},
{"name":"萧山", "log":"120.25", "lat":"30.16"},
{"name":"桐庐", "log":"119.64", "lat":"29.8"},
{"name":"淳安", "log":"119.05", "lat":"29.61"},
{"name":"宁波", "log":"121.56", "lat":"29.86"},
{"name":"镇海", "log":"121.72", "lat":"29.96"},
{"name":"温州", "log":"120.65", "lat":"28.01"},
{"name":"瓯海", "log":"120.65", "lat":"28.01"},
{"name":"永喜", "log":"120.68", "lat":"28.16"},
{"name":"洞头", "log":"121.12", "lat":"27.84"},
{"name":"平阳", "log":"120.55", "lat":"27.68"},
{"name":"泰顺", "log":"119.7", "lat":"27.57"},
{"name":"乐清", "log":"120.94", "lat":"28.14"},
{"name":"瑞安", "log":"120.62", "lat":"27.8"},
{"name":"文成", "log":"120.08", "lat":"27.08"},
{"name":"苍南", "log":"120.36", "lat":"27.53"},
{"name":"湖州", "log":"120.1", "lat":"30.86"},
{"name":"平湖", "log":"121.02", "lat":"30.7"},
{"name":"桐乡", "log":"120.54", "lat":"30.64"},
{"name":"安吉", "log":"119.68", "lat":"30.68"},
{"name":"嘉善", "log":"120.92", "lat":"30.84"},
{"name":"嘉兴", "log":"120.76", "lat":"30.77"},
{"name":"海盐", "log":"120.92", "lat":"30.53"},
{"name":"海宁", "log":"120.69", "lat":"30.53"},
{"name":"德清", "log":"120.08", "lat":"30.54"},
{"name":"长兴", "log":"119.91", "lat":"30.01"},
{"name":"定海", "log":"122.11", "lat":"30.03"},
{"name":"岱山", "log":"122.2", "lat":"30.26"},
{"name":"嵊四", "log":"122.45", "lat":"30.72"},
{"name":"普陀", "log":"122.3", "lat":"29.97"},
{"name":"鄞县", "log":"121.56", "lat":"29.86"},
{"name":"象山", "log":"121.8", "lat":"29.48"},
{"name":"奉化", "log":"121.41", "lat":"29.66"},
{"name":"慈溪", "log":"121.23", "lat":"30.18"},
{"name":"宁海", "log":"121.42", "lat":"29.3"},
{"name":"余姚", "log":"121.16", "lat":"30.04"},
{"name":"绍兴", "log":"120.58", "lat":"30.01"},
{"name":"新昌", "log":"120.89", "lat":"29.49"},
{"name":"诸暨", "log":"120.23", "lat":"29.71"},
{"name":"上虞", "log":"120.87", "lat":"30.03"},
{"name":"嵊县", "log":"120.81", "lat":"29.6"},
{"name":"椒江", "log":"121.44", "lat":"28.67"},
{"name":"临海", "log":"121.13", "lat":"28.8"},
{"name":"三门", "log":"121.38", "lat":"29.11"},
{"name":"温岭", "log":"121.36", "lat":"28.36"},
{"name":"仙居", "log":"120.73", "lat":"28.85"},
{"name":"天台", "log":"121.03", "lat":"29.15"},
{"name":"黄岩", "log":"121.27", "lat":"28.64"},
{"name":"玉环", "log":"121.23", "lat":"28.14"},
{"name":"丽水", "log":"119.92", "lat":"28.45"},
{"name":"青田", "log":"120.28", "lat":"28.45"},
{"name":"庆无", "log":"119.06", "lat":"27.61"},
{"name":"遂昌", "log":"119.25", "lat":"28.59"},
{"name":"缙云", "log":"120.6", "lat":"28.66"},
{"name":"云和", "log":"119.56", "lat":"28.12"},
{"name":"龙泉", "log":"119.13", "lat":"28.08"},
{"name":"松阳", "log":"119.48", "lat":"28.46"},
{"name":"金华", "log":"119.64", "lat":"29.12"},
{"name":"浦江", "log":"119.88", "lat":"29.46"},
{"name":"东阳", "log":"120.23", "lat":"29.27"},
{"name":"武义", "log":"119.81", "lat":"28.9"},
{"name":"江山", "log":"118.61", "lat":"28.74"},
{"name":"开化", "log":"118.39", "lat":"29.15"},
{"name":"衢州", "log":"118.88", "lat":"28.97"},
{"name":"兰溪", "log":"119.48", "lat":"29.19"},
{"name":"义乌", "log":"120.06", "lat":"29.32"},
{"name":"永康", "log":"120.02", "lat":"28.92"},
{"name":"常山", "log":"118.5", "lat":"28.9"}
]},
{"name":"福建省", "log":"119.3", "lat":"26.08", "children":[
{"name":"福州", "log":"119.3", "lat":"26.08"},
{"name":"闽侯", "log":"119.14", "lat":"26.16"},
{"name":"厦门", "log":"118.1", "lat":"24.46"},
{"name":"同安", "log":"118.15", "lat":"24.74"},
{"name":"南平", "log":"118.16", "lat":"26.65"},
{"name":"南平", "log":"118.11", "lat":"27.34"},
{"name":"建瓯", "log":"118.32", "lat":"27.05"},
{"name":"浦城", "log":"118.55", "lat":"27.92"},
{"name":"邵武", "log":"117.48", "lat":"27.34"},
{"name":"顺昌", "log":"117.8", "lat":"26.8"},
{"name":"崇安", "log":"118.02", "lat":"27.76"},
{"name":"光泽", "log":"117.34", "lat":"27.54"},
{"name":"松溪", "log":"118.77", "lat":"27.53"},
{"name":"政和", "log":"118.85", "lat":"27.38"},
{"name":"宁德", "log":"119.52", "lat":"26.65"},
{"name":"福安", "log":"119.65", "lat":"27.09"},
{"name":"连江", "log":"119.53", "lat":"26.2"},
{"name":"福鼎", "log":"120.2", "lat":"27.34"},
{"name":"霞浦", "log":"120", "lat":"26.89"},
{"name":"吉田", "log":"118.74", "lat":"26.59"},
{"name":"罗源", "log":"119.55", "lat":"26.49"},
{"name":"寿宁", "log":"119.5", "lat":"27.47"},
{"name":"周宁", "log":"119.36", "lat":"27.12"},
{"name":"屏南", "log":"118.98", "lat":"26.92"},
{"name":"柘荣", "log":"119.89", "lat":"27.25"},
{"name":"莆田", "log":"119", "lat":"25.44"},
{"name":"仙游", "log":"118.7", "lat":"25.37"},
{"name":"福清", "log":"119.39", "lat":"25.73"},
{"name":"长乐", "log":"119.52", "lat":"25.96"},
{"name":"永泰", "log":"118.95", "lat":"25.88"},
{"name":"平潭", "log":"119.78", "lat":"25.51"},
{"name":"闽清", "log":"118.86", "lat":"26.21"},
{"name":"泉州", "log":"118.58", "lat":"24.93"},
{"name":"晋江", "log":"118.57", "lat":"24.82"},
{"name":"南安", "log":"118.39", "lat":"24.96"},
{"name":"惠安", "log":"118.78", "lat":"25.04"},
{"name":"安溪", "log":"118.18", "lat":"25.07"},
{"name":"永春", "log":"118.3", "lat":"25.34"},
{"name":"德化", "log":"118.24", "lat":"25.5"},
{"name":"金门", "log":"118.34", "lat":"24.43"},
{"name":"漳州", "log":"117.35", "lat":"24.52"},
{"name":"龙海", "log":"117.79", "lat":"24.44"},
{"name":"漳浦", "log":"117.61", "lat":"24.12"},
{"name":"诏安", "log":"117.16", "lat":"23.73"},
{"name":"平和", "log":"117.3", "lat":"24.38"},
{"name":"云霄", "log":"117.34", "lat":"23.99"},
{"name":"南靖", "log":"117.35", "lat":"24.51"},
{"name":"长泰", "log":"117.75", "lat":"24.62"},
{"name":"东山", "log":"117.4", "lat":"23.72"},
{"name":"华安", "log":"117.53", "lat":"25"},
{"name":"龙岩", "log":"117.01", "lat":"25.12"},
{"name":"上杭", "log":"116.41", "lat":"25.43"},
{"name":"永定", "log":"116.81", "lat":"24.76"},
{"name":"长汀", "log":"116.37", "lat":"25.85"},
{"name":"武平", "log":"116.1", "lat":"25.11"},
{"name":"连城", "log":"116.75", "lat":"25.72"},
{"name":"漳平", "log":"117.4", "lat":"25.3"},
{"name":"三明", "log":"117.61", "lat":"26.23"},
{"name":"龙溪", "log":"118.17", "lat":"26.18"},
{"name":"宁化", "log":"116.64", "lat":"26.26"},
{"name":"大田", "log":"117.83", "lat":"25.69"},
{"name":"永安", "log":"117.37", "lat":"25.97"},
{"name":"沙县", "log":"117.77", "lat":"26.41"},
{"name":"将乐", "log":"117.45", "lat":"26.73"},
{"name":"清流", "log":"116.81", "lat":"26.12"},
{"name":"建宁", "log":"116.82", "lat":"26.85"},
{"name":"泰宁", "log":"117.15", "lat":"26.92"},
{"name":"明溪", "log":"117.18", "lat":"26.36"}
]},
{"name":"山东省", "log":"117.54", "lat":"36.59", "children":[
{"name":"济南", "log":"117", "lat":"36.65"},
{"name":"历城", "log":"117.07", "lat":"36.69"},
{"name":"长清", "log":"116.73", "lat":"36.55"},
{"name":"章丘", "log":"117.53", "lat":"36.72"},
{"name":"青岛", "log":"120.33", "lat":"36.07"},
{"name":"崂山", "log":"120.42", "lat":"36.15"},
{"name":"胶南", "log":"119.97", "lat":"35.88"},
{"name":"即墨", "log":"120.45", "lat":"36.38"},
{"name":"胶县", "log":"120", "lat":"36.28"},
{"name":"淄博", "log":"118.05", "lat":"36.78"},
{"name":"枣庄", "log":"117.57", "lat":"34.86"},
{"name":"滕县", "log":"117.17", "lat":"35.09"},
{"name":"东营", "log":"118.49", "lat":"37.46"},
{"name":"垦利", "log":"118.54", "lat":"37.59"},
{"name":"利津", "log":"118.25", "lat":"37.49"},
{"name":"德州", "log":"116.29", "lat":"37.45"},
{"name":"宁津", "log":"116.8", "lat":"37.64"},
{"name":"乐陵", "log":"117.22", "lat":"37.74"},
{"name":"商河", "log":"117.15", "lat":"37.31"},
{"name":"济阳", "log":"117.2", "lat":"36.97"},
{"name":"禹城", "log":"116.66", "lat":"36.95"},
{"name":"夏津", "log":"116", "lat":"36.95"},
{"name":"陵县", "log":"116.58", "lat":"37.34"},
{"name":"庆云", "log":"117.37", "lat":"37.37"},
{"name":"临邑", "log":"116.86", "lat":"37.2"},
{"name":"齐河", "log":"116.76", "lat":"36.79"},
{"name":"平原", "log":"116.44", "lat":"37.16"},
{"name":"武城", "log":"116.08", "lat":"37.2"},
{"name":"滨州", "log":"118.03", "lat":"37.36"},
{"name":"滨县", "log":"117.97", "lat":"37.47"},
{"name":"广饶", "log":"118.41", "lat":"37.04"},
{"name":"桓台", "log":"118.12", "lat":"36.95"},
{"name":"邹平", "log":"117.75", "lat":"36.89"},
{"name":"阳信", "log":"117.58", "lat":"37.65"},
{"name":"沾化", "log":"118.14", "lat":"37.7"},
{"name":"博兴", "log":"118.12", "lat":"37.12"},
{"name":"高青", "log":"117.66", "lat":"37.18"},
{"name":"惠民", "log":"117.51", "lat":"37.49"},
{"name":"无棣", "log":"117.58", "lat":"37.73"},
{"name":"潍坊", "log":"119.1", "lat":"36.62"},
{"name":"潍县", "log":"119.22", "lat":"36.77"},
{"name":"平度", "log":"119.97", "lat":"36.77"},
{"name":"诸城", "log":"119.42", "lat":"35.99"},
{"name":"安丘", "log":"119.2", "lat":"36.42"},
{"name":"临朐", "log":"118.53", "lat":"36.5"},
{"name":"寿光", "log":"118.73", "lat":"36.86"},
{"name":"昌邑", "log":"119.41", "lat":"36.86"},
{"name":"高密", "log":"119.75", "lat":"36.38"},
{"name":"五莲", "log":"119.2", "lat":"35.74"},
{"name":"昌乐", "log":"118.83", "lat":"36.69"},
{"name":"高都", "log":"118.47", "lat":"36.69"},
{"name":"烟台", "log":"121.39", "lat":"37.52"},
{"name":"牟平", "log":"121.59", "lat":"37.38"},
{"name":"文登", "log":"122.05", "lat":"37.2"},
{"name":"海阳", "log":"121.17", "lat":"36.76"},
{"name":"莱阳", "log":"120.71", "lat":"36.97"},
{"name":"栖霞", "log":"120.83", "lat":"37.28"},
{"name":"掖县", "log":"119.93", "lat":"37.18"},
{"name":"长岛", "log":"120.73", "lat":"37.91"},
{"name":"威海", "log":"122.1", "lat":"37.5"},
{"name":"福山", "log":"121.27", "lat":"37.49"},
{"name":"荣成", "log":"122.41", "lat":"37.16"},
{"name":"乳山", "log":"121.52", "lat":"36.89"},
{"name":"莱西", "log":"120.53", "lat":"36.86"},
{"name":"招远", "log":"120.38", "lat":"37.35"},
{"name":"黄县", "log":"120.51", "lat":"37.64"},
{"name":"蓬莱", "log":"120.75", "lat":"37.8"},
{"name":"临沂", "log":"118.35", "lat":"35.05"},
{"name":"沂水", "log":"118.64", "lat":"35.78"},
{"name":"日照", "log":"119.46", "lat":"35.42"},
{"name":"临沭", "log":"118.73", "lat":"34.89"},
{"name":"仓山", "log":"118.03", "lat":"34.84"},
{"name":"平邑", "log":"117.63", "lat":"35.49"},
{"name":"沂源", "log":"118.17", "lat":"36.18"},
{"name":"沂南", "log":"118.47", "lat":"35.54"},
{"name":"营县", "log":"118.83", "lat":"35.57"},
{"name":"莒南", "log":"118.83", "lat":"35.17"},
{"name":"郯城", "log":"118.35", "lat":"34.61"},
{"name":"费县", "log":"117.97", "lat":"35.26"},
{"name":"蒙阴", "log":"117.95", "lat":"35.7"},
{"name":"泰安", "log":"117.13", "lat":"36.18"},
{"name":"莱芜", "log":"117.67", "lat":"36.19"},
{"name":"肥城", "log":"116.76", "lat":"36.24"},
{"name":"平阴", "log":"116.46", "lat":"36.29"},
{"name":"新汶", "log":"117.67", "lat":"35.86"},
{"name":"新泰", "log":"117.76", "lat":"35.91"},
{"name":"宁阳", "log":"116.8", "lat":"35.76"},
{"name":"东平", "log":"116.3", "lat":"35.91"},
{"name":"济宁", "log":"116.59", "lat":"35.38"},
{"name":"兖州", "log":"116.83", "lat":"35.54"},
{"name":"泗水", "log":"117.27", "lat":"35.65"},
{"name":"鱼台", "log":"116.65", "lat":"35"},
{"name":"嘉祥", "log":"116.34", "lat":"35.41"},
{"name":"汶上", "log":"116.49", "lat":"35.71"},
{"name":"曲阜", "log":"116.98", "lat":"35.59"},
{"name":"邹县", "log":"116.97", "lat":"35.39"},
{"name":"微山", "log":"117.12", "lat":"34.8"},
{"name":"金乡", "log":"116.32", "lat":"35.07"},
{"name":"荷泽", "log":"115.43", "lat":"35.24"},
{"name":"郓城", "log":"115.94", "lat":"35.59"},
{"name":"巨野", "log":"116.08", "lat":"35.38"},
{"name":"单县", "log":"116.07", "lat":"34.82"},
{"name":"曹县", "log":"115.53", "lat":"34.83"},
{"name":"鄄城", "log":"115.5", "lat":"35.57"},
{"name":"梁山", "log":"116.1", "lat":"35.8"},
{"name":"成武", "log":"115.88", "lat":"34.97"},
{"name":"定陶", "log":"115.57", "lat":"35.07"},
{"name":"东明", "log":"115.08", "lat":"35.31"},
{"name":"聊城", "log":"115.97", "lat":"36.45"},
{"name":"高唐", "log":"116.23", "lat":"36.86"},
{"name":"东阿", "log":"116.23", "lat":"36.32"},
{"name":"莘县", "log":"115.67", "lat":"36.24"},
{"name":"临清", "log":"115.72", "lat":"36.68"},
{"name":"茌平", "log":"116.27", "lat":"36.58"},
{"name":"阳谷", "log":"115.78", "lat":"36.11"},
{"name":"冠县", "log":"115.45", "lat":"35.47"}
]},
{"name":"河南省", "log":"113.65", "lat":"34.76", "children":[
{"name":"郑州", "log":"113.65", "lat":"34.76"},
{"name":"荥阳", "log":"113.35", "lat":"34.79"},
{"name":"开封", "log":"114.35", "lat":"34.79"},
{"name":"平顶山", "log":"113.29", "lat":"33.75"},
{"name":"洛阳", "log":"112.44", "lat":"34.7"},
{"name":"焦作", "log":"113.21", "lat":"35.24"},
{"name":"鹤壁", "log":"114.17", "lat":"35.9"},
{"name":"杞县", "log":"114.77", "lat":"34.56"},
{"name":"尉氏", "log":"114.17", "lat":"34.41"},
{"name":"新郑", "log":"113.71", "lat":"34.4"},
{"name":"登封", "log":"113.02", "lat":"34.46"},
{"name":"通许", "log":"114.46", "lat":"34.48"},
{"name":"中牟", "log":"114", "lat":"34.73"},
{"name":"密县", "log":"113.35", "lat":"34.51"},
{"name":"巩县", "log":"112.96", "lat":"34.76"},
{"name":"兰考", "log":"114.81", "lat":"34.69"},
{"name":"新乡", "log":"113.85", "lat":"35.31"},
{"name":"汲县", "log":"114.05", "lat":"35.44"},
{"name":"封丘", "log":"114.04", "lat":"35.03"},
{"name":"获嘉", "log":"113.63", "lat":"35.27"},
{"name":"温贺", "log":"113.06", "lat":"34.94"},
{"name":"济源", "log":"112.57", "lat":"35.08"},
{"name":"博爱", "log":"113.05", "lat":"35.16"},
{"name":"辉县", "log":"113.77", "lat":"35.46"},
{"name":"延津", "log":"114.19", "lat":"35.14"},
{"name":"原阳", "log":"113.96", "lat":"35.05"},
{"name":"武陟", "log":"113.38", "lat":"35.1"},
{"name":"孟县", "log":"112.77", "lat":"34.92"},
{"name":"沁阳", "log":"112.92", "lat":"35.08"},
{"name":"修武", "log":"113.42", "lat":"35.24"},
{"name":"安阳", "log":"114.35", "lat":"36.1"},
{"name":"南乐", "log":"115.21", "lat":"36.08"},
{"name":"范县", "log":"115.46", "lat":"35.9"},
{"name":"台前", "log":"115.83", "lat":"36"},
{"name":"滑县", "log":"114.52", "lat":"35.57"},
{"name":"浚县", "log":"114.54", "lat":"35.67"},
{"name":"淇县", "log":"114.17", "lat":"35.6"},
{"name":"内黄", "log":"114.88", "lat":"35.95"},
{"name":"清丰", "log":"115.1", "lat":"35.89"},
{"name":"濮阳", "log":"114.98", "lat":"35.71"},
{"name":"长垣", "log":"114.67", "lat":"35.19"},
{"name":"汤阴", "log":"114.35", "lat":"35.92"},
{"name":"林县", "log":"113.81", "lat":"36.06"},
{"name":"商丘", "log":"115.65", "lat":"34.44"},
{"name":"夏邑", "log":"116.13", "lat":"34.22"},
{"name":"柘城", "log":"115.29", "lat":"34.08"},
{"name":"睢县", "log":"115.04", "lat":"34.46"},
{"name":"虞城", "log":"115.87", "lat":"34.4"},
{"name":"永城", "log":"116.37", "lat":"33.94"},
{"name":"宁陵", "log":"115.31", "lat":"34.44"},
{"name":"民权", "log":"115.13", "lat":"34.65"},
{"name":"周口", "log":"114.63", "lat":"33.63"},
{"name":"商水", "log":"114.59", "lat":"33.54"},
{"name":"扶沟", "log":"114.38", "lat":"34.05"},
{"name":"鹿邑", "log":"115.48", "lat":"33.86"},
{"name":"淮阳", "log":"114.88", "lat":"33.74"},
{"name":"沈丘", "log":"115.06", "lat":"33.41"},
{"name":"西华", "log":"114.5", "lat":"33.79"},
{"name":"太康", "log":"114.85", "lat":"34.06"},
{"name":"郸城", "log":"115.17", "lat":"33.63"},
{"name":"项城", "log":"114.9", "lat":"33.44"},
{"name":"许昌", "log":"113.81", "lat":"34.02"},
{"name":"鄢县", "log":"114.17", "lat":"34.11"},
{"name":"郾城", "log":"113.98", "lat":"33.6"},
{"name":"襄城", "log":"113.46", "lat":"33.86"},
{"name":"鲁山", "log":"112.88", "lat":"33.74"},
{"name":"郏县", "log":"113.19", "lat":"33.98"},
{"name":"漯河", "log":"114.02", "lat":"33.56"},
{"name":"长葛", "log":"113.77", "lat":"34.22"},
{"name":"临颖", "log":"113.94", "lat":"33.81"},
{"name":"舞阳", "log":"113.58", "lat":"33.44"},
{"name":"叶县", "log":"113.35", "lat":"33.62"},
{"name":"宝丰", "log":"113.04", "lat":"33.86"},
{"name":"禹县", "log":"113.47", "lat":"34.16"},
{"name":"驻马店", "log":"114.02", "lat":"32.98"},
{"name":"确山", "log":"114.02", "lat":"32.83"},
{"name":"西平", "log":"114", "lat":"33.38"},
{"name":"汝南", "log":"114.35", "lat":"33"},
{"name":"新蔡", "log":"114.97", "lat":"32.75"},
{"name":"泌阳", "log":"113.31", "lat":"32.72"},
{"name":"遂平", "log":"113.98", "lat":"33.15"},
{"name":"上蔡", "log":"114.26", "lat":"33.25"},
{"name":"平舆", "log":"114.62", "lat":"32.97"},
{"name":"正阳", "log":"114.38", "lat":"32.62"},
{"name":"信阳", "log":"114.08", "lat":"32.13"},
{"name":"息县", "log":"114.72", "lat":"32.35"},
{"name":"固始", "log":"115.68", "lat":"32.17"},
{"name":"潢川", "log":"115.04", "lat":"32.13"},
{"name":"新县", "log":"114.83", "lat":"31.62"},
{"name":"罗山", "log":"114.53", "lat":"32.21"},
{"name":"淮滨", "log":"115.41", "lat":"32.44"},
{"name":"商城", "log":"115.42", "lat":"31.81"},
{"name":"光山", "log":"114.91", "lat":"32.02"},
{"name":"南阳", "log":"112.53", "lat":"33.01"},
{"name":"方城", "log":"112.98", "lat":"33.25"},
{"name":"唐河", "log":"112.83", "lat":"32.7"},
{"name":"新野", "log":"112.36", "lat":"32.51"},
{"name":"邓县", "log":"112.08", "lat":"32.68"},
{"name":"淅川", "log":"111.47", "lat":"33.14"},
{"name":"南召", "log":"112.4", "lat":"33.49"},
{"name":"社旗", "log":"112.92", "lat":"33.05"},
{"name":"桐柏", "log":"113.4", "lat":"32.37"},
{"name":"镇平", "log":"112.23", "lat":"33.03"},
{"name":"内乡", "log":"111.83", "lat":"33.05"},
{"name":"西峡", "log":"111.5", "lat":"33.31"},
{"name":"三门峡", "log":"111.19", "lat":"34.76"},
{"name":"孟津", "log":"112.42", "lat":"34.84"},
{"name":"临汝", "log":"112.83", "lat":"34.17"},
{"name":"汝阳", "log":"112.46", "lat":"34.16"},
{"name":"嵩县", "log":"112.07", "lat":"34.14"},
{"name":"栾川", "log":"111.6", "lat":"33.81"},
{"name":"灵宝", "log":"110.85", "lat":"34.52"},
{"name":"渑池", "log":"111.75", "lat":"34.76"},
{"name":"义马", "log":"111.92", "lat":"34.73"},
{"name":"偃师", "log":"112.77", "lat":"34.73"},
{"name":"伊川", "log":"112.42", "lat":"34.43"},
{"name":"宜阳", "log":"112.15", "lat":"34.51"},
{"name":"洛宁", "log":"111.65", "lat":"34.39"},
{"name":"卢氏", "log":"111.03", "lat":"34.06"},
{"name":"陕县", "log":"111.19", "lat":"34.76"},
{"name":"新安", "log":"112.14", "lat":"34.75"}
]},
{"name":"湖北省", "log":"114.31", "lat":"30.52", "children":[
{"name":"武汉", "log":"114.31", "lat":"30.52"},
{"name":"武昌", "log":"114.33", "lat":"30.35"},
{"name":"汉阳", "log":"114.02", "lat":"30.57"},
{"name":"黄石", "log":"115.09", "lat":"30.2"},
{"name":"十堰", "log":"110.79", "lat":"32.65"},
{"name":"沙市", "log":"112.24", "lat":"30.32"},
{"name":"宜昌", "log":"111.3", "lat":"30.7"},
{"name":"襄樊", "log":"112.14", "lat":"30.02"},
{"name":"孝感", "log":"113.91", "lat":"31.92"},
{"name":"黄陂", "log":"114.36", "lat":"30.88"},
{"name":"汉川", "log":"113.59", "lat":"30.63"},
{"name":"云梦", "log":"113.73", "lat":"31.02"},
{"name":"应山", "log":"113.81", "lat":"31.62"},
{"name":"大悟", "log":"114.09", "lat":"31.56"},
{"name":"应城", "log":"113.6", "lat":"30.94"},
{"name":"安陆", "log":"113.69", "lat":"31.25"},
{"name":"鄂城", "log":"114.87", "lat":"30.38"},
{"name":"黄冈", "log":"114.87", "lat":"30.44"},
{"name":"新洲", "log":"114.8", "lat":"31.84"},
{"name":"红安", "log":"114.61", "lat":"31.29"},
{"name":"麻城", "log":"115", "lat":"31.17"},
{"name":"罗川", "log":"115.37", "lat":"30.79"},
{"name":"浠水", "log":"115.22", "lat":"30.46"},
{"name":"蕲春", "log":"115.3", "lat":"30.24"},
{"name":"黄梅", "log":"115.93", "lat":"30.09"},
{"name":"广济", "log":"115.56", "lat":"29.85"},
{"name":"英山", "log":"115.57", "lat":"30.75"},
{"name":"咸宁", "log":"114.28", "lat":"29.87"},
{"name":"阳新", "log":"115.22", "lat":"29.83"},
{"name":"通山", "log":"114.52", "lat":"29.6"},
{"name":"通城", "log":"113.8", "lat":"29.23"},
{"name":"嘉鱼", "log":"113.91", "lat":"29.97"},
{"name":"崇阳", "log":"114.04", "lat":"29.54"},
{"name":"蒲圻", "log":"113.85", "lat":"29.71"},
{"name":"荆门", "log":"112.19", "lat":"31.02"},
{"name":"江陵", "log":"112.18", "lat":"30.35"},
{"name":"钟祥", "log":"112.58", "lat":"31.17"},
{"name":"京山", "log":"113.11", "lat":"31.03"},
{"name":"监利", "log":"112.9", "lat":"29.83"},
{"name":"石首", "log":"112.41", "lat":"29.73"}
]},
{"name":"湖南省", "log":"113", "lat":"28.21", "children":[
{"name":"长沙", "log":"113", "lat":"28.21"},
{"name":"望城", "log":"112.8", "lat":"28.37"},
{"name":"株洲", "log":"113.16", "lat":"27.83"},
{"name":"湘潭", "log":"112.91", "lat":"27.87"},
{"name":"衡阳", "log":"112.61", "lat":"26.89"},
{"name":"邵阳", "log":"111.5", "lat":"27.22"},
{"name":"岳阳", "log":"113.09", "lat":"29.37"},
{"name":"临湘", "log":"113.42", "lat":"29.48"},
{"name":"平江", "log":"113.56", "lat":"29.71"},
{"name":"泪罗", "log":"113.05", "lat":"28.8"},
{"name":"湘阴", "log":"112.87", "lat":"28.68"},
{"name":"华容", "log":"112.55", "lat":"29.52"},
{"name":"浏阳", "log":"113.63", "lat":"28.16"},
{"name":"醴陵", "log":"113.5", "lat":"27.67"},
{"name":"攸县", "log":"113.32", "lat":"27.01"},
{"name":"茶陵", "log":"113.54", "lat":"26.79"},
{"name":"酃县", "log":"113.77", "lat":"26.49"},
{"name":"湘乡", "log":"112.5", "lat":"27.75"},
{"name":"郴州", "log":"113", "lat":"25.79"},
{"name":"郴县", "log":"113", "lat":"25.79"},
{"name":"安仁", "log":"113.27", "lat":"26.71"},
{"name":"永兴", "log":"113.11", "lat":"26.13"},
{"name":"资兴", "log":"113.39", "lat":"25.95"},
{"name":"桂东", "log":"113.91", "lat":"25.08"},
{"name":"汝城", "log":"113.68", "lat":"25.54"},
{"name":"宜章", "log":"113.96", "lat":"25.41"},
{"name":"临武", "log":"112.55", "lat":"25.27"},
{"name":"嘉禾", "log":"112.35", "lat":"25.56"},
{"name":"桂阳", "log":"112.72", "lat":"25.73"},
{"name":"来阳", "log":"112.84", "lat":"26.41"},
{"name":"衡南", "log":"112.61", "lat":"26.89"},
{"name":"衡山", "log":"112.86", "lat":"27.25"},
{"name":"衡东", "log":"112.95", "lat":"27.1"},
{"name":"常宁", "log":"112.39", "lat":"26.38"},
{"name":"祁阳", "log":"111.85", "lat":"26.59"},
{"name":"祁东", "log":"112.14", "lat":"26.8"},
{"name":"衡阳", "log":"112.39", "lat":"26.98"},
{"name":"永州", "log":"111.63", "lat":"26.22"},
{"name":"零陵", "log":"111.63", "lat":"26.22"},
{"name":"新田", "log":"112.21", "lat":"25.91"},
{"name":"宁远", "log":"111.95", "lat":"25.6"},
{"name":"蓝山", "log":"112.16", "lat":"25.37"},
{"name":"双牌", "log":"111.64", "lat":"25.96"},
{"name":"江永", "log":"111.33", "lat":"25.41"},
{"name":"道县", "log":"111.57", "lat":"25.52"},
{"name":"东安", "log":"111.28", "lat":"26.41"},
{"name":"江华", "log":"111.79", "lat":"24.97"},
{"name":"新宁", "log":"110.84", "lat":"26.44"},
{"name":"武冈", "log":"110.61", "lat":"26.73"},
{"name":"隆回", "log":"111.04", "lat":"27.13"},
{"name":"绥宁", "log":"110.14", "lat":"25.59"},
{"name":"洞口", "log":"110.57", "lat":"27.06"},
{"name":"城步", "log":"110.3", "lat":"26.37"},
{"name":"娄底", "log":"111.96", "lat":"27.71"},
{"name":"涟源", "log":"111.66", "lat":"27.68"},
{"name":"新邵", "log":"111.46", "lat":"27.33"},
{"name":"双峰", "log":"112.18", "lat":"27.44"},
{"name":"冷水江", "log":"111.41", "lat":"27.68"},
{"name":"邵东", "log":"111.73", "lat":"27.25"},
{"name":"新化", "log":"111.29", "lat":"27.73"},
{"name":"怀化", "log":"109.95", "lat":"27.52"},
{"name":"黔阳", "log":"110.14", "lat":"27.33"},
{"name":"辰溪", "log":"110.18", "lat":"28.02"},
{"name":"沅陵", "log":"110.39", "lat":"28.46"},
{"name":"溆浦", "log":"110.57", "lat":"27.92"},
{"name":"会同", "log":"109.71", "lat":"26.86"},
{"name":"靖县", "log":"109.68", "lat":"26.57"},
{"name":"洪江", "log":"109.96", "lat":"27.1"},
{"name":"芷江", "log":"109.78", "lat":"27.44"},
{"name":"麻阳", "log":"109.79", "lat":"27.87"},
{"name":"通道", "log":"109.77", "lat":"26.16"},
{"name":"新晃", "log":"109.16", "lat":"27.37"},
{"name":"吉首", "log":"109.71", "lat":"28.3"},
{"name":"永顺", "log":"109.84", "lat":"29"},
{"name":"桑植", "log":"110.16", "lat":"29.38"},
{"name":"大庸", "log":"110.48", "lat":"29.13"},
{"name":"古丈", "log":"109.91", "lat":"28.62"},
{"name":"泸溪", "log":"110.73", "lat":"28.29"},
{"name":"凤凰", "log":"109.43", "lat":"27.92"},
{"name":"花垣", "log":"109.46", "lat":"28.59"},
{"name":"保靖", "log":"109.64", "lat":"28.7"},
{"name":"龙山", "log":"109.42", "lat":"29.64"},
{"name":"常德", "log":"111.69", "lat":"29.05"},
{"name":"临澧", "log":"111.64", "lat":"29.44"},
{"name":"澧县", "log":"111.75", "lat":"29.65"},
{"name":"安乡", "log":"112.16", "lat":"29.41"},
{"name":"津市", "log":"111.87", "lat":"29.64"},
{"name":"汉寿", "log":"111.97", "lat":"28.9"},
{"name":"桃源", "log":"111.47", "lat":"28.9"},
{"name":"慈利", "log":"111.09", "lat":"29.41"},
{"name":"石门", "log":"111.35", "lat":"29.59"},
{"name":"益阳", "log":"112.33", "lat":"28.6"},
{"name":"南县", "log":"112.39", "lat":"29.37"},
{"name":"沅江", "log":"112.36", "lat":"28.83"},
{"name":"宁乡", "log":"112.55", "lat":"28.27"},
{"name":"安化", "log":"111.2", "lat":"28.38"},
{"name":"桃江", "log":"112.11", "lat":"28.51"}
]},
{"name":"广东省", "log":"113.23", "lat":"23.16", "children":[
{"name":"广州", "log":"113.23", "lat":"23.16"},
{"name":"花县", "log":"113.19", "lat":"23.4"},
{"name":"新十", "log":"114.2", "lat":"24.09"},
{"name":"增城", "log":"113.81", "lat":"23.13"},
{"name":"从化", "log":"113.55", "lat":"23.57"},
{"name":"龙门", "log":"114.25", "lat":"23.75"},
{"name":"番禺", "log":"113.36", "lat":"22.95"},
{"name":"海口", "log":"110.35", "lat":"20.02"},
{"name":"汕头", "log":"116.69", "lat":"23.39"},
{"name":"洪江", "log":"110.38", "lat":"21.2"},
{"name":"茂名", "log":"110.88", "lat":"21.68"},
{"name":"佛山", "log":"113.11", "lat":"23.05"},
{"name":"江门", "log":"113.06", "lat":"22.61"},
{"name":"深圳", "log":"114.07", "lat":"22.62"},
{"name":"宝安", "log":"113.85", "lat":"22.58"},
{"name":"珠海", "log":"113.52", "lat":"22.3"},
{"name":"韶关", "log":"113.62", "lat":"24.84"},
{"name":"曲江", "log":"113.58", "lat":"24.68"},
{"name":"乐昌", "log":"113.35", "lat":"25.14"},
{"name":"仁化", "log":"113.73", "lat":"25.11"},
{"name":"南雄", "log":"114.33", "lat":"25.14"},
{"name":"始兴", "log":"114.08", "lat":"24.78"},
{"name":"翁源", "log":"114.13", "lat":"24.36"},
{"name":"佛岗", "log":"113.52", "lat":"23.86"},
{"name":"英德", "log":"113.38", "lat":"24.17"},
{"name":"清远", "log":"113.01", "lat":"23.7"},
{"name":"阳山", "log":"112.65", "lat":"24.48"},
{"name":"连县", "log":"112.4", "lat":"24.77"},
{"name":"连山", "log":"112.07", "lat":"24.59"},
{"name":"连南", "log":"112.28", "lat":"24.77"},
{"name":"惠州", "log":"114.4", "lat":"23.09"},
{"name":"惠阳", "log":"114.4", "lat":"23.09"},
{"name":"博罗", "log":"114.28", "lat":"23.18"},
{"name":"河源", "log":"114.68", "lat":"23.73"},
{"name":"连平", "log":"114.48", "lat":"24.39"},
{"name":"和平", "log":"114.89", "lat":"24.45"},
{"name":"龙川", "log":"115.25", "lat":"24.09"},
{"name":"紫金", "log":"115.18", "lat":"23.64"},
{"name":"惠东", "log":"114.7", "lat":"22.97"},
{"name":"东莞", "log":"113.75", "lat":"23.04"},
{"name":"梅州", "log":"116.1", "lat":"24.55"},
{"name":"梅县", "log":"116.1", "lat":"24.55"},
{"name":"平远", "log":"117.9", "lat":"24.59"},
{"name":"蕉岭", "log":"116.18", "lat":"24.66"},
{"name":"大埔", "log":"116.7", "lat":"24.34"},
{"name":"丰顺", "log":"116.18", "lat":"23.78"},
{"name":"五华", "log":"115.75", "lat":"23.93"},
{"name":"兴宁", "log":"115.75", "lat":"24.15"},
{"name":"潮州", "log":"116.63", "lat":"23.68"},
{"name":"澄海", "log":"116.8", "lat":"23.48"},
{"name":"潮安", "log":"116.63", "lat":"23.68"},
{"name":"饶平", "log":"117.01", "lat":"23.7"},
{"name":"南澳", "log":"117.03", "lat":"23.44"},
{"name":"潮阳", "log":"116.61", "lat":"23.27"},
{"name":"惠来", "log":"116.29", "lat":"23.07"},
{"name":"陆丰", "log":"117.64", "lat":"22.95"},
{"name":"海丰", "log":"117.33", "lat":"22.98"},
{"name":"普宁", "log":"116.17", "lat":"23.29"},
{"name":"揭西", "log":"115.82", "lat":"23.45"},
{"name":"揭阳", "log":"116.35", "lat":"23.55"},
{"name":"南海", "log":"113.11", "lat":"23.05"},
{"name":"三水", "log":"112.89", "lat":"23.18"},
{"name":"顺德", "log":"113.24", "lat":"22.84"},
{"name":"中山", "log":"113.38", "lat":"22.52"},
{"name":"斗门", "log":"113.25", "lat":"22.2"},
{"name":"新会", "log":"113.02", "lat":"22.52"},
{"name":"鹤山", "log":"112.94", "lat":"22.76"},
{"name":"开平", "log":"112.68", "lat":"22.36"},
{"name":"台山", "log":"112.78", "lat":"22.27"},
{"name":"恩平", "log":"112.29", "lat":"22.21"},
{"name":"高明", "log":"112.76", "lat":"21.71"},
{"name":"廉江", "log":"110.27", "lat":"21.63"},
{"name":"化州", "log":"110.59", "lat":"21.64"},
{"name":"高州", "log":"110.83", "lat":"21.95"},
{"name":"信宜", "log":"110.9", "lat":"22.36"},
{"name":"阳春", "log":"111.78", "lat":"22.16"},
{"name":"阳江", "log":"111.95", "lat":"21.85"},
{"name":"电白", "log":"110.99", "lat":"21.52"},
{"name":"吴川", "log":"110.78", "lat":"21.43"},
{"name":"徐闻", "log":"110.17", "lat":"20.34"},
{"name":"海康", "log":"110.07", "lat":"20.91"},
{"name":"遂溪", "log":"110.24", "lat":"21.39"},
{"name":"肇庆", "log":"112.44", "lat":"23.05"},
{"name":"高要", "log":"112.44", "lat":"23.05"},
{"name":"怀集", "log":"112.18", "lat":"23.93"},
{"name":"广宁", "log":"112.43", "lat":"23.14"},
{"name":"四会", "log":"112.68", "lat":"23.36"},
{"name":"新兴", "log":"112.2", "lat":"22.68"},
{"name":"云浮", "log":"112.02", "lat":"22.93"},
{"name":"罗定", "log":"111.56", "lat":"22.77"},
{"name":"郁南", "log":"111.51", "lat":"23.23"},
{"name":"德庆", "log":"111.75", "lat":"23.15"},
{"name":"封开", "log":"111.48", "lat":"23.45"}
]},
{"name":"海南省", "log":"110.35", "lat":"20.02", "children":[
{"name":"海口", "log":"110.35", "lat":"20.02"},
{"name":"琼山", "log":"110.33", "lat":"19.98"},
{"name":"文昌", "log":"110.72", "lat":"19.61"},
{"name":"定安", "log":"110.31", "lat":"19.68"},
{"name":"琼海", "log":"110.46", "lat":"19.25"},
{"name":"万宁", "log":"110.39", "lat":"18.8"},
{"name":"屯昌", "log":"110.1", "lat":"19.36"},
{"name":"澄迈", "log":"110", "lat":"19.75"},
{"name":"儋县", "log":"109.57", "lat":"19.52"},
{"name":"临高", "log":"109.69", "lat":"19.91"},
{"name":"保亭", "log":"109.7", "lat":"18.64"},
{"name":"白沙", "log":"109.44", "lat":"19.23"},
{"name":"琼中", "log":"109.83", "lat":"19.05"},
{"name":"陵水", "log":"110.02", "lat":"18.48"},
{"name":"崖县", "log":"109.5", "lat":"18.25"},
{"name":"乐东", "log":"109.17", "lat":"18.73"},
{"name":"东方", "log":"108.64", "lat":"19.09"},
{"name":"昌江", "log":"109.03", "lat":"19.25"}
]},
{"name":"四川省", "log":"104.06", "lat":"30.67", "children":[
{"name":"成都", "log":"104.06", "lat":"30.67"},
{"name":"金堂", "log":"104.32", "lat":"30.88"},
{"name":"双流", "log":"104.94", "lat":"30.57"},
{"name":"蒲江", "log":"103.29", "lat":"30.2"},
{"name":"郫县", "log":"103.86", "lat":"30.8"},
{"name":"新都", "log":"104.13", "lat":"30.82"},
{"name":"来易", "log":"102.15", "lat":"26.9"},
{"name":"盐边", "log":"101.56", "lat":"26.9"},
{"name":"温江", "log":"103.81", "lat":"30.97"},
{"name":"灌县", "log":"103.61", "lat":"31.04"},
{"name":"彭县", "log":"103.94", "lat":"30.99"},
{"name":"什邡", "log":"104.16", "lat":"31.13"},
{"name":"广汉", "log":"104.25", "lat":"30.99"},
{"name":"新津", "log":"103.78", "lat":"30.42"},
{"name":"邛崃", "log":"103.47", "lat":"30.42"},
{"name":"大邑", "log":"103.53", "lat":"30.58"},
{"name":"崇庆", "log":"103.69", "lat":"30.63"},
{"name":"绵阳", "log":"104.73", "lat":"31.48"},
{"name":"江油", "log":"104.7", "lat":"31.8"},
{"name":"青川", "log":"105.21", "lat":"32.59"},
{"name":"平武", "log":"104.52", "lat":"32.42"},
{"name":"光元", "log":"105.86", "lat":"32.44"},
{"name":"旺苍", "log":"106.33", "lat":"32.25"},
{"name":"剑阁", "log":"105.45", "lat":"32.03"},
{"name":"梓潼", "log":"105.16", "lat":"31.64"},
{"name":"三台", "log":"105.06", "lat":"31.1"},
{"name":"盐亭", "log":"105.35", "lat":"31.23"},
{"name":"射洪", "log":"105.31", "lat":"30.9"},
{"name":"遂宁", "log":"105.58", "lat":"30.52"},
{"name":"蓬溪", "log":"105.74", "lat":"30.78"},
{"name":"中江", "log":"104.68", "lat":"31.06"},
{"name":"德阳", "log":"104.37", "lat":"31.13"},
{"name":"绵竹", "log":"104.19", "lat":"31.32"},
{"name":"安县", "log":"104.41", "lat":"31.64"},
{"name":"北川", "log":"104.44", "lat":"31.89"},
{"name":"内江", "log":"105.04", "lat":"29.59"},
{"name":"乐至", "log":"105.02", "lat":"30.3"},
{"name":"安岳", "log":"105.3", "lat":"30.12"},
{"name":"威远", "log":"104.7", "lat":"29.57"},
{"name":"资中", "log":"104.85", "lat":"29.81"},
{"name":"资阳", "log":"104.6", "lat":"30.19"},
{"name":"简阳", "log":"104.53", "lat":"30.38"},
{"name":"隆昌", "log":"105.25", "lat":"29.64"},
{"name":"宜宾", "log":"104.56", "lat":"29.77"},
{"name":"富顺", "log":"104.97", "lat":"29.24"},
{"name":"南溪", "log":"104.96", "lat":"28.87"},
{"name":"江安", "log":"105.06", "lat":"28.71"},
{"name":"纳溪", "log":"105.38", "lat":"28.77"},
{"name":"泸县", "log":"105.46", "lat":"28.96"},
{"name":"合江", "log":"105.78", "lat":"28.79"},
{"name":"泸州", "log":"105.39", "lat":"28.91"},
{"name":"古蔺", "log":"105.79", "lat":"28.03"},
{"name":"叙水", "log":"105.44", "lat":"28.19"},
{"name":"长宁", "log":"104.91", "lat":"28.6"},
{"name":"兴文", "log":"105.06", "lat":"28.36"},
{"name":"琪县", "log":"104.81", "lat":"28.38"},
{"name":"高县", "log":"104.52", "lat":"28.4"},
{"name":"筠连", "log":"104.53", "lat":"28.16"},
{"name":"屏由", "log":"104.15", "lat":"28.68"},
{"name":"乐由", "log":"103.73", "lat":"29.59"},
{"name":"夹江", "log":"103.59", "lat":"29.75"},
{"name":"洪雅", "log":"103.38", "lat":"29.95"},
{"name":"丹棱", "log":"103.53", "lat":"30.04"},
{"name":"青神", "log":"103.81", "lat":"29.86"},
{"name":"眉由", "log":"103.81", "lat":"30.05"},
{"name":"彭由", "log":"103.83", "lat":"30.22"},
{"name":"井研", "log":"104.06", "lat":"29.67"},
{"name":"仁寿", "log":"104.09", "lat":"30"},
{"name":"犍为", "log":"103.93", "lat":"29.21"},
{"name":"沐川", "log":"103.98", "lat":"28.96"},
{"name":"娥眉", "log":"103.5", "lat":"29.62"},
{"name":"马边", "log":"103.53", "lat":"28.87"},
{"name":"峨边", "log":"103.25", "lat":"29.23"},
{"name":"金口", "log":"103.13", "lat":"29.24"},
{"name":"涪陵", "log":"107.36", "lat":"29.7"},
{"name":"垫江", "log":"107.34", "lat":"30.36"},
{"name":"丰都", "log":"107.7", "lat":"29.89"},
{"name":"石柱", "log":"108.13", "lat":"29.98"},
{"name":"秀山", "log":"108.97", "lat":"28.47"},
{"name":"西阳", "log":"108.75", "lat":"28.85"},
{"name":"黔江", "log":"108.81", "lat":"29.53"},
{"name":"彭水", "log":"108.19", "lat":"29.29"},
{"name":"武隆", "log":"108.72", "lat":"29.29"},
{"name":"南川", "log":"107.13", "lat":"29.15"},
{"name":"万县", "log":"108.35", "lat":"30.83"},
{"name":"开县", "log":"108.39", "lat":"31.23"},
{"name":"城口", "log":"108.67", "lat":"31.98"},
{"name":"巫溪", "log":"109.6", "lat":"31.42"},
{"name":"巫山", "log":"109.86", "lat":"31.1"},
{"name":"奉节", "log":"109.52", "lat":"31.06"},
{"name":"云阳", "log":"108.89", "lat":"30.99"},
{"name":"忠县", "log":"108.03", "lat":"30.33"},
{"name":"梁平", "log":"107.78", "lat":"30.66"},
{"name":"南允", "log":"106.06", "lat":"30.8"},
{"name":"苍溪", "log":"105.96", "lat":"31.75"},
{"name":"阆中", "log":"105.97", "lat":"31.75"},
{"name":"仪陇", "log":"106.38", "lat":"31.52"},
{"name":"南部", "log":"106.03", "lat":"31.34"},
{"name":"西允", "log":"105.84", "lat":"31.01"},
{"name":"营山", "log":"106.57", "lat":"31.07"},
{"name":"蓬安", "log":"106.44", "lat":"31.04"},
{"name":"广安", "log":"106.61", "lat":"30.48"},
{"name":"岳池", "log":"106.43", "lat":"30.55"},
{"name":"武胜", "log":"106.3", "lat":"30.38"},
{"name":"华云", "log":"106.74", "lat":"30.41"},
{"name":"达县", "log":"107.49", "lat":"31.23"},
{"name":"万源", "log":"108.06", "lat":"32.07"},
{"name":"宜汉", "log":"107.71", "lat":"31.39"},
{"name":"开江", "log":"107.87", "lat":"31.1"},
{"name":"邻水", "log":"106.91", "lat":"30.36"},
{"name":"大竹", "log":"107.21", "lat":"30.75"},
{"name":"渠县", "log":"106.94", "lat":"30.85"},
{"name":"南江", "log":"106.83", "lat":"32.36"},
{"name":"巴中", "log":"106.73", "lat":"31.86"},
{"name":"平昌", "log":"107.11", "lat":"31.59"},
{"name":"通江", "log":"108.24", "lat":"31.95"},
{"name":"百沙", "log":"108.18", "lat":"32"},
{"name":"雅安", "log":"102.97", "lat":"29.97"},
{"name":"芦山", "log":"102.91", "lat":"30.17"},
{"name":"名山", "log":"103.06", "lat":"30.09"},
{"name":"荣经", "log":"102.81", "lat":"29.79"},
{"name":"汉源", "log":"102.66", "lat":"29.4"},
{"name":"石棉", "log":"102.38", "lat":"29.21"},
{"name":"天全", "log":"102.78", "lat":"30.09"},
{"name":"宝兴", "log":"102.84", "lat":"30.36"},
{"name":"马尔康", "log":"102.22", "lat":"31.92"},
{"name":"红原", "log":"102.55", "lat":"31.79"},
{"name":"阿坝", "log":"101.72", "lat":"31.93"},
{"name":"若尔盖", "log":"102.94", "lat":"33.62"},
{"name":"黑水", "log":"102.95", "lat":"32.06"},
{"name":"松潘", "log":"103.61", "lat":"32.64"},
{"name":"南坪", "log":"104.19", "lat":"33.23"},
{"name":"汶川", "log":"103.61", "lat":"31.46"},
{"name":"理县", "log":"103.16", "lat":"31.42"},
{"name":"小金", "log":"102.34 ", "lat":"30.97"},
{"name":"金川 ", "log":"102.03", "lat":"31.48"},
{"name":"壤塘", "log":"100.97", "lat":"32.3"},
{"name":"茂汶", "log":"103.89", "lat":"31.67"},
{"name":"康定", "log":"101.95", "lat":"30.04"},
{"name":"炉霍", "log":"100.65", "lat":"31.38"},
{"name":"甘孜", "log":"99.96", "lat":"31.64"},
{"name":"新龙", "log":"100.28", "lat":"30.96"},
{"name":"白玉", "log":"98.83", "lat":"32.23"},
{"name":"德格", "log":"98.57", "lat":"31.81"},
{"name":"石渠", "log":"98.06", "lat":"33.01"},
{"name":"色达", "log":"100.35", "lat":"32.3"},
{"name":"泸定", "log":"102.25", "lat":"29.92"},
{"name":"丹巴", "log":"101.87", "lat":"30.85"},
{"name":"九龙", "log":"101.53", "lat":"29.01"},
{"name":"雅江", "log":"101", "lat":"30.03"},
{"name":"道孚", "log":"101.14", "lat":"30.99"},
{"name":"理塘", "log":"100.28", "lat":"30.03"},
{"name":"乡城", "log":"99.78", "lat":"28.93"},
{"name":"稻城", "log":"100.31", "lat":"29.04"},
{"name":"巴塘", "log":"99", "lat":"30"},
{"name":"得荣", "log":"99.25", "lat":"28.71"},
{"name":"西昌", "log":"102.29", "lat":"27.92"},
{"name":"昭觉", "log":"102.83", "lat":"28.03"},
{"name":"甘洛", "log":"102.74", "lat":"28.96"},
{"name":"雷波", "log":"103.62", "lat":"28.21"},
{"name":"宁南", "log":"102.76", "lat":"27.07"},
{"name":"会东", "log":"102.55", "lat":"26.74"},
{"name":"会理", "log":"102.21", "lat":"26.67"},
{"name":"德昌", "log":"102.15", "lat":"27.4"},
{"name":"美姑", "log":"103.14", "lat":"28.33"},
{"name":"金阳", "log":"103.22", "lat":"27.73"},
{"name":"布拖", "log":"102.8", "lat":"27.7"},
{"name":"普格", "log":"102.52", "lat":"27.38"},
{"name":"喜德", "log":"102.42", "lat":"28.33"},
{"name":"越西", "log":"102.49", "lat":"28.66"},
{"name":"盐源", "log":"101.51", "lat":"27.42"},
{"name":"冕宁", "log":"102.15", "lat":"28.58"},
{"name":"木里", "log":"101.25", "lat":"27.9"}
]},
{"name":"贵州省", "log":"106.71", "lat":"26.57", "children":[
{"name":"贵阳", "log":"106.71", "lat":"26.57"},
{"name":"六盘水", "log":"104.82", "lat":"26.58"},
{"name":"水城", "log":"104.82", "lat":"26.58"},
{"name":"盘县", "log":"104.64", "lat":"25.81"},
{"name":"六枝", "log":"105.47", "lat":"26.21"},
{"name":"遵义", "log":"106.9", "lat":"27.7"},
{"name":"绥阳", "log":"107.19", "lat":"27.95"},
{"name":"道真", "log":"107.6", "lat":"28.89"},
{"name":"凤冈", "log":"107.72", "lat":"27.97"},
{"name":"余庆", "log":"107.88", "lat":"27.22"},
{"name":"赤水", "log":"105.69", "lat":"28.57"},
{"name":"桐梓", "log":"106.8", "lat":"28.16"},
{"name":"正安", "log":"107.43", "lat":"28.56"},
{"name":"务川", "log":"107.87", "lat":"28.54"},
{"name":"湄潭", "log":"107.5", "lat":"27.76"},
{"name":"仁怀", "log":"106.41", "lat":"27.81"},
{"name":"习水", "log":"106.2", "lat":"28.33"},
{"name":"铜仁", "log":"109.21", "lat":"27.73"},
{"name":"玉屏", "log":"108.91", "lat":"27.24"},
{"name":"思南", "log":"108.23", "lat":"27.94"},
{"name":"德江", "log":"108.13", "lat":"28.27"},
{"name":"万山", "log":"109.2", "lat":"27.52"},
{"name":"江口", "log":"108.82", "lat":"27.68"},
{"name":"师阡", "log":"108.24", "lat":"27.52"},
{"name":"印江", "log":"108.41", "lat":"28.02"},
{"name":"沿河", "log":"108.48", "lat":"28.57"},
{"name":"松桃", "log":"109.18", "lat":"28.17"},
{"name":"毕节", "log":"105.29", "lat":"27.32"},
{"name":"黔西", "log":"106.04", "lat":"27.03"},
{"name":"织金", "log":"105.76", "lat":"26.66"},
{"name":"赫章", "log":"104.71", "lat":"27.13"},
{"name":"大方", "log":"105.61", "lat":"27.16"},
{"name":"金沙", "log":"106.22", "lat":"27.46"},
{"name":"钠雍", "log":"105.38", "lat":"26.77"},
{"name":"威宁", "log":"104.28", "lat":"26.87"},
{"name":"安顺", "log":"105.92", "lat":"26.25"},
{"name":"息烽", "log":"106.73", "lat":"27.1"},
{"name":"清镇", "log":"106.46", "lat":"26.56"},
{"name":"普定", "log":"105.75", "lat":"26.32"},
{"name":"开阳", "log":"106.95", "lat":"27.06"},
{"name":"修文", "log":"106.59", "lat":"26.84"},
{"name":"平坝", "log":"106.26", "lat":"26.42"},
{"name":"镇宁", "log":"105.75", "lat":"26.08"},
{"name":"紫云", "log":"106.06", "lat":"25.75"},
{"name":"关岭", "log":"105.62", "lat":"25.94"},
{"name":"兴义", "log":"104.91", "lat":"25.1"},
{"name":"普安", "log":"104.96", "lat":"25.79"},
{"name":"贞丰", "log":"105.63", "lat":"25.39"},
{"name":"望谟", "log":"106.09", "lat":"25.17"},
{"name":"册亭", "log":"105.79", "lat":"25"},
{"name":"安龙", "log":"105.49", "lat":"25.11"},
{"name":"兴仁", "log":"105.18", "lat":"25.44"},
{"name":"晴龙", "log":"105.21", "lat":"25.83"},
{"name":"凯里", "log":"107.97", "lat":"26.59"},
{"name":"施秉", "log":"108.11", "lat":"27.03"},
{"name":"镇远", "log":"108.41", "lat":"27.06"},
{"name":"天柱", "log":"109.2", "lat":"26.89"},
{"name":"剑河", "log":"108.58", "lat":"26.64"},
{"name":"黎平", "log":"109.14", "lat":"26.24"},
{"name":"从江", "log":"108.9", "lat":"25.76"},
{"name":"麻江", "log":"107.58", "lat":"26.49"},
{"name":"黄平", "log":"107.89", "lat":"26.89"},
{"name":"三穗", "log":"108.68", "lat":"26.98"},
{"name":"岑巩", "log":"108.72", "lat":"27.21"},
{"name":"锦屏", "log":"109.18", "lat":"26.7"},
{"name":"台江", "log":"108.32", "lat":"26.68"},
{"name":"榕江", "log":"108.5", "lat":"25.94"},
{"name":"雷山", "log":"108.07", "lat":"26.38"},
{"name":"丹寨", "log":"107.79", "lat":"26.21"},
{"name":"都匀", "log":"107.53", "lat":"26.72"},
{"name":"贵定", "log":"107.22", "lat":"26.58"},
{"name":"瓮安", "log":"107.48", "lat":"27.08"},
{"name":"平塘", "log":"107.55", "lat":"25.83"},
{"name":"长顺", "log":"106.45", "lat":"26.03"},
{"name":"惠水", "log":"106.66", "lat":"26.14"},
{"name":"荔波", "log":"107.88", "lat":"25.42"},
{"name":"福泉", "log":"107.51", "lat":"26.7"},
{"name":"独山", "log":"107.54", "lat":"25.84"},
{"name":"罗甸", "log":"106.74", "lat":"25.43"},
{"name":"龙里", "log":"106.98", "lat":"26.46"},
{"name":"三都", "log":"107.86", "lat":"26"}
]},
{"name":"云南省", "log":"102.73", "lat":"25.04", "children":[
{"name":"昆明", "log":"102.73", "lat":"25.04"},
{"name":"富民", "log":"102.48", "lat":"25.21"},
{"name":"晋宁", "log":"102.58", "lat":"24.68"},
{"name":"呈贡", "log":"102.79", "lat":"24.9"},
{"name":"安宁", "log":"102.44", "lat":"24.95"},
{"name":"昭通", "log":"103.7", "lat":"29.32"},
{"name":"永善", "log":"103.63", "lat":"28.22"},
{"name":"大关", "log":"103.91", "lat":"27.74"},
{"name":"彝良", "log":"104.06", "lat":"27.61"},
{"name":"鲁甸", "log":"103.54", "lat":"27.21"},
{"name":"绥江", "log":"103.97", "lat":"28.58"},
{"name":"盐津", "log":"104.28", "lat":"28.08"},
{"name":"威信", "log":"105.05", "lat":"27.85"},
{"name":"镇雄", "log":"104.86", "lat":"27.42"},
{"name":"巧家", "log":"102.92", "lat":"26.9"},
{"name":"永富", "log":"104.38", "lat":"28.62"},
{"name":"曲靖", "log":"103.79", "lat":"25.51"},
{"name":"宣威", "log":"104.09", "lat":"26.24"},
{"name":"富源", "log":"104.24", "lat":"25.67"},
{"name":"师宗", "log":"103.97", "lat":"24.85"},
{"name":"嵩明", "log":"103.03", "lat":"25.35"},
{"name":"会泽", "log":"103.27", "lat":"26.41"},
{"name":"沽益", "log":"103.82", "lat":"25.62"},
{"name":"罗平", "log":"104.3", "lat":"24.88"},
{"name":"陆良", "log":"104.64", "lat":"25.04"},
{"name":"宜良", "log":"103.12", "lat":"24.9"},
{"name":"马龙", "log":"103.61", "lat":"25.41"},
{"name":"路南", "log":"103.24", "lat":"24.77"},
{"name":"寻甸", "log":"103.25", "lat":"25.56"},
{"name":"玉溪", "log":"102.52", "lat":"24.35"},
{"name":"华宁", "log":"102.93", "lat":"24.26"},
{"name":"通海", "log":"102.75", "lat":"24.09"},
{"name":"澄江", "log":"102.91", "lat":"24.68"},
{"name":"江川", "log":"102.73", "lat":"24.27"},
{"name":"易门", "log":"102.15", "lat":"24.67"},
{"name":"元江", "log":"102", "lat":"23.59"},
{"name":"新平", "log":"101.98", "lat":"24.06"},
{"name":"峨山", "log":"102.38", "lat":"24.16"},
{"name":"思茅", "log":"101", "lat":"22.79"},
{"name":"普洱", "log":"101.03", "lat":"23.07"},
{"name":"镇沅", "log":"100.88", "lat":"23.9"},
{"name":"景东", "log":"100.82", "lat":"24.42"},
{"name":"景谷", "log":"100.71", "lat":"23.5"},
{"name":"黑江", "log":"101.71", "lat":"23.4"},
{"name":"澜沦", "log":"99.97", "lat":"22.55"},
{"name":"西盟", "log":"99.47", "lat":"22.73"},
{"name":"江城", "log":"101.88", "lat":"22.58"},
{"name":"孟连", "log":"99.55", "lat":"22.32"},
{"name":"临沦", "log":"100.09", "lat":"23.88"},
{"name":"云县", "log":"100.12", "lat":"24.44"},
{"name":"镇康", "log":"99.02", "lat":"23.92"},
{"name":"永德", "log":"99.25", "lat":"24.03"},
{"name":"凤庆", "log":"99.92", "lat":"24.58"},
{"name":"双江", "log":"99.85", "lat":"23.45"},
{"name":"沧源", "log":"99.24", "lat":"23.15"},
{"name":"耿马", "log":"99.41", "lat":"23.56"},
{"name":"保由", "log":"99.18", "lat":"25.12"},
{"name":"施甸", "log":"99.15", "lat":"24.69"},
{"name":"腾冲", "log":"98.51", "lat":"25.01"},
{"name":"昌宁", "log":"99.61", "lat":"24.82"},
{"name":"龙陵", "log":"98.7", "lat":"24.58"},
{"name":"丽江", "log":"100.25", "lat":"26.86"},
{"name":"华坪", "log":"101.24", "lat":"26.63"},
{"name":"永胜", "log":"100.76", "lat":"26.71"},
{"name":"宁蒗", "log":"100.82", "lat":"27.29"},
{"name":"文山", "log":"104.24", "lat":"23.37"},
{"name":"广南", "log":"105.09", "lat":"24.05"},
{"name":"西畴", "log":"104.68", "lat":"23.42"},
{"name":"麻栗坡", "log":"104.71", "lat":"23.12"},
{"name":"马关", "log":"104.4", "lat":"23.01"},
{"name":"丘北", "log":"104.19", "lat":"24.03"},
{"name":"砚山", "log":"104.35", "lat":"23.62"},
{"name":"富宁", "log":"105.6", "lat":"23.62"},
{"name":"个旧", "log":"102.43", "lat":"23.35"},
{"name":"弥勒", "log":"103.43", "lat":"24.41"},
{"name":"蒙自", "log":"103.41", "lat":"23.36"},
{"name":"元阳", "log":"102.81", "lat":"23.17"},
{"name":"红河", "log":"102.42", "lat":"23.35"},
{"name":"石屏", "log":"102.48", "lat":"23.73"},
{"name":"泸西", "log":"103.76", "lat":"24.52"},
{"name":"金平", "log":"103.24", "lat":"22.77"},
{"name":"开远", "log":"103.23", "lat":"23.7"},
{"name":"绿春", "log":"102.42", "lat":"23.01"},
{"name":"建水", "log":"102.79", "lat":"23.64"},
{"name":"河口", "log":"103.98", "lat":"22.52"},
{"name":"屏边", "log":"103.67", "lat":"22.68"},
{"name":"景淇", "log":"100.79", "lat":"22"},
{"name":"勐海", "log":"100.5", "lat":"21.95"},
{"name":"勐腊", "log":"101.56", "lat":"21.48"},
{"name":"楚雄", "log":"101.54", "lat":"25.01"},
{"name":"元谋", "log":"101.85", "lat":"25.7"},
{"name":"武定", "log":"102.36", "lat":"25.55"},
{"name":"禄丰", "log":"102.08", "lat":"25.15"},
{"name":"南华", "log":"101.26", "lat":"25.21"},
{"name":"大姚", "log":"101.34", "lat":"25.73"},
{"name":"永仁", "log":"101.7", "lat":"26.07"},
{"name":"禄劝", "log":"102.45", "lat":"25.58"},
{"name":"牟定", "log":"101.58", "lat":"25.32"},
{"name":"双柏", "log":"101.67", "lat":"24.68"},
{"name":"姚安", "log":"101.24", "lat":"25.4"},
{"name":"下关", "log":"100.24", "lat":"25.45"},
{"name":"剑川", "log":"99.88", "lat":"26.53"},
{"name":"洱源", "log":"99.94", "lat":"26.1"},
{"name":"宾川", "log":"100.55", "lat":"25.82"},
{"name":"弥渡", "log":"100.52", "lat":"25.34"},
{"name":"永平", "log":"99.52", "lat":"25.45"},
{"name":"鹤庆", "log":"100.18", "lat":"26.55"},
{"name":"大理", "log":"100.19", "lat":"25.69"},
{"name":"漾濞", "log":"99.98", "lat":"25.68"},
{"name":"云龙", "log":"99.39", "lat":"25.9"},
{"name":"祥云", "log":"100.56", "lat":"25.48"},
{"name":"巍山", "log":"100.33", "lat":"25.23"},
{"name":"南涧", "log":"100.51", "lat":"25.04"},
{"name":"潞西", "log":"98.6", "lat":"24.41"},
{"name":"陇川", "log":"97.96", "lat":"24.33"},
{"name":"盈江", "log":"97.93", "lat":"24.69"},
{"name":"畹町", "log":"98.08", "lat":"24.08"},
{"name":"瑞丽", "log":"97.83", "lat":"24"},
{"name":"梁河", "log":"98.3", "lat":"24.78"},
{"name":"泸水", "log":"98.82", "lat":"25.97"},
{"name":"碧江", "log":"98.95", "lat":"26.55"},
{"name":"福贡", "log":"98.92", "lat":"26.89"},
{"name":"兰坪", "log":"99.29", "lat":"26.49"},
{"name":"贡山", "log":"98.65", "lat":"27.73"},
{"name":"中甸", "log":"99.72", "lat":"27.78"},
{"name":"德钦", "log":"98.93", "lat":"28.49"},
{"name":"维西", "log":"99.27", "lat":"27.15"}

]},
{"name":"江西省", "log":"115.89", "lat":"28.68", "children":[
{"name":"南昌", "log":"115.89", "lat":"28.68"},
{"name":"新建", "log":"115.8", "lat":"28.69"},
{"name":"景德镇", "log":"117.22", "lat":"29.3"},
{"name":"萍乡", "log":"113.85", "lat":"27.6"},
{"name":"九江", "log":"115.97", "lat":"29.71"},
{"name":"彭泽", "log":"116.56", "lat":"29.9"},
{"name":"湖口", "log":"116.23", "lat":"29.75"},
{"name":"都昌", "log":"116.19", "lat":"29.29"},
{"name":"星子", "log":"116.03", "lat":"29.47"},
{"name":"永修", "log":"115.82", "lat":"29.04"},
{"name":"德安", "log":"115.75", "lat":"29.33"},
{"name":"瑞昌", "log":"115.65", "lat":"29.68"},
{"name":"武宁", "log":"115.09", "lat":"29.26"},
{"name":"修永", "log":"114.55", "lat":"29.04"},
{"name":"上饶", "log":"117.97", "lat":"28.47"},
{"name":"婺源", "log":"117.83", "lat":"29.25"},
{"name":"德兴", "log":"117.58", "lat":"28.96"},
{"name":"玉山", "log":"118.25", "lat":"28.68"},
{"name":"广丰", "log":"118.2", "lat":"28.45"},
{"name":"铅山", "log":"117.71", "lat":"28.32"},
{"name":"横峰", "log":"117.62", "lat":"28.42"},
{"name":"鹰潭", "log":"117.02", "lat":"28.23"},
{"name":"贵溪", "log":"117.2", "lat":"28.3"},
{"name":"余江", "log":"116.82", "lat":"28.22"},
{"name":"万年", "log":"117.08", "lat":"28.7"},
{"name":"乐平", "log":"117.12", "lat":"28.97"},
{"name":"波阳", "log":"116.68", "lat":"29"},
{"name":"于干", "log":"116.69", "lat":"28.7"},
{"name":"弋阳", "log":"117.43", "lat":"28.42"},
{"name":"宜春", "log":"114.38", "lat":"27.81"},
{"name":"万载", "log":"114.44", "lat":"28.11"},
{"name":"铜鼓", "log":"114.37", "lat":"28.53"},
{"name":"宜丰", "log":"114.78", "lat":"28.4"},
{"name":"上高", "log":"114.91", "lat":"28.25"},
{"name":"安义", "log":"115.55", "lat":"28.86"},
{"name":"奉新", "log":"115.38", "lat":"28.71"},
{"name":"高安", "log":"115.38", "lat":"28.42"},
{"name":"丰城", "log":"115.7", "lat":"28.19"},
{"name":"清江", "log":"115.54", "lat":"28.07"},
{"name":"新余", "log":"114.92", "lat":"27.81"},
{"name":"分宜", "log":"114.68", "lat":"27.82"},
{"name":"靖安", "log":"115.37", "lat":"28.88"},
{"name":"抚州", "log":"116.34", "lat":"28"},
{"name":"临川", "log":"116.29", "lat":"27.95"},
{"name":"金溪", "log":"116.77", "lat":"27.92"},
{"name":"资溪", "log":"117.06", "lat":"27.7"},
{"name":"黎川", "log":"116.91", "lat":"27.3"},
{"name":"南丰", "log":"116.52", "lat":"27.22"},
{"name":"南城", "log":"116.62", "lat":"27.56"},
{"name":"宜黄", "log":"116.2", "lat":"27.55"},
{"name":"崇仁", "log":"116.05", "lat":"27.75"},
{"name":"乐安", "log":"115.82", "lat":"27.44"},
{"name":"东乡", "log":"116.61", "lat":"28.23"},
{"name":"进贤", "log":"116.26", "lat":"28.37"},
{"name":"吉安", "log":"114.97", "lat":"27.12"},
{"name":"新干", "log":"115.4", "lat":"27.77"},
{"name":"峡江", "log":"115.15", "lat":"27.56"},
{"name":"吉水", "log":"115.14", "lat":"27.22"},
{"name":"永丰", "log":"115.42", "lat":"27.33"},
{"name":"泰和", "log":"114.88", "lat":"26.81"},
{"name":"万安", "log":"114.77", "lat":"26.47"},
{"name":"遂川", "log":"114.5", "lat":"26.33"},
{"name":"宁冈", "log":"113.97", "lat":"26.71"},
{"name":"永新", "log":"114.23", "lat":"26.96"},
{"name":"莲花", "log":"113.94", "lat":"27.14"},
{"name":"安福", "log":"114.62", "lat":"27.39"},
{"name":"井冈山", "log":"114.17", "lat":"26.57"},
{"name":"赣州", "log":"114.92", "lat":"25.85"},
{"name":"广昌", "log":"116.32", "lat":"26.84"},
{"name":"石城", "log":"116.32", "lat":"26.34"},
{"name":"宁都", "log":"116", "lat":"26.46"},
{"name":"兴国", "log":"115.33", "lat":"26.32"},
{"name":"于都", "log":"115.39", "lat":"25.96"},
{"name":"瑞金", "log":"116.02", "lat":"25.89"},
{"name":"会昌", "log":"115.79", "lat":"25.58"},
{"name":"安远", "log":"115.41", "lat":"25.15"},
{"name":"寻乌", "log":"115.64", "lat":"24.96"},
{"name":"定南", "log":"115.02", "lat":"24.7"},
{"name":"龙南", "log":"114.79", "lat":"24.91"},
{"name":"全南", "log":"114.53", "lat":"24.76"},
{"name":"信丰", "log":"114.94", "lat":"25.39"},
{"name":"赣县", "log":"114.02", "lat":"25.85"},
{"name":"南康", "log":"114.75", "lat":"25.66"},
{"name":"上犹", "log":"114.55", "lat":"25.8"},
{"name":"崇义", "log":"114.31", "lat":"25.69"},
{"name":"大余", "log":"114.36", "lat":"25.39"}
]},
{"name":"陕西省", "log":"108.95", "lat":"34.27", "children":[
{"name":"西安", "log":"108.95", "lat":"34.27"},
{"name":"长安", "log":"108.97", "lat":"34.18"},
{"name":"铜川", "log":"109.11", "lat":"35.09"},
{"name":"耀县", "log":"108.98", "lat":"34.91"},
{"name":"宝鸡", "log":"107.15", "lat":"34.38"},
{"name":"凤翔", "log":"107.39", "lat":"34.53"},
{"name":"千阳", "log":"107.13", "lat":"34.65"},
{"name":"陇县", "log":"106.86", "lat":"34.91"},
{"name":"麟游", "log":"107.8", "lat":"34.69"},
{"name":"岐山", "log":"107.63", "lat":"34.46"},
{"name":"浮风", "log":"107.87", "lat":"34.38"},
{"name":"武功", "log":"108.22", "lat":"34.28"},
{"name":"眉县", "log":"107.76", "lat":"34.29"},
{"name":"太白", "log":"107.3", "lat":"34.09"},
{"name":"凤县", "log":"106.51", "lat":"33.93"},
{"name":"榆林", "log":"109.77", "lat":"38.3"},
{"name":"神木", "log":"110.51", "lat":"38.83"},
{"name":"府谷", "log":"111.07", "lat":"39.05"},
{"name":"佳县", "log":"110.48", "lat":"38.04"},
{"name":"米脂", "log":"110.23", "lat":"37.78"},
{"name":"吴堡", "log":"110.73", "lat":"37.49"},
{"name":"绥德", "log":"110.24", "lat":"37.49"},
{"name":"清涧", "log":"110.15", "lat":"37.11"},
{"name":"子洲", "log":"110.05", "lat":"37.45"},
{"name":"横山", "log":"109.32", "lat":"37.97"},
{"name":"靖边", "log":"108.79", "lat":"37.61"},
{"name":"定边", "log":"107.59", "lat":"37.6"},
{"name":"延安", "log":"109.47", "lat":"36.6"},
{"name":"安寨", "log":"109.34", "lat":"36.88"},
{"name":"子长", "log":"109.65", "lat":"37.16"},
{"name":"延川", "log":"110.18", "lat":"36.87"},
{"name":"延长", "log":"110.02", "lat":"36.59"},
{"name":"宜川", "log":"110.15", "lat":"36.04"},
{"name":"黄龙", "log":"109.86", "lat":"35.6"},
{"name":"洛川", "log":"109.42", "lat":"35.76"},
{"name":"宜君", "log":"109.11", "lat":"35.43"},
{"name":"黄陵", "log":"109.27", "lat":"35.6"},
{"name":"富县", "log":"109.37", "lat":"36"},
{"name":"甘泉", "log":"109.37", "lat":"36.29"},
{"name":"志丹", "log":"108.78", "lat":"36.84"},
{"name":"吴旗", "log":"108.22", "lat":"36.93"},
{"name":"咸阳", "log":"108.72", "lat":"34.36"},
{"name":"礼泉", "log":"108.43", "lat":"34.5"},
{"name":"永寿", "log":"108.14", "lat":"34.71"},
{"name":"彬县", "log":"108.09", "lat":"35.04"},
{"name":"长武", "log":"107.8", "lat":"35.22"},
{"name":"旬邑", "log":"108.33", "lat":"35.13"},
{"name":"淳化", "log":"108.57", "lat":"34.81"},
{"name":"泾阳", "log":"108.84", "lat":"34.53"},
{"name":"三原", "log":"108.94", "lat":"34.62"},
{"name":"高陵", "log":"109.1", "lat":"34.55"},
{"name":"户县", "log":"108.61", "lat":"34.12"},
{"name":"周至", "log":"108.22", "lat":"34.18"},
{"name":"兴平", "log":"108.49", "lat":"34.32"},
{"name":"乾县", "log":"108.25", "lat":"34.54"},
{"name":"渭南", "log":"109.5", "lat":"34.52"},
{"name":"蒲城", "log":"109.59", "lat":"34.97"},
{"name":"白水", "log":"109.6", "lat":"35.18"},
{"name":"成城", "log":"109.93", "lat":"35.2"},
{"name":"韩城", "log":"110.45", "lat":"35.47"},
{"name":"合阳", "log":"110.15", "lat":"35.24"},
{"name":"人荔", "log":"109.96", "lat":"34.82"},
{"name":"潼关", "log":"110.25", "lat":"34.56"},
{"name":"华阴", "log":"110.09", "lat":"34.58"},
{"name":"华县", "log":"109.77", "lat":"34.53"},
{"name":"蓝田", "log":"109.32", "lat":"34.17"},
{"name":"临潼", "log":"109.22", "lat":"34.38"},
{"name":"富平", "log":"109.17", "lat":"34.76"},
{"name":"商县", "log":"109.96", "lat":"33.88"},
{"name":"洛南", "log":"110.15", "lat":"34.11"},
{"name":"丹凤", "log":"110.35", "lat":"33.71"},
{"name":"商南", "log":"110.88", "lat":"33.54"},
{"name":"山阳", "log":"109.91", "lat":"33.55"},
{"name":"镇安", "log":"109.16", "lat":"33.45"},
{"name":"柞水", "log":"109.14", "lat":"33.69"},
{"name":"安康", "log":"109.02", "lat":"32.7"},
{"name":"旬阳", "log":"109.35", "lat":"32.83"},
{"name":"白河", "log":"110.06", "lat":"32.83"},
{"name":"平利", "log":"109.37", "lat":"32.41"},
{"name":"镇坪", "log":"109.51", "lat":"31.91"},
{"name":"岚皋", "log":"108.89", "lat":"32.3"},
{"name":"紫阳", "log":"108.55", "lat":"32.56"},
{"name":"汉阴", "log":"108.53", "lat":"32.9"},
{"name":"石泉", "log":"108.26", "lat":"33.05"},
{"name":"宁陕", "log":"108.33", "lat":"33.34"},
{"name":"汉中", "log":"108.04", "lat":"33.07"},
{"name":"留坝", "log":"106.95", "lat":"33.65"},
{"name":"城固", "log":"107.32", "lat":"33.16"},
{"name":"洋县", "log":"107.56", "lat":"33.23"},
{"name":"佛坪", "log":"108", "lat":"33.55"},
{"name":"西乡", "log":"107.77", "lat":"33"},
{"name":"镇巴", "log":"107.91", "lat":"32.56"},
{"name":"南郑", "log":"106.93", "lat":"33"},
{"name":"宁强", "log":"106.25", "lat":"32.82"},
{"name":"勉县", "log":"106.68", "lat":"33.16"},
{"name":"略阳", "log":"106.16", "lat":"33.34"}
]},
{"name":"青海省", "log":"101.74", "lat":"36.56", "children":[
{"name":"西宁", "log":"101.74", "lat":"36.56"},
{"name":"大通", "log":"101.67", "lat":"36.92"},
{"name":"平安", "log":"102.09", "lat":"36.47"},
{"name":"湟中", "log":"101.57", "lat":"36.49"},
{"name":"乐都", "log":"102.38", "lat":"36.49"},
{"name":"民和", "log":"102.8", "lat":"36.3"},
{"name":"湟源", "log":"101.28", "lat":"36.72"},
{"name":"互助", "log":"101.95", "lat":"36.84"},
{"name":"化隆", "log":"102.3", "lat":"36.11"},
{"name":"循化", "log":"102.46", "lat":"35.84"},
{"name":"门源", "log":"101.62", "lat":"37.37"},
{"name":"海晏", "log":"100.99", "lat":"36.89"},
{"name":"刚察", "log":"100.17", "lat":"37.32"},
{"name":"祁连", "log":"100.22", "lat":"38.2"},
{"name":"同仁", "log":"102", "lat":"35.54"},
{"name":"尖扎", "log":"102", "lat":"35.92"},
{"name":"泽库", "log":"101.5", "lat":"35.03"},
{"name":"河南", "log":"101.62", "lat":"34.75"},
{"name":"共和", "log":"100.61", "lat":"36.27"},
{"name":"贵德", "log":"101.47", "lat":"36.02"},
{"name":"贵南", "log":"100.75", "lat":"35.57"},
{"name":"同德", "log":"100.63", "lat":"35.24"},
{"name":"兴海", "log":"99.99", "lat":"35.6"},
{"name":"玛沁", "log":"100.26", "lat":"34.49"},
{"name":"甘德", "log":"99.89", "lat":"33.95"},
{"name":"久治", "log":"101.47", "lat":"33.46"},
{"name":"班玛", "log":"100.73", "lat":"32.92"},
{"name":"达日", "log":"99.68", "lat":"33.74"},
{"name":"玛多", "log":"98.26", "lat":"34.92"},
{"name":"玉树", "log":"96.97", "lat":"33.03"},
{"name":"称多", "log":"97.12", "lat":"33.35"},
{"name":"囊谦", "log":"96.47", "lat":"32.23"},
{"name":"杂多", "log":"95.3", "lat":"32.92"},
{"name":"治多", "log":"95.6", "lat":"33.86"},
{"name":"曲麻菜", "log":"95.5", "lat":"34.52"},
{"name":"格尔木", "log":"94.9", "lat":"36.41"},
{"name":"乌兰", "log":"98.46", "lat":"36.9"},
{"name":"都兰", "log":"98.13", "lat":"36.3"},
{"name":"天峻", "log":"99.03", "lat":"37.28"}
]},
{"name":"甘肃省", "log":"103.73", "lat":"36.03", "children":[
{"name":"兰州", "log":"103.73", "lat":"36.03"},
{"name":"永登", "log":"103.25", "lat":"36.73"},
{"name":"榆中", "log":"104.09", "lat":"35.87"},
{"name":"永昌", "log":"101.94", "lat":"38.23"},
{"name":"皋兰", "log":"103.97", "lat":"36.32"},
{"name":"定西", "log":"104.57", "lat":"35.57"},
{"name":"会宁", "log":"105.08", "lat":"35.72"},
{"name":"陇西", "log":"104.61", "lat":"34.98"},
{"name":"临洮", "log":"103.88", "lat":"35.39"},
{"name":"靖远", "log":"104.71", "lat":"36.54"},
{"name":"通渭", "log":"105.27", "lat":"35.24"},
{"name":"渭源", "log":"104.19", "lat":"35.17"},
{"name":"平凉", "log":"106.68", "lat":"35.51"},
{"name":"灵台", "log":"107.61", "lat":"35.1"},
{"name":"华亭", "log":"106.65", "lat":"35.21"},
{"name":"静宁", "log":"105.73", "lat":"35.51"},
{"name":"泾川", "log":"107.38", "lat":"35.31"},
{"name":"崇信", "log":"107.05", "lat":"35.27"},
{"name":"庄浪", "log":"106.06", "lat":"35.2"},
{"name":"庆阳", "log":"107.88", "lat":"36.03"},
{"name":"华池", "log":"108", "lat":"36.44"},
{"name":"庄宁", "log":"108.43", "lat":"35.5"},
{"name":"镇源", "log":"107.22", "lat":"35.7"},
{"name":"环县", "log":"107.33", "lat":"36.57"},
{"name":"合水", "log":"108.02", "lat":"35.81"},
{"name":"宁县", "log":"107.94", "lat":"35.17"},
{"name":"天水", "log":"105.69", "lat":"34.6"},
{"name":"徽县", "log":"106.11", "lat":"33.78"},
{"name":"礼县", "log":"105.15", "lat":"34.22"},
{"name":"武山", "log":"104.88", "lat":"34.69"},
{"name":"秦安", "log":"105.69", "lat":"34.89"},
{"name":"清水", "log":"106.12", "lat":"34.73"},
{"name":"两当", "log":"106.28", "lat":"33.9"},
{"name":"西和", "log":"105.28", "lat":"34.02"},
{"name":"甘谷", "log":"105.35", "lat":"34.7"},
{"name":"漳县", "log":"104.48", "lat":"34.87"},
{"name":"张家川", "log":"106.23", "lat":"35"},
{"name":"武都", "log":"104.94", "lat":"33.43"},
{"name":"宕昌", "log":"104.38", "lat":"34.06"},
{"name":"康县", "log":"105.58", "lat":"33.33"},
{"name":"成县", "log":"105.7", "lat":"33.75"},
{"name":"文县", "log":"104.7", "lat":"32.95"},
{"name":"临潭", "log":"103.35", "lat":"34.69"},
{"name":"舟曲", "log":"104.38", "lat":"33.81"},
{"name":"玛曲", "log":"102.04", "lat":"33.97"},
{"name":"下河", "log":"102.46", "lat":"35.21"},
{"name":"卓尼", "log":"103.54", "lat":"34.61"},
{"name":"迭部", "log":"103.23", "lat":"34.08"},
{"name":"碌曲", "log":"102.5", "lat":"34.6"},
{"name":"临夏", "log":"103.22", "lat":"35.62"},
{"name":"永靖", "log":"103.34", "lat":"35.97"},
{"name":"和政", "log":"103.31", "lat":"35.43"},
{"name":"康乐", "log":"103.68", "lat":"35.39"},
{"name":"广河", "log":"103.54", "lat":"35.46"},
{"name":"东乡", "log":"103.39", "lat":"35.68"},
{"name":"岷县", "log":"104.04", "lat":"34.41"},
{"name":"积石山", "log":"102.85", "lat":"35.74"},
{"name":"武威", "log":"102.61", "lat":"37.94"},
{"name":"民勤", "log":"103.08", "lat":"38.62"},
{"name":"古浪", "log":"102.86", "lat":"37.43"},
{"name":"景泰", "log":"104.05", "lat":"37.14"},
{"name":"天祝", "log":"102.84", "lat":"37.24"},
{"name":"张掖", "log":"100.46", "lat":"38.93"},
{"name":"民乐", "log":"100.85", "lat":"38.43"},
{"name":"临泽", "log":"100.17", "lat":"39.14"},
{"name":"山丹", "log":"101.19", "lat":"38.79"},
{"name":"高台", "log":"99.84", "lat":"39.14"},
{"name":"肃南", "log":"99.57", "lat":"38.86"},
{"name":"玉门", "log":"97.58", "lat":"39.81"},
{"name":"酒泉", "log":"98.5", "lat":"39.71"},
{"name":"敦煌", "log":"94.71", "lat":"40.13"},
{"name":"金塔", "log":"98.92", "lat":"39.97"},
{"name":"安西", "log":"95.77", "lat":"40.51"},
{"name":"阿克塞", "log":"94.25", "lat":"38.46"},
{"name":"肃北", "log":"94.89", "lat":"39.49"}
]},
{"name":"广西壮族自治区", "log":"108.54", "lat":"23.59", "children":[
{"name":"南宁", "log":"108.33", "lat":"22.84"},
{"name":"柳州", "log":"109.4", "lat":"24.33"},
{"name":"桂林", "log":"110.28", "lat":"25.29"},
{"name":"梧州", "log":"111.34", "lat":"23.51"},
{"name":"凭祥", "log":"106.75", "lat":"22.11"},
{"name":"邕宁", "log":"108.49", "lat":"22.74"},
{"name":"武鸣", "log":"108.27", "lat":"23.17"},
{"name":"马山", "log":"108.2", "lat":"23.73"},
{"name":"上林", "log":"108.59", "lat":"23.44"},
{"name":"宾阳", "log":"108.8", "lat":"23.22"},
{"name":"横县", "log":"109.2", "lat":"22.69"},
{"name":"扶绥", "log":"107.92", "lat":"22.65"},
{"name":"崇左", "log":"107.37", "lat":"22.42"},
{"name":"宁明", "log":"107.08", "lat":"22.12"},
{"name":"龙州", "log":"106.84", "lat":"22.36"},
{"name":"大新", "log":"107.21", "lat":"22.85"},
{"name":"天等", "log":"107.12", "lat":"23.08"},
{"name":"隆安", "log":"107.68", "lat":"23.18"},
{"name":"河池", "log":"108.06", "lat":"24.7"},
{"name":"环江", "log":"108.26", "lat":"24.83"},
{"name":"罗城", "log":"108.9", "lat":"24.79"},
{"name":"宜山", "log":"108.64", "lat":"24.47"},
{"name":"东兰", "log":"107.36", "lat":"24.53"},
{"name":"凤山", "log":"107.05", "lat":"24.55"},
{"name":"天峨", "log":"107.16", "lat":"25.01"},
{"name":"南丹", "log":"107.54", "lat":"24.98"},
{"name":"都安", "log":"108.09", "lat":"23.94"},
{"name":"巴马", "log":"107.25", "lat":"24.15"},
{"name":"合山", "log":"108.89", "lat":"23.82"},
{"name":"柳城", "log":"109.24", "lat":"24.67"},
{"name":"融安", "log":"109.37", "lat":"24.24"},
{"name":"鹿寨", "log":"109.74", "lat":"24.49"},
{"name":"象州", "log":"109.7", "lat":"23.98"},
{"name":"武宜", "log":"109.66", "lat":"23.6"},
{"name":"柳江", "log":"109.34", "lat":"24.27"},
{"name":"来宾", "log":"109.24", "lat":"23.76"},
{"name":"忻城", "log":"108.66", "lat":"24.07"},
{"name":"融水", "log":"109.24", "lat":"25.07"},
{"name":"三江", "log":"109.58", "lat":"25.8"},
{"name":"金秀", "log":"110.18", "lat":"24.14"},
{"name":"临桂", "log":"110.22", "lat":"25.22"},
{"name":"灵川", "log":"110.33", "lat":"25.42"},
{"name":"兴安", "log":"110.66", "lat":"25.6"},
{"name":"资源", "log":"110.66", "lat":"26.03"},
{"name":"全州", "log":"111.06", "lat":"25.96"},
{"name":"灌阳", "log":"111.14", "lat":"25.49"},
{"name":"恭城", "log":"110.81", "lat":"24.85"},
{"name":"平乐", "log":"110.66", "lat":"24.64"},
{"name":"荔浦", "log":"110.38", "lat":"24.51"},
{"name":"永福", "log":"109.98", "lat":"24.99"},
{"name":"龙胜", "log":"110.02", "lat":"25.78"},
{"name":"苍悟", "log":"111.22", "lat":"23.51"},
{"name":"钟山", "log":"111.3", "lat":"24.53"},
{"name":"富川", "log":"110.26", "lat":"24.83"},
{"name":"贺县", "log":"111.54", "lat":"24.44"},
{"name":"岑溪", "log":"111", "lat":"22.95"},
{"name":"藤县", "log":"110.9", "lat":"23.36"},
{"name":"蒙山", "log":"110.54", "lat":"24.22"},
{"name":"昭平", "log":"110.8", "lat":"24.18"},
{"name":"玉林", "log":"110.14", "lat":"22.64"},
{"name":"桂平", "log":"110.07", "lat":"23.38"},
{"name":"平南", "log":"110.4", "lat":"23.55"},
{"name":"容县", "log":"110.53", "lat":"22.87"},
{"name":"北流", "log":"110.33", "lat":"22.71"},
{"name":"陆川", "log":"110.25", "lat":"22.33"},
{"name":"博白", "log":"109.98", "lat":"22.27"},
{"name":"贵县", "log":"109.6", "lat":"23.11"},
{"name":"北海", "log":"109.12", "lat":"21.49"},
{"name":"钦州", "log":"108.61", "lat":"21.96"},
{"name":"灵山", "log":"109.29", "lat":"22.44"},
{"name":"浦北", "log":"109.56", "lat":"22.27"},
{"name":"合浦", "log":"109.2", "lat":"21.33"},
{"name":"上思", "log":"107.98", "lat":"22.16"},
{"name":"防城", "log":"108.35", "lat":"21.78"},
{"name":"百色", "log":"106.62", "lat":"23.91"},
{"name":"凌云", "log":"106.55", "lat":"24.35"},
{"name":"乐业", "log":"106.56", "lat":"24.78"},
{"name":"田阳", "log":"106.9", "lat":"23.75"},
{"name":"田东", "log":"107.12", "lat":"23.62"},
{"name":"平果", "log":"107.59", "lat":"23.33"},
{"name":"德保", "log":"106.6", "lat":"23.34"},
{"name":"靖西", "log":"106.41", "lat":"23.15"},
{"name":"那坡", "log":"105.85", "lat":"23.42"},
{"name":"西林", "log":"105.08", "lat":"24.51"},
{"name":"田林", "log":"106.24", "lat":"24.31"},
{"name":"隆林", "log":"105.34", "lat":"24.8"}

]},
{"name":"新疆维吾尔自治区", "log":"87.68", "lat":"43.77", "children":[
{"name":"乌鲁木齐", "log":"87.68", "lat":"43.77"},
{"name":"克拉玛依", "log":"84.77", "lat":"45.59"},
{"name":"石河子", "log":"85.94", "lat":"44.27"},
{"name":"吐鲁番", "log":"89.19", "lat":"42.91"},
{"name":"托克逊", "log":"88.63", "lat":"42.77"},
{"name":"鄯善", "log":"90.25", "lat":"42.82"},
{"name":"哈密", "log":"93.44", "lat":"42.78"},
{"name":"伊吾", "log":"94.65", "lat":"43.28"},
{"name":"巴里坤", "log":"93", "lat":"43.6"},
{"name":"库尔勒", "log":"86.06", "lat":"41.68"},
{"name":"和静", "log":"86.35", "lat":"42.31"},
{"name":"和硕", "log":"86.84", "lat":"42.23"},
{"name":"博湖", "log":"86.53", "lat":"41.95"},
{"name":"尉梨", "log":"86.24", "lat":"41.36"},
{"name":"轮台", "log":"84.25", "lat":"41.77"},
{"name":"焉耆", "log":"86.55", "lat":"42.05"},
{"name":"和田", "log":"79.94", "lat":"37.12"},
{"name":"民丰", "log":"82.63", "lat":"37.07"},
{"name":"策勒", "log":"80.78", "lat":"37.04"},
{"name":"于田", "log":"81.63", "lat":"36.86"},
{"name":"洛浦", "log":"80.17", "lat":"37.12"},
{"name":"皮山", "log":"78.29", "lat":"37.06"},
{"name":"墨玉", "log":"79.74", "lat":"37.31"},
{"name":"阿克苏", "log":"80.29", "lat":"41.15"},
{"name":"温宿", "log":"80.24", "lat":"41.29"},
{"name":"拜城", "log":"81.84", "lat":"41.82"},
{"name":"库车", "log":"82.97", "lat":"41.68"},
{"name":"新和", "log":"82.63", "lat":"41.55"},
{"name":"沙雅", "log":"82.9", "lat":"41.25"},
{"name":"阿瓦提", "log":"80.34", "lat":"40.64"},
{"name":"柯平", "log":"79.06", "lat":"40.55"},
{"name":"乌什", "log":"79.25", "lat":"41.22"},
{"name":"咯什", "log":"75.94", "lat":"39.52"},
{"name":"巴楚", "log":"78.59", "lat":"39.78"},
{"name":"枷师", "log":"76.78", "lat":"39.46"},
{"name":"乐普湖", "log":"76.67", "lat":"39.23"},
{"name":"麦盖提", "log":"77.62", "lat":"38.95"},
{"name":"莎车", "log":"77.25", "lat":"38.45"},
{"name":"泽普", "log":"77.26", "lat":"38.2"},
{"name":"叶城", "log":"77.42", "lat":"37.89"},
{"name":"疏勒", "log":"76.05", "lat":"39.41"},
{"name":"英吉沙", "log":"76.17", "lat":"38.91"},
{"name":"疏附", "log":"75.83", "lat":"39.42"},
{"name":"塔什库尔干", "log":"75.22", "lat":"75.22"},
{"name":"阿图什", "log":"76.12", "lat":"39.73"},
{"name":"阿合奇", "log":"78.55", "lat":"41.25"},
{"name":"阿克陶", "log":"75.94", "lat":"39.14"},
{"name":"乌恰", "log":"75.18", "lat":"39.7"},
{"name":"昌吉", "log":"87.31", "lat":"44.05"},
{"name":"阜康", "log":"87.94", "lat":"44.14"},
{"name":"奇台", "log":"89.52", "lat":"44.02"},
{"name":"吉木萨尔", "log":"89.14", "lat":"44"},
{"name":"米泉", "log":"87.68", "lat":"43.97"},
{"name":"玛纳斯", "log":"86.22", "lat":"44.28"},
{"name":"呼图壁", "log":"86.92", "lat":"44.18"},
{"name":"木垒", "log":"90.34", "lat":"43.8"},
{"name":"博乐", "log":"82.1", "lat":"44.93"},
{"name":"精河", "log":"82.92", "lat":"44.67"},
{"name":"温泉", "log":"81.08", "lat":"44.95"},
{"name":"伊宁", "log":"81.33", "lat":"43.91"},
{"name":"尼勒克", "log":"82.53", "lat":"43.82"},
{"name":"新源", "log":"83.27", "lat":"43.41"},
{"name":"巩留", "log":"82.23", "lat":"43.35"},
{"name":"奎屯", "log":"84.89", "lat":"44.45"},
{"name":"特克斯", "log":"81.81", "lat":"43.23"},
{"name":"昭苏", "log":"81.08", "lat":"43.15"},
{"name":"霍城", "log":"80.87", "lat":"44.07"},
{"name":"察布察尔", "log":"81.12", "lat":"43.82"},
{"name":"塔城", "log":"82.96", "lat":"46.74"},
{"name":"额敏", "log":"83.62", "lat":"46.52"},
{"name":"乌苏", "log":"84.62", "lat":"44.45"},
{"name":"托里", "log":"83.59", "lat":"45.92"},
{"name":"裕民", "log":"82.94", "lat":"46.21"},
{"name":"沙湾", "log":"85.56", "lat":"44.29"},
{"name":"和布克赛尔", "log":"85.13", "lat":"46.78"},
{"name":"阿勒泰", "log":"88.14", "lat":"47.86"},
{"name":"青河", "log":"90.37", "lat":"46.71"},
{"name":"富蕴", "log":"89.44", "lat":"47.05"},
{"name":"福海", "log":"87.51", "lat":"47.15"},
{"name":"吉木乃", "log":"85.84", "lat":"47.42"},
{"name":"布尔津", "log":"86.92", "lat":"47.7"},
{"name":"哈巴河", "log":"86.41", "lat":"48.05"}
]},
{"name":"内蒙古自治区", "log":"111.65", "lat":"40.82", "children":[
{"name":"呼和浩特", "log":"111.65", "lat":"40.82"},
{"name":"上默特左旗", "log":"111.13", "lat":"40.72"},
{"name":"托克托", "log":"111.15", "lat":"40.28"},
{"name":"包头", "log":"110", "lat":"40.58"},
{"name":"上默特右旗", "log":"110.52", "lat":"40.55"},
{"name":"固阳", "log":"110.03", "lat":"41.03"},
{"name":"乌海", "log":"106.82", "lat":"39.67"},
{"name":"集宁", "log":"113.08", "lat":"41.03"},
{"name":"兴和", "log":"113.97", "lat":"40.88"},
{"name":"清水河", "log":"111.65", "lat":"39.92"},
{"name":"武川", "log":"111.42", "lat":"41.12"},
{"name":"卓资", "log":"112.52", "lat":"40.93"},
{"name":"商都", "log":"113.53", "lat":"41.58"},
{"name":"丰镇", "log":"113.15", "lat":"40.45"},
{"name":"凉城", "log":"112.48", "lat":"40.52"},
{"name":"和林格尔", "log":"111.8", "lat":"40.4"},
{"name":"化德", "log":"114", "lat":"41.9"},
{"name":"察哈尔右翼后旗", "log":"113.15", "lat":"41.85"},
{"name":"察哈尔右翼中旗", "log":"112.62", "lat":"41.28"},
{"name":"察哈尔右翼前旗", "log":"113.18", "lat":"40.78"},
{"name":"四子王旗", "log":"111.68", "lat":"41.37"},
{"name":"达尔罕茂明安联合旗", "log":"110.42", "lat":"41.72"},
{"name":"二连浩特", "log":"111.96", "lat":"43.65"},
{"name":"阿巴哈纳尔旗", "log":"116.08", "lat":"43.95"},
{"name":"多伦", "log":"116.48", "lat":"42.18"},
{"name":"阿巴嘎旗", "log":"114.97", "lat":"44.03"},
{"name":"西乌珠穆沁旗", "log":"117.58", "lat":"44.6"},
{"name":"东乌珠穆沁旗", "log":"116.97", "lat":"45.53"},
{"name":"苏尼特左旗", "log":"113.7", "lat":"43.85"},
{"name":"苏尼特右旗", "log":"112.95", "lat":"42.47"},
{"name":"太仆寺旗", "log":"115.3", "lat":"41.9"},
{"name":"正镶白旗", "log":"115", "lat":"42.32"},
{"name":"正蓝旗", "log":"116.02", "lat":"42.25"},
{"name":"镶黄旗", "log":"113.83", "lat":"42.25"},
{"name":"海拉尔", "log":"119.73", "lat":"29.22"},
{"name":"满洲里", "log":"117.47", "lat":"49.58"},
{"name":"陈巴尔虎旗", "log":"119.45", "lat":"49.33"},
{"name":"额尔古纳右旗", "log":"120.08", "lat":"50.45"},
{"name":"额尔古纳左旗", "log":"121.52", "lat":"50.8"},
{"name":"喜桂图旗", "log":"120.73", "lat":"49.3"},
{"name":"阿荣旗", "log":"123.5", "lat":"48.13"},
{"name":"布特哈旗", "log":"122.78", "lat":"47.98"},
{"name":"新巴尔虎左旗", "log":"116.82", "lat":"48.67"},
{"name":"新巴尔虎右旗", "log":"118.23", "lat":"48.22"},
{"name":"鄂伦春自治旗", "log":"123.7", "lat":"50.58"},
{"name":"莫力达瓦达斡尔族自治旗", "log":"124.5", "lat":"48.47"},
{"name":"鄂温克族自治旗", "log":"119.75", "lat":"49.13"},
{"name":"通辽", "log":"122.28", "lat":"43.63"},
{"name":"开鲁", "log":"121.32", "lat":"43.62"},
{"name":"科尔沁左翼后旗", "log":"122.35", "lat":"42.97"},
{"name":"科尔沁左翼中旗", "log":"123.28", "lat":"44.13"},
{"name":"库伦旗", "log":"121.75", "lat":"42.72"},
{"name":"奈曼旗", "log":"120.65", "lat":"42.85"},
{"name":"扎鲁特旗", "log":"120.87", "lat":"44.55"},
{"name":"赤峰", "log":"118.87", "lat":"42.28"},
{"name":"宁城", "log":"119.32", "lat":"41.62"},
{"name":"林西", "log":"118.02", "lat":"43.62"},
{"name":"喀喇沁旗", "log":"118.67", "lat":"41.95"},
{"name":"敖汉旗", "log":"119.87", "lat":"42.3"},
{"name":"翁牛特旗", "log":"119", "lat":"42.97"},
{"name":"巴林右旗", "log":"118.65", "lat":"43.52"},
{"name":"巴林左旗", "log":"119.35", "lat":"43.98"},
{"name":"阿鲁科尔沁旗", "log":"120.05", "lat":"43.97"},
{"name":"克什克腾旗", "log":"117.48", "lat":"43.28"},
{"name":"伊克昭盟", "log":"110", "lat":"39.83"},
{"name":"东胜县", "log":"110", "lat":"39.83"},
{"name":"准格尔旗", "log":"111.13", "lat":"39.68"},
{"name":"乌审旗", "log":"109.03", "lat":"38.38"},
{"name":"伊金霍洛旗", "log":"109.77", "lat":"39.25"},
{"name":"鄂托克旗", "log":"107.97", "lat":"39.12"},
{"name":"鄂托克前旗", "log":"107.43", "lat":"38.18"},
{"name":"杭锦旗", "log":"108.7", "lat":"39.83"},
{"name":"达拉特旗", "log":"110.02", "lat":"40.42"},
{"name":"临河", "log":"107.37", "lat":"40.78"},
{"name":"五原", "log":"108.28", "lat":"41.12"},
{"name":"磴口", "log":"106.98", "lat":"40.33"},
{"name":"杭锦后旗", "log":"107.12", "lat":"40.88"},
{"name":"乌拉特中旗", "log":"108.52", "lat":"41.55"},
{"name":"乌拉特前旗", "log":"108.65", "lat":"40.75"},
{"name":"乌拉特后旗", "log":"108.52", "lat":"40.88"},
{"name":"阿拉善左旗", "log":"105.68", "lat":"38.85"},
{"name":"阿拉善右旗", "log":"101.68", "lat":"39.2"},
{"name":"额济纳旗", "log":"100.88", "lat":"41.9"},
{"name":"乌兰浩特", "log":"122.08", "lat":"46.07"},
{"name":"突泉", "log":"121.5", "lat":"45.4"},
{"name":"科尔沁右翼前旗", "log":"122.03", "lat":"46.12"},
{"name":"科尔沁右翼中旗", "log":"121.47", "lat":"45.05"}
]},
{"name":"西藏自治区", "log":"91.11", "lat":"29.97", "children":[
{"name":"拉萨", "log":"91.11", "lat":"29.97"},
{"name":"林周", "log":"91.24", "lat":"30.2"},
{"name":"当雄", "log":"91.05", "lat":"30.51"},
{"name":"墨竹工卡", "log":"91.77", "lat":"29.77"},
{"name":"尼木", "log":"90.14", "lat":"29.44"},
{"name":"米林", "log":"94.13", "lat":"29.18"},
{"name":"墨脱", "log":"95.26", "lat":"29.22"},
{"name":"达孜", "log":"91.39", "lat":"29.63"},
{"name":"曲水", "log":"90.7", "lat":"29.39"},
{"name":"堆龙德庆", "log":"90.96", "lat":"29.67"},
{"name":"林芝", "log":"94.25", "lat":"29.59"},
{"name":"工布江达", "log":"93.25", "lat":"29.92"},
{"name":"那曲", "log":"92.1", "lat":"31.47"},
{"name":"巴青", "log":"94.1", "lat":"31.96"},
{"name":"比如", "log":"93.68", "lat":"31.53"},
{"name":"班戈", "log":"90.05", "lat":"31.35"},
{"name":"嘉黎", "log":"93.46", "lat":"30.63"},
{"name":"聂荣", "log":"92.3", "lat":"31.08"},
{"name":"索县", "log":"93.71", "lat":"31.92"},
{"name":"安多", "log":"91.68", "lat":"32.29"},
{"name":"申扎", "log":"88.7", "lat":"30.94"},
{"name":"吕都", "log":"97.14", "lat":"31.18"},
{"name":"贡觉", "log":"98.29", "lat":"30.86"},
{"name":"左贡", "log":"97.9", "lat":"29.68"},
{"name":"察隅", "log":"97.49", "lat":"28.62"},
{"name":"洛隆", "log":"95.76", "lat":"30.81"},
{"name":"丁青", "log":"95.63", "lat":"31.42"},
{"name":"波密", "log":"95.75", "lat":"29.92"},
{"name":"江达", "log":"89.19", "lat":"31.53"},
{"name":"察雅", "log":"97.56", "lat":"30.69"},
{"name":"芒康", "log":"98.68", "lat":"29.64"},
{"name":"八宿", "log":"96.95", "lat":"30.04"},
{"name":"边坝", "log":"94.69", "lat":"30.94"},
{"name":"类乌齐", "log":"96.57", "lat":"31.2"},
{"name":"乃东", "log":"91.76", "lat":"29.18"},
{"name":"加查", "log":"92.6", "lat":"29.09"},
{"name":"曲松", "log":"92.11", "lat":"29.08"},
{"name":"错那", "log":"91.91", "lat":"27.98"},
{"name":"穷结", "log":"91.65", "lat":"29.04"},
{"name":"贡嘎", "log":"90.96", "lat":"29.25"},
{"name":"浪卡子", "log":"90.33", "lat":"29.96"},
{"name":"桑日", "log":"92", "lat":"29.26"},
{"name":"朗县", "log":"93.11", "lat":"29.06"},
{"name":"隆子", "log":"92.42", "lat":"28.46"},
{"name":"措美", "log":"91.4", "lat":"28.49"},
{"name":"洛扎", "log":"90.83", "lat":"28.42"},
{"name":"扎囊", "log":"91.26", "lat":"29.22"},
{"name":"日喀则", "log":"88.82", "lat":"29.28"},
{"name":"定结", "log":"87.77", "lat":"28.38"},
{"name":"拉孜", "log":"87.62", "lat":"29.1"},
{"name":"聂拉木", "log":"85.94", "lat":"28.19"},
{"name":"谢通门", "log":"88.25", "lat":"29.43"},
{"name":"仲巴", "log":"84.15", "lat":"29.66"},
{"name":"康马", "log":"89.67", "lat":"28.57"},
{"name":"亚东", "log":"88.93", "lat":"27.55"},
{"name":"岗巴", "log":"88.5", "lat":"28.29"},
{"name":"南木林", "log":"89.02", "lat":"29.71"},
{"name":"萨迦", "log":"88", "lat":"28.87"},
{"name":"定日", "log":"87.11", "lat":"28.57"},
{"name":"吉隆", "log":"85.29", "lat":"28.94"},
{"name":"昂仁", "log":"87.22", "lat":"29.3"},
{"name":"江孜", "log":"89.63", "lat":"28.94"},
{"name":"仁布", "log":"89.77", "lat":"29.21"},
{"name":"白朗", "log":"89.16", "lat":"29.11"},
{"name":"萨嘎", "log":"85.3", "lat":"29.38"},
{"name":"噶尔", "log":"80", "lat":"32.08"},
{"name":"革吉", "log":"81.13", "lat":"32.45"},
{"name":"扎达", "log":"79.76", "lat":"31.47"},
{"name":"措勤", "log":"85.16", "lat":"31.06"},
{"name":"日上", "log":"79.61", "lat":"33.44"},
{"name":"改则", "log":"84.1", "lat":"32.33"},
{"name":"普兰", "log":"81.18", "lat":"30.37"}
]},
{"name":"宁夏回族自治区", "log":"106.27", "lat":"38.47", "children":[
{"name":"银川", "log":"106.27", "lat":"38.47"},
{"name":"永宁", "log":"106.24", "lat":"38.28"},
{"name":"贺兰", "log":"106.35", "lat":"38.55"},
{"name":"石嘴山", "log":"106.39", "lat":"39.04"},
{"name":"平罗", "log":"106.54", "lat":"38.91"},
{"name":"陶乐", "log":"106.69", "lat":"38.82"},
{"name":"吴忠", "log":"106.21", "lat":"37.99"},
{"name":"同心", "log":"105.94", "lat":"36.97"},
{"name":"灵武", "log":"106.34", "lat":"38.1"},
{"name":"中宁", "log":"105.66", "lat":"37.48"},
{"name":"盐池", "log":"107.41", "lat":"37.78"},
{"name":"中卫", "log":"105.18", "lat":"37.51"},
{"name":"青铜峡", "log":"106.07", "lat":"38.02"},
{"name":"固原", "log":"106.28", "lat":"36.01"},
{"name":"西吉", "log":"105.7", "lat":"35.97"},
{"name":"泾源", "log":"106.33", "lat":"35.5"},
{"name":"海原", "log":"105.64", "lat":"36.56"},
{"name":"隆德", "log":"106.11", "lat":"35.63"}
]},
{"name":"中国台湾", "log":"121.5", "lat":"25.14", "children":[

]},
{"name":"中国香港", "log":"114.1", "lat":"22.2", "children":[
{"name":"香港", "log":"114.1", "lat":"22.2"}
]},
{"name":"中国澳门", "log":"113.33", "lat":"22.13", "children":[
{"name":"澳门", "log":"113.33", "lat":"22.13"}
]},
{"name":"安徽省", "log":"117.27", "lat":"31.86", "children":[
{"name":"合肥", "log":"117.27", "lat":"31.86"},
{"name":"长丰", "log":"117.16", "lat":"32.47"},
{"name":"淮南", "log":"116.98", "lat":"32.62"},
{"name":"凤台", "log":"116.71", "lat":"32.68"},
{"name":"淮北", "log":"116.77", "lat":"33.97"},
{"name":"濉溪", "log":"116.76", "lat":"33.92"},
{"name":"芜湖", "log":"118.38", "lat":"31.33"},
{"name":"铜陵", "log":"117.82", "lat":"30.93"},
{"name":"蚌埠", "log":"117.34", "lat":"32.93"},
{"name":"马鞍山", "log":"118.48", "lat":"31.56"},
{"name":"安庆", "log":"117.03", "lat":"30.52"},
{"name":"宿州", "log":"116.97", "lat":"33.63"},
{"name":"宿县", "log":"116.97", "lat":"33.63"},
{"name":"砀山", "log":"116.34", "lat":"34.42"},
{"name":"萧县", "log":"116.93", "lat":"34.19"},
{"name":"吴壁", "log":"117.55", "lat":"33.55"},
{"name":"泗县", "log":"117.89", "lat":"33.49"},
{"name":"五河", "log":"117.87", "lat":"33.14"},
{"name":"固镇", "log":"117.32", "lat":"33.33"},
{"name":"怀远", "log":"117.19", "lat":"32.95"},
{"name":"滁州", "log":"118.31", "lat":"32.33"},
{"name":"嘉山", "log":"117.98", "lat":"32.78"},
{"name":"天长", "log":"119", "lat":"32.68"},
{"name":"来安", "log":"118.44", "lat":"32.44"},
{"name":"全椒", "log":"118.27", "lat":"32.1"},
{"name":"定远", "log":"117.68", "lat":"32.52"},
{"name":"凤阳", "log":"117.4", "lat":"32.86"},
{"name":"巢湖", "log":"117.87", "lat":"31.62"},
{"name":"巢县", "log":"117.87", "lat":"31.62"},
{"name":"肥东", "log":"117.47", "lat":"31.89"},
{"name":"含山", "log":"118.11", "lat":"31.7"},
{"name":"和县", "log":"118.37", "lat":"31.7"},
{"name":"无为", "log":"117.75", "lat":"31.3"},
{"name":"卢江", "log":"117.29", "lat":"31.23"},
{"name":"宣城", "log":"118.73", "lat":"31.95"},
{"name":"当涂", "log":"118.49", "lat":"31.55"},
{"name":"郎溪", "log":"119.17", "lat":"31.14"},
{"name":"广德", "log":"119.41", "lat":"30.89"},
{"name":"泾县", "log":"118.41", "lat":"30.68"},
{"name":"南陵", "log":"118.32", "lat":"30.91"},
{"name":"繁昌", "log":"118.21", "lat":"31.07"},
{"name":"宁国", "log":"118.95", "lat":"30.62"},
{"name":"青阳", "log":"117.84", "lat":"30.64"},
{"name":"屯溪", "log":"118.31", "lat":"29.72"},
{"name":"休宁", "log":"118.19", "lat":"29.81"},
{"name":"旌得", "log":"118.53", "lat":"30.28"},
{"name":"绩溪", "log":"118.57", "lat":"30.07"},
{"name":"歙县", "log":"118.44", "lat":"29.88"},
{"name":"祁门", "log":"117.7", "lat":"29.86"},
{"name":"黟县", "log":"117.92", "lat":"29.93"},
{"name":"太平", "log":"118.13", "lat":"30.28"},
{"name":"石台", "log":"117.48", "lat":"30.19"},
{"name":"桐城", "log":"116.94", "lat":"31.04"},
{"name":"纵阳", "log":"117.21", "lat":"30.69"},
{"name":"怀宁", "log":"116.63", "lat":"30.41"},
{"name":"望江", "log":"116.69", "lat":"30.12"},
{"name":"宿松", "log":"116.13", "lat":"30.15"},
{"name":"太湖", "log":"116.27", "lat":"30.42"},
{"name":"岳西", "log":"116.36", "lat":"30.84"},
{"name":"潜山", "log":"116.53", "lat":"30.62"},
{"name":"东至", "log":"116.99", "lat":"30.08"},
{"name":"贵池", "log":"117.48", "lat":"30.66"},
{"name":"六安", "log":"116.49", "lat":"31.73"},
{"name":"霍丘", "log":"116.27", "lat":"32.32"},
{"name":"寿县", "log":"116.78", "lat":"32.57"},
{"name":"肥西", "log":"117.15", "lat":"31.7"},
{"name":"舒城", "log":"116.94", "lat":"31.45"},
{"name":"霍山", "log":"116.32", "lat":"31.38"},
{"name":"金寨", "log":"115.87", "lat":"31.67"},
{"name":"阜阳", "log":"115.81", "lat":"32.89"},
{"name":"毫县", "log":"116.76", "lat":"33.86"},
{"name":"涡阳", "log":"116.21", "lat":"33.49"},
{"name":"蒙城", "log":"116.55", "lat":"33.25"},
{"name":"利辛", "log":"116.19", "lat":"33.12"},
{"name":"颖上", "log":"116.26", "lat":"32.62"},
{"name":"阜南", "log":"115.6", "lat":"32.63"},
{"name":"临泉", "log":"115.24", "lat":"33.06"},
{"name":"界首", "log":"115.34", "lat":"33.24"},
{"name":"太和", "log":"115.61", "lat":"33.16"}
]},
{"name":"江苏省", "log":"118.78", "lat":"32.04", "children":[
{"name":"南京", "log":"118.78", "lat":"32.04"},
{"name":"江宁", "log":"118.83", "lat":"31.95"},
{"name":"六合", "log":"118.83", "lat":"32.36"},
{"name":"江浦", "log":"118.62", "lat":"32.07"},
{"name":"徐州", "log":"117.2", "lat":"34.26"},
{"name":"连云港", "log":"119.16", "lat":"34.59"},
{"name":"南通", "log":"120.86", "lat":"32.01"},
{"name":"苏州", "log":"120.62", "lat":"31.32"},
{"name":"无锡", "log":"120.29", "lat":"31.59"},
{"name":"常州", "log":"119.95", "lat":"31.79"},
{"name":"丰县", "log":"116.57", "lat":"34.79"},
{"name":"沛县", "log":"116.93", "lat":"34.73"},
{"name":"赣榆", "log":"119.11", "lat":"34.83"},
{"name":"东海", "log":"118.75", "lat":"34.54"},
{"name":"新沂", "log":"118.33", "lat":"34.38"},
{"name":"邳县", "log":"117.97", "lat":"34.3"},
{"name":"睢宁", "log":"117.94", "lat":"33.89"},
{"name":"铜山", "log":"117.2", "lat":"34.26"},
{"name":"清江", "log":"119.02", "lat":"33.59"},
{"name":"灌云", "log":"119.23", "lat":"34.3"},
{"name":"灌南", "log":"119.36", "lat":"34.09"},
{"name":"沭阳", "log":"118.79", "lat":"34.12"},
{"name":"宿迁", "log":"118.3", "lat":"33.96"},
{"name":"泗阳", "log":"118.68", "lat":"33.73"},
{"name":"盱眙", "log":"118.05", "lat":"33"},
{"name":"涟水", "log":"119.26", "lat":"33.77"},
{"name":"淮阴", "log":"119.02", "lat":"33.62"},
{"name":"淮安", "log":"119.15", "lat":"33.5"},
{"name":"洪泽", "log":"118.85", "lat":"33.28"},
{"name":"泗洪", "log":"118.23", "lat":"33.46"},
{"name":"金湖", "log":"119.02", "lat":"33.01"},
{"name":"盐城", "log":"120.13", "lat":"33.38"},
{"name":"滨海", "log":"119.84", "lat":"34.01"},
{"name":"阜宁", "log":"119.79", "lat":"33.78"},
{"name":"射阳", "log":"120.26", "lat":"33.77"},
{"name":"建湖", "log":"119.77", "lat":"33.46"},
{"name":"响水", "log":"119.56", "lat":"34.2"},
{"name":"大丰", "log":"120.45", "lat":"33.19"},
{"name":"东台", "log":"120.31", "lat":"32.84"},
{"name":"海安", "log":"120.45", "lat":"32.57"},
{"name":"如皋", "log":"120.56", "lat":"32.39"},
{"name":"如东", "log":"121.18", "lat":"32.33"},
{"name":"启东", "log":"121.66", "lat":"31.8"},
{"name":"海门", "log":"121.15", "lat":"31.89"},
{"name":"南通", "log":"121.05", "lat":"32.08"},
{"name":"扬州", "log":"119.42", "lat":"32.39"},
{"name":"宝应", "log":"119.32", "lat":"33.23"},
{"name":"兴化", "log":"119.82", "lat":"32.93"},
{"name":"高邮", "log":"119.45", "lat":"32.78"},
{"name":"泰兴", "log":"120.02", "lat":"32.16"},
{"name":"泰县", "log":"120.15", "lat":"32.51"},
{"name":"泰州", "log":"119.9", "lat":"32.49"},
{"name":"靖江", "log":"120.26", "lat":"32.03"},
{"name":"江都", "log":"119.55", "lat":"32.43"},
{"name":"邗江", "log":"119.42", "lat":"32.39"},
{"name":"仪征", "log":"119.16", "lat":"32.27"},
{"name":"镇江", "log":"119.44", "lat":"32.2"},
{"name":"丹徒", "log":"119.44", "lat":"32.2"},
{"name":"扬中", "log":"119.81", "lat":"32.24"},
{"name":"丹阳", "log":"119.55", "lat":"32"},
{"name":"武进", "log":"119.95", "lat":"31.78"},
{"name":"宜兴", "log":"119.82", "lat":"31.36"},
{"name":"金坛", "log":"119.56", "lat":"31.74"},
{"name":"溧阳", "log":"119.48", "lat":"31.43"},
{"name":"句容", "log":"119.16", "lat":"31.95"},
{"name":"溧水", "log":"119.02", "lat":"31.65"},
{"name":"高淳", "log":"118.87", "lat":"31.32"},
{"name":"江阴", "log":"120.26", "lat":"31.91"},
{"name":"沙洲", "log":"120.55", "lat":"31.86"},
{"name":"常熟", "log":"120.74", "lat":"31.64"},
{"name":"太仓", "log":"121.1", "lat":"31.45"},
{"name":"昆山", "log":"120.95", "lat":"31.39"},
{"name":"吴县", "log":"120.62", "lat":"31.32"},
{"name":"吴江", "log":"120.63", "lat":"31.16"}
]},
{
"name": "台湾省",
"children": [
{
"name": "台北",
"log": "121.42",
"lat": "24.80"
},
{
"name": "台北市",
"log": "121.42",
"lat": "23.80"
},
{
"name": "台北市",
"log": "120.12",
"lat": "22.80"
},
{
"name": "台北市",
"log": "120.30",
"lat": "22.80"
},
{
"name": "台北市",
"log": "121.62",
"lat": "24.10"
},
{
"name": "台北市",
"log": "121.42",
"lat": "24.40"
},
{
"name": "台北市",
"log": "121.42",
"lat": "24.30"
},
{
"name": "台北市",
"log": "121.42",
"lat": "24.20"
},
{
"name": "台北市",
"log": "121.42",
"lat": "24.10"
}
]}
]
}

箭头标注

平面标注


通过使用arrow 和 startPoint来绘制出箭头和原点,之后为其设置目标点和所在点并通过 CSS 来为其设置样式即可。

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)
.attr("xmlns","http://www.w3.org/2000/svg")
.attr("version","1.1")

var projection = d3.geo.mercator()
.center([107,31])
.scale(800)
.translate([padding.width/2, padding.height/2])

var path = d3.geo.path()
.projection(projection)

var defs = svg.append("defs")

/*
* arrow
* 为箭头,箭头通过 svg 路径 arrow_path 来进行绘制出效果
* startPoint
* 为圆点,通过使用 circle 来绘制圆点
*/
var arrowMarker = defs.append("marker")
.attr("id","arrow")
.attr("markerUnits","strokeWidth")
.attr("markerWidth","12")
.attr("markerHeight","12")
.attr("viewBox","0 0 12 12")
.attr("refX","6")
.attr("refY","6")
.attr("orient","auto");

var arrow_path = "M2,2 L10,6 L2,10 L6,6 L2,2";

arrowMarker.append("path")
.attr("d",arrow_path)
.attr("fill","#179F94")

var startMarkder = defs.append("marker")
.attr("id","startPoint")
.attr("markerUnits","strokeWidth")
.attr("markerWidth","12")
.attr("markerHeight","12")
.attr("viewBox","0 0 12 12")
.attr("refX","6")
.attr("refY","6")
.attr("orient","auto");

startMarkder.append("circle")
.attr("cx",6)
.attr("cy",6)
.attr("r",2)
.attr("fill","#179F94");

/*
* 绘制地图
*/
d3.json("./china_topo.json", function (error, toporoot) {
if (error)
return console.log(error)
var georoot = topojson.feature(toporoot,toporoot.objects.china)

var china = svg.append("g")
var provinces = china.selectAll("path")
.data(georoot.features)
.enter()
.append("path")
.attr("class","province")
.attr("d",path)

/*
* peking
* 为目标点
* guilin
* 当前所在点
*/
var peking = projection([116.3,39.9])
var guilin = projection([110.3,25.3])

svg.append("line")
.attr("class","route")
.attr("x1",guilin[0])
.attr("y1",guilin[1])
.attr("x2",peking[0])
.attr("y2",peking[1])
.attr("marker-end","url(#arrow)")
.attr("marker-start","url(#startPoint)")
})

CSS

1
2
3
4
5
6
7
8
9
10
11
.province {
fill: transparent;
stroke: #73b9b2;
stroke-width: 1px;
}

.route {
stroke: #179f94;
stroke-width: 1px;
fill: #179F94;
}

球面标注


与平面标注不同类似,但本次我们需要创建一个GeoJSON个是的JSON类型对象,来满足你让他更加立体的特殊需求。

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)
.attr("xmlns","http://www.w3.org/2000/svg")
.attr("version","1.1")

var orthographic = d3.geo.orthographic()
.scale(420)
.rotate([-160,-40,0])
.clipAngle(90)
.translate([padding.width/2, padding.height/2])

var path = d3.geo.path()
.projection(orthographic)

var graticule = d3.geo.graticule()
.extent([[-180,-90],[180,90]])
.step([10,10])

svg.append("path")
.attr("class","graticule")
.attr("d",path(graticule()))

var defs = svg.append("defs")

/*
* arrow
* 为箭头,箭头通过 svg 路径 arrow_path 来进行绘制出效果
* startPoint
* 为圆点,通过使用 circle 来绘制圆点
*/
var arrowMarker = defs.append("marker")
.attr("id","arrow")
.attr("markerUnits","strokeWidth")
.attr("markerWidth","12")
.attr("markerHeight","12")
.attr("viewBox","0 0 12 12")
.attr("refX","6")
.attr("refY","6")
.attr("orient","auto");

var arrow_path = "M2,2 L10,6 L2,10 L6,6 L2,2";

arrowMarker.append("path")
.attr("d",arrow_path)
.attr("fill","#179F94")

var startMarkder = defs.append("marker")
.attr("id","startPoint")
.attr("markerUnits","strokeWidth")
.attr("markerWidth","12")
.attr("markerHeight","12")
.attr("viewBox","0 0 12 12")
.attr("refX","6")
.attr("refY","6")
.attr("orient","auto");

startMarkder.append("circle")
.attr("cx",6)
.attr("cy",6)
.attr("r",2)
.attr("fill","#179F94");

/*
* 绘制地图
*/
d3.json("./world-continents.geo.json", function (error, root) {
if (error)
return console.log(error)

var groups = svg.append("g")
groups.selectAll("path")
.data(root.features)
.enter()
.append("path")
.attr("class","province")
.attr("d",path)

/*
* pekingToWashington
* 创建一个 GeoJSON 格式的 “LineString” 的GeoJson对象
* 并在此写入一个 北京 和 华盛顿 的经纬度,也可以设置多个经纬度让连线更加的真实
*/
var pekingToWashington = {
type: "LineString",
coordinates: [
[116.4,39.9], /*[146.4, 39.7] , [176.4, 39.5],
[-150.4, 39.3], [-110.4, 39.1],*/ [-77.0,38.9]
]
}

svg.append("path")
.attr("class","route")
.attr("d", path(pekingToWashington))
.attr("marker-start","url(#startPoint)")
.attr("marker-end","url(#arrow)")
})

CSS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
.province {
fill: transparent;
stroke: #73b9b2;
stroke-width: 1px;
}

.route {
stroke: blue;
stroke-width: 1px;
fill: transparent;
}

.graticule {
fill: transparent;
stroke: #dddddd;
stroke-width: 1px;
}

地图的缩放

平面地图


首先定义一个初始的平移量(Translate)和缩放量(Scale),并添加一个 behavior zoom 滚轮缩放事件。

通过 behavior 事件来通过更新平移量和缩放量,之后来更新投影的缩放量和重新绘制经纬线。

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)

var projection = d3.geo.mercator()
.center([0,0])
.scale(120)
.translate([padding.width/2,padding.height/2])

var path = d3.geo.path()
.projection(projection)

/*
* min 是一个极小值,来防止没有没有边界线的问题
*/ var min = 1e-4;

/*
* 创建网格生成器,生成网格
* 通过最后的 grid 来进行绑定数据进行绘制。
*/
var graticule = d3.geo.graticule()
/* 经度范围为 -180~180,纬度范围是-90~90*/
.extent([[-180,-90],[180+min,90]])
.step([10,10])

var grid = graticule()
var gridPath = svg.append("path")
.datum(grid)
.attr("class","graticule")
.attr("d",path);


/*
* 绘制地图
*/
d3.json("./world-continents.geo.json", function (error, root) {
if (error)
return console.error(error)

var groups = svg.append("g")

var countries = groups.selectAll("path")
.data(root.features)
.enter()
.append("path")
.attr("class","province")
.attr("d",path)

/*
*`initTran
* 设置初始的平移量
* initScale
* 设置地图的缩放量(比例尺)
*/
var initTran = projection.translate()
var initScale = projection.scale()

/*
* scaleExtent
* 地图的缩放范围
* .on
* 通过获取鼠标的滚轮(zoon)事件
* 地图的初始平移量和初始缩放量来进行更新
* 通过使用 projection.sclae 来更新投影的缩放量
* 并使用 attr、gridPath 重新绘制地图和经纬线网络
*/
var zoom = d3.behavior.zoom()
.scaleExtent([1,10])
.on("zoom", function (d) {
projection.translate([
initTran[0] + d3.event.translate[0],
initTran[1] + d3.event.translate[1]
])
projection.scale(initScale * d3.event.scale)
countries.attr("d", path)

gridPath.attr("d",path)
})

/*
* 添加透明举行来捕捉事件
*/
svg.append("rect")
.attr("class","overlayon")
.attr("x","0")
.attr("y","0")
.attr("width",padding.width)
.attr("height", padding.height)
.call(zoom)
})

CSS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
.province {
fill: white;
stroke: #25595a;
stroke-width: 1px;
}

.graticule {
fill: transparent;
stroke: #dddddd;
stroke-width: 1px;
}

.overlayon {
fill: transparent;
cursor: pointer;
}

球面地图


和之前的平面地图相差无几,唯一不同的是将之前的缩放量改为旋转角度,之后通过 behavior 事件来更新投影的旋转角度和后续工作(更新缩放量等等……)

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)

var orthographic = d3.geo.orthographic()
.scale(300)
.rotate([-160,-40,0])
.clipAngle(90)
.translate([padding.width/2,padding.height/2])

var path = d3.geo.path()
.projection(orthographic)

/*
* min 是一个极小值,来防止没有没有边界线的问题
*/ var min = 1e-4;

/*
* 创建网格生成器,生成网格
* 通过最后的 grid 来进行绑定数据进行绘制。
*/
var graticule = d3.geo.graticule()
/* 经度范围为 -180~180,纬度范围是-90~90*/
.extent([[-180,-90],[180+min,90]])
.step([10,10])

var grid = graticule()
var gridPath = svg.append("path")
.datum(grid)
.attr("class","graticule")
.attr("d",path);


/*
* 绘制地图
*/
d3.json("./world-continents.geo.json", function (error, root) {
if (error)
return console.error(error)

var groups = svg.append("g")

var countries = groups.selectAll("path")
.data(root.features)
.enter()
.append("path")
.attr("class","province")
.attr("d",path)

/*
*`initRotate
* 定义一个初始的旋转角度
* initScale
* 设置地图的缩放量(比例尺)
*/
var initRotate = orthographic.rotate()
var initScale = orthographic.scale()

/*
* zoom
* behavior 事件主要用于更新投影的旋转角度
* 以及更新地图的缩放量、和重回地图/经纬度网络。
*/
var zoom = d3.behavior.zoom()
.scaleExtent([1,10])
.on("zoom", function (d) {
orthographic.rotate([
initRotate[0] + 180 * d3.event.translate[0] / padding.width,
initRotate[1] + 180 * d3.event.translate[1] / padding.height,
initRotate[2]
])
orthographic.scale(initScale * d3.event.scale)
countries.attr("d",path)
gridPath.attr("d",path)
})

/*
* 添加透明举行来捕捉事件
*/
svg.append("rect")
.attr("class","overlayon")
.attr("x","0")
.attr("y","0")
.attr("width",padding.width)
.attr("height", padding.height)
.call(zoom)
})

D3 地图投影

在 D3 中 创建投影的方式大多数也一定是通过d3.geo.projection来进行创建的,D3 为此包含了很多现成的投影方法,如albersUsa()、conicConformal()、conicEqualArea()、conicEqualArea.parallels()等投影,但最常用的可能也就是d3.geo.projection & d3.geo.orthographic()两种投影等。

ID DA FA
d3.geo.projection(raw) 从制定的原始点投影函数,创建一个投影
projection(location) 将球面坐标系坐标投影到笛卡尔坐标系的坐标,(location是一个数组,返回数组[x,y],输入数组是形式为[[经度],[纬度]]
projection.invert(point) 从直角坐标(像素)反响投影到球面坐标(度)返回一个数组[经度,纬度],分别表示[x,y]但并非有所有的投影都会被反转
projection.rotate(rotation) 设置渲染,rotation 数组是[yaw, pitch, roll],其中yew 表示左右,pitch 表示倾斜度,而 roll 表示转动
projection.center([location]) 设置投影中心,如果设置了中心点。(location 数组,格式为[经度、纬度]) ,默认为(0,0)
projection.translate(point) 设置投影的平移,如果 point 点被指定,则设置位移为经度,和维度的两元数组并发那会投影,默认为 [480,250]
projection.scale([scale]) 设置投影的比例尺,如设置 scale则返回投影,即缩放因子,未指定投影则默认[150]
projection.clipAngle(angle) 设置圆的裁剪角度,单位为度
projection.clipExtent(extent) 设置矩形裁剪框,extent 的格式为[[x0,y0], [x1,y1]],分别表示
x0 视窗的左边界
y0 上方
x1 右方
y1 下方

地图投影

墨卡托投影 (d3.geo.mercator)

简单理解就是墨卡托投影是将圆柱展开平面后得到的投影,而这个投影的形成就是在地球内部中心放个点光源,之后光线会将地表中每一个位置都投影到柱面上,展开后就是世界地图。

墨卡托投影(mercator),是正轴等角圆柱投影,由荷兰地理学家墨卡托(G.Mercator)1569年创立。他假想了一个地轴方向一致的圆柱或切割于地球。当圆柱展为平面后,得到本投影(通常横是纬线,竖经线)。

需要注意的是墨卡托投影并不是真实的世界样貌,由于地球是三维球体,将完整展现在二维平面是需要牺牲些真实性。所以墨卡托选择牺牲了面积大小,保留角度和形状

因此上图将地球切为12份,然后将边缘的切口进行连接,那么只有赤道的点互相连接,就会造成远离赤道的距离越大,就会显得面积较广,而在 D3 中的API 手册中也有类似的建议

这个球面的Mercator投影是常用的分片式映射库(例如OpenLayers 和Leaflet)。例如显示栅格分片与Mercator投影,可以参见d3.geo.tile插件,它是正形投影的,然而,它的推行造成了世界范围地区严重失真,因此不建议使用choropleths。

等距投影 (d3.geo.equirectangular)


等距投影(equirectangular)是一种简单的地图投影方法,该投影的经线和纬线都是互相垂直且等距的。在这种投影方法中,假设了球面和圆柱面相切于赤道,将球面的经纬线投影到圆柱面上,之后沿着圆柱的一条母线所开展平面的一种投影

正射投影(d3.geo.orthographic)

正射投影(orthographic)适用与投射单个半球的方位投影,属于任意性质的透视方位投影。

立体投影(d3.gao.stereographic)


立体投影(stereigraohic)是另一个角度(方位)的投影。在极方位上,经线是极点的直线,所有的直线间的夹角都是根据正北来进行确定。纬线都显示为同心圆弧,其间距都是从极点来进行增加,交点均为90度,无法显示另一极点

立体投影是一种等角地图投影,他不会保持真实的方向,但是角度和形状将会保持最小比例。可以使用标准纬线或比例因子参数来指定比例畸变圆弧。面积和距离和比例的畸变会随着标准纬线的距离增加而迅速增大。

球心投影/心射极平投影(d3.geo.gnomonic)


球心投影(d3.gao.gnomonic)是方位投影之一,以球心O为投射中心,他是最有用的投影方法之一,也被称之为心射极平投影,来表示出一种物体的上的点、面、与角距关系的平面投影,投影面与投影球的北极相切。

圆锥等距投影(d3.geo.conicEquidistant)

圆锥等距投影

圆锥等距投影(conicEquidistant)或等距圆锥投影保留了所有经线和两个标准纬线之间的距离。该投影方法通常作为兰勃特等角圆锥和阿尔伯斯等积圆锥投影的一种折衷投影。

该投影最适用与在中纬度东西分布的大陆板块,基本投影形式由 Claudius Ptolemy 于公元100年最初提出,后盖被进行各种改进,最大的改进由 Nicolas d3’ l’lsle 于 1745年进行修改。

兰勃特地图投影
兰勃特等角堆地图投影由 Johann H.Lambert 于1772年开发,该投影主要基于两个标准纬线,但也可以使用单个标准纬线和比例因子对其进行定义(适用与中纬度东西方向分布的大陆进行角制图,第一次世界大战前很少使用,目前全世界的官方地图制图通常使用该投影

阿尔伯斯地图投影
阿尔伯斯地图投影是一种等积圆锥投影,该圆锥投影使用两条标准纬线,相比仅使用一条标准纬线的投影可以从某种程度上减少畸变。该投影主最适用与中纬度东西方向分布的大陆板块,最早由 Heinrich C. Albers 于 1805年提出,椭圆方程被Oscar S.Adams 于1927年开发。

各个参数

center() and scale as well as translate


在下述的 code 中,将地图中心点设置为台湾省,坐标为121.56372070312499,25.035838555635017,缩放因子/比例尺为600,之后通过平移使得原点位与 SVG 的区域中心即padding.width/2, padding.height/2

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)

/*
* center
* 用于设置中心点,本次设置的中心点为 台湾省
* scale
* 设置缩放因子为600,
* translate
* 以 svg 区域为中心为坐标的原点
*/
var projection = d3.geo.equirectangular()
.center([121.56372070312499,25.035838555635017])
.scale(600)
.translate([padding.width/2, padding.height/2])

var path = d3.geo.path()
.projection(projection)

/*
* 绘制地图
*/
d3.json("./world-continents.geo.json", function (error, root) {
if (error)
return console.error(error)

var groups = svg.append("g")
groups.selectAll("path")
.data(root.features)
.enter()
.append("path")
.attr("class","province")
.attr("d",path)

/*
* rect 为轮廓
* line 为 x/y 轴
*/
svg.append("rect")
.attr("class","border")
.attr("x",0)
.attr("y",0)
.attr("width",padding.width)
.attr("height",padding.height)

svg.append("line")
.attr("class","axis")
.attr("x1",0)
.attr("y1",padding.height/2)
.attr("x2",padding.width)
.attr("y2",padding.height/2)

svg.append("line")
.attr("class","axis")
.attr("x1",padding.width/2)
.attr("y1",0)
.attr("x2",padding.width/2)
.attr("y2",padding.height)
})

CSS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
.province {
fill: white;
stroke: #25595a;
stroke-width: 1px;
}

.border {
fill: transparent;
stroke: black;
stroke-width: 1px;
}
.axis {
fill: transparent;
stroke: rgb(255,0,255);
stroke-width: 0.7px;
stroke-dasharray: 5,5;
}

projection and invert

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82

```js
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)

/*
* center
* 用于设置中心点,本次设置的中心点为 台湾省
* scale
* 设置缩放因子为600,
* translate
* 以 svg 区域为中心为坐标的原点
*/
var projection = d3.geo.equirectangular()
.center([121.56372070312499,25.035838555635017])
.scale(800)
.translate([padding.width/2, padding.height/2])

var path = d3.geo.path()
.projection(projection)

/*
* 绘制地图
*/
d3.json("./world-continents.geo.json", function (error, root) {
if (error)
return console.error(error)

var groups = svg.append("g")
groups.selectAll("path")
.data(root.features)
.enter()
.append("path")
.attr("class","province")
.attr("d",path)

/*
* rect 为轮廓
* line 为 x/y 轴
*/
svg.append("rect")
.attr("class","border")
.attr("x",0)
.attr("y",0)
.attr("width",padding.width)
.attr("height",padding.height)

svg.append("line")
.attr("class","axis")
.attr("x1",0)
.attr("y1",padding.height/2)
.attr("x2",padding.width)
.attr("y2",padding.height/2)

svg.append("line")
.attr("class","axis")
.attr("x1",padding.width/2)
.attr("y1",0)
.attr("x2",padding.width/2)
.attr("y2",padding.height)

/*
(1)
projection与invert前者是投影到球面坐标之后转到笛卡尔坐标,
并返回数组[x,y],而invert则是投影反响直角坐标系到球面坐标中。
*/
var projectioncircle = projection([121.56372070312499,25.035838555635017])
svg.append("circle")
.attr("cx",projectioncircle[0])
.attr("cy",projectioncircle[1])
.attr("r",3)
.style("fill","red")

var pos = projection.invert(projectioncircle)
})

clipExtent

设置为:```[300,0],[padding.width,padding.height]```,就可以进行裁剪左侧的地图数据:
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

```js
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)

/*
* center
* 用于设置中心点,本次设置的中心点为 台湾省
* scale
* 设置缩放因子为600,
* translate
* 以 svg 区域为中心为坐标的原点
* clipExtent
* projection.clipExtent()主要表示设置一个矩形裁剪框,其格式可以为[x0,y0],[x1,y1]
*/
var projection = d3.geo.equirectangular()
.clipExtent([[300,0],[padding.width,padding.height]])
.center([121.56372070312499,25.035838555635017])
.scale(200)
.translate([padding.width/2, padding.height/2])

var path = d3.geo.path()
.projection(projection)

/*
* 绘制地图
*/
d3.json("./world-continents.geo.json", function (error, root) {
if (error)
return console.error(error)

var groups = svg.append("g")
groups.selectAll("path")
.data(root.features)
.enter()
.append("path")
.attr("class","province")
.attr("d",path)

/*
* rect 为轮廓
* line 为 x/y 轴
*/
svg.append("rect")
.attr("class","border")
.attr("x",0)
.attr("y",0)
.attr("width",padding.width)
.attr("height",padding.height)

svg.append("line")
.attr("class","axis")
.attr("x1",0)
.attr("y1",padding.height/2)
.attr("x2",padding.width)
.attr("y2",padding.height/2)

svg.append("line")
.attr("class","axis")
.attr("x1",padding.width/2)
.attr("y1",0)
.attr("x2",padding.width/2)
.attr("y2",padding.height)

/*
(1)
projection与invert前者是投影到球面坐标之后转到笛卡尔坐标,
并返回数组[x,y],而invert则是投影反响直角坐标系到球面坐标中。
*/
var projectioncircle = projection([121.56372070312499,25.035838555635017])
svg.append("circle")
.attr("cx",projectioncircle[0])
.attr("cy",projectioncircle[1])
.attr("r",3)
.style("fill","red")

var pos = projection.invert(projectioncircle)
})

rotate and clipAngle


这里介绍下在正射投影orthographic()中较为常用的两个方法为rotate and clipAngle,分别表示了旋转角度(rotate)和裁剪角度(clipAngle),如果不清楚的读者可以看下图:

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
49
50
51
52
53
54
55
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)

var projection = d3.geo.orthographic()
.scale(400)
.translate([padding.width/2, padding.height/2])
/*
* rotate
* 有三个角度,分别为左右、倾斜度、转动等,[yaw, pitch, roll]
* clipAngle
* 即裁剪骄傲读为90:参数别为 30°(左上)、60°(右上)、90°(左下)、180°(右下)
*/
.rotate([-120 ,-20, 0])
.clipAngle(90)

var path = d3.geo.path()
.projection(projection)

/*
* graticule
* 返回一个多重链接(MultiLineString)几何对象表示刻度尺的所有经线和纬线
* extent
* 如果指定则设置刻度尺的主要和次要范围,默认为[[-180,-80],[180,80]]
* step
* 设置刻度的主要和次要步长,及间隔,默认为 [10,10]
*/
var graticule = d3.geo.graticule()
.extent([[-180,-90],[180,90]])
.step([10,10])

svg.append("path")
.attr("class","graticule")
.attr("d",path(graticule()))
/*
* 绘制地图
*/
d3.json("./world-continents.geo.json", function (error, root) {
if (error)
return console.error(error)

var groups = svg.append("g")
groups.selectAll("path")
.data(root.features)
.enter()
.append("path")
.attr("class","province")
.attr("d",path)
})

CSS

1
2
3
4
5
6
7
8
9
10
11
.province {
fill: white;
stroke: #25595a;
stroke-width: 1px;
}

.graticule {
fill: transparent;
stroke: #dddddd;
stroke-width: 1px;
}

D3 Geo 地理路径


地理路径生成器(Geographic Path Generator),对于地图可视化,D3 支持少数的组建来显示或操作地理数据,通常使用 GeoJSON 格式(这也是在 JavaScript中的标准的地理特征表示方法,而TopoJSON则是GeoJSON的扩展)。

对于 TopoJSON、GeoJSON,可以通过使用 ogr2ogr 或 ogr2topo or geo2topo来分别进行转换的数据通过地理路径生成器生成该地图的路径值,通过使用 d3.geo.path类来直接渲染到画布中。

ID FA DA
d3.gao.path 创建一个新的地理路径生成器,可以使用默认的 abersUsa投影和 4.5个像素点半径
path(feature[,index]) 给制定的功能返回路径的数据串,可以是 GeoJSON 的特征或集合对象
Point 单个位置
MultiPoint 一组位置
LineString 一组位置形成一条连续的线
MultiLineString 位置数组的数组,形成多条线
Polygon 位置数组的数组,形成一个多边形
MultiPolygon 位置的多维数组,形成了多个多边形
GeometryCollection 几何对象的数组
Feature 包含了几何对喜爱那个其中的一个特征
FeatureCollection 特征对象的数组
path.projection([projection]) 指定投影,如果投影被有被制定,那么就会返回当前的投影默认为alberUsa(艾伯斯美国投影) 美国地图常见的就是 alberUsa 这可以使得地图更加的紧凑和可用
path.context[context] 设置渲染上下文并发那会生成路径,默认为 null,如果为空的当一个给定调用时路径生成器会返回一个SVG路径字符串。非空则路径生成器替换调用函数为指定调查上下文来渲染几何图形
path.pointRadius([radius]) 设置点半径,用于显示点(Point) 和多点(MultPoint)的功能,如果未指定则返回当前的半径
path.area(feature) 计算出指定几何体的投影面积点(Point)、多点(MultiPoint)、LineString(线串) 则面积为0,如果类型为Polygon(多边形)、MultiPolygon(多点多边形)那么先计算外部环面积,在减去内部空洞
path.centroid(feature) 对指定的功能计算几何体的中心,单位为像素
path.bounds(feature) 对特定的功能计算投影的边框

d3.geo.path

d3.geo.path 内计算方法主要分为计算面积(area)、中心(centroid)、边界框(bounds),Area 用于计算出几何体的投影面积,centroid 来计算出几何体的中心及当前选择的中心(由于使用的是 TopoJSON 他是可以做到的),bounds(投影边框)。

area and centroid as well as bounds

Area 用于计算出几何体的投影面积,centroid 来计算出几何体的中心及当前选择的中心(由于使用的是 TopoJSON 他是可以做到的),bounds(投影边框)当鼠标经过图标数据的时候显示出 area、centroid、bounds总共加起来绘制出的数据。

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)

var projection = d3.geo.mercator()
.center([107,19])
.scale(600)
.translate([padding.width/2,padding.height/2])

var color = d3.scale.category20b()

var path = d3.geo.path()
.projection(projection)

d3.json("./china_topo.json", function (error, toporoot) {
if (error)
return console.error(error)
console.log(toporoot)
/*
* (1)
* 将 TopoJSON 转换为 GeoJSON 并保存在 Georoot 中。
* Feature 主要用于返回 GeoJSON 的特征(Feature)或特征集合(FeatureCollection)
* feature(topology, object) 第一额参数表示 TopJSON 文件对象,第二个参数来表示出几何体的对象。
* (2) feature
* console 分别会输出 topjson 以及 geojson 的结果。
* 所以在定义 feature() 参数是会考虑到:
* TopoJSON 对象中,有数组 arcs(共享边)、objects(存储几何对象)、 之后对象中有一个 china 对象,所以保存中国地图的几何体,因此:
* topojson.feature(toporoot,toporoot.objects.china)
*/
var georoot = topojson.feature(toporoot,toporoot.objects.china);
console.log(georoot)

var groups = svg.append("g")
groups.selectAll("path")
.data(georoot.features)
.enter()
.append("path")
.attr("class","province")
.attr("d",path)
.on("mouseover",function (d) {
/*
* 分别计算出投影面积、几何体的中心、边框
*/
var area = path.area(d)
var centroid = path.centroid(d)
var bounds = path.bounds(d)

/*
* 绘制中心点
* 绘制边框
*/
svg.append("circle")
.attr("class","circle")
.attr("cx",centroid[0])
.attr("cy",centroid[1])
.attr("r",4)

svg.append("rect")
.attr("class","rect")
.attr("x", bounds[0][0])
.attr("y",bounds[0][1])
.attr("width",bounds[1][0] - bounds[0][0])
.attr("height",bounds[1][1] - bounds[0][1])
})
})

CSS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
.province {
fill: white;
stroke: #25595a;
stroke-width: 1px;
}

.circle{
stroke: #e17676;
stroke-width: 2px;
fill: transparent;
}

.rect{
stroke: #dbdbdb;
stroke-dasharray: 10,10;
stroke-width: 2px;
fill: transparent;
}

形状生成器


形状生成器(Shape Geeratior)可以在地图上绘制网格,即经度和纬度来展现出一种视觉效果,也能让其图标先的更加专业:

ID DA FA
d3.geo.graticule() 构造一个经纬线
graticule() 返回一个类型为 MultiLineString 几何对象表示这个刻度的所有经纬线
lines() 返回一个 LineString 集合对象,用于这个刻度的为一个经线纬线
outline() 返回一个类型为 Polygon 的对象,表示出网格的轮廓
extent([extent]) 设置网格范围,如果没有指定范围,那么则返回抢钱的次要范围,默认为[[-180,-80], [180,80]]
step(step) 设置网格的主要和次要间隔,如果没有则返回(10,10)

经纬线网络

经纬线网络可以通过过使用d3.geo.path()进行绘制,在graticule中,网格的范围被使用经度范围为 -180~180,纬度范围是-90~90,每隔 10 度画一条经纬线来通过step表示间隔距离。

中国地图

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)

var projection = d3.geo.mercator()
.center([107,31])
.scale(600)
.translate([padding.width/2,padding.height/2])

var path = d3.geo.path()
.projection(projection)

/*
* min 是一个极小值,来防止没有没有边界线的问题
*/ var min = 1e-4;

/*
* 创建网格生成器,生成网格
* 通过最后的 grid 来进行绑定数据进行绘制。
*/
var graticule = d3.geo.graticule()
/* 经度范围为 -180~180,纬度范围是-90~90,每隔 10 度画一条经纬线*/
.extent([[-180,-90],[180+min,90]])
.step([10,10])

var grid = graticule()
svg.append("path")
.datum(grid)
.attr("class","graticule")
.attr("d",path);


d3.json("./china_topo.json", function (error, toporoot) {
if (error)
return console.error(error)
console.log(toporoot)

/*
* (1)
* 将 TopoJSON 转换为 GeoJSON 并保存在 Georoot 中。
* Feature 主要用于返回 GeoJSON 的特征(Feature)或特征集合(FeatureCollection)
* feature(topology, object) 第一额参数表示 TopJSON 文件对象,第二个参数来表示出几何体的对象。
* (2) feature
* console 分别会输出 topjson 以及 geojson 的结果。
* 所以在定义 feature() 参数是会考虑到:
* TopoJSON 对象中,有数组 arcs(共享边)、objects(存储几何对象)、 之后对象中有一个 china 对象,所以保存中国地图的几何体,因此:
* topojson.feature(toporoot,toporoot.objects.china)
*/
var georoot = topojson.feature(toporoot,toporoot.objects.china);
console.log(georoot)

var groups = svg.append("g")
groups.selectAll("path")
.data(georoot.features)
.enter()
.append("path")
.attr("class","province")
.attr("d",path)
})

CSS

1
2
3
4
5
6
7
8
9
10
11
.province {
fill: white;
stroke: #25595a;
stroke-width: 1px;
}

.graticule {
fill: transparent;
stroke: #e2e2e2;
stroke-width: 1px;
}

世界地图

地图JSON: https://gitee.com/mirrors_jamiebuilds/world.geo.json/blob/master/countries.geo.json#

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
49
50
51
52
53
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)

var projection = d3.geo.mercator()
.center([0,0])
.scale(120)
.translate([padding.width/2,padding.height/2])

var path = d3.geo.path()
.projection(projection)

/*
* min 是一个极小值,来防止没有没有边界线的问题
*/ var min = 1e-4;

/*
* 创建网格生成器,生成网格
* 通过最后的 grid 来进行绑定数据进行绘制。
*/
var graticule = d3.geo.graticule()
/* 经度范围为 -180~180,纬度范围是-90~90*/
.extent([[-180,-90],[180+min,90]])
.step([10,10])

var grid = graticule()
svg.append("path")
.datum(grid)
.attr("class","graticule")
.attr("d",path);


/*
* 绘制地图
*/
d3.json("./world-continents.geo.json", function (error, root) {
if (error)
return console.error(error)

var groups = svg.append("g")
groups.selectAll("path")
.data(root.features)
.enter()
.append("path")
.attr("class","province")
.attr("d",path)
})

圆形网络


除了绘制经纬线网络之外,还有原型网络的绘制,同样是通过使用d3.geo.path()进行绘制,地图和网格都会自动进行适应,需要注意的是如果出现问题那基本上就是地图数据的原因,目前支持绘制圆形网络的生成器方法如下:

ID DA FA
d3.geo.circle 为一个指定的地理位置创建带有设置的半径,在圆中心创建一个特征生成器
circle(arguments) 返回一个类型为多边形的 GeoJSON 对象
circle.origin([origin]) 设置圆的圆点,默认值为 (0,0)
circle.precision([precision]) 设置圆半径,默认为90度

圆形网络是一个分别在平面地图和球面地图,平面主要是将球面地图展开后进行的结果,我们可以使用d3.geo.mercator(),来绘制出平面图,而通过使用d3.geo.orthographic,来绘制出球形网络。

ID DA FA
d3.gao.orthographic() 来显示出适合单个半球的投影,即球面投影
rotation([rotate]) 指定旋转,设置投影的三个轴的指定角度
clipAngle(angle) 设置投影和裁剪圆的半径,指定角度并返回。如果角度为 null则切换到子午线切割,而不是小圆裁剪。(如果没有指定角度,则发那会出当前的裁剪角度,默认为空)

mercator

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
49
50
51
52
53
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)

var projection = d3.geo.mercator()
.center([0,0])
.scale(120)
.translate([padding.width/2,padding.height/2])

var path = d3.geo.path()
.projection(projection)

/*
* min 是一个极小值,来防止没有没有边界线的问题
*/ var min = 1e-4;


var angles = d3.range(0,150,8)
var geocircle = d3.geo.circle()
.origin([77,-19])

svg.append("g")
.selectAll(".geocircle")
.data(angles)
.enter()
.append("path")
.attr("class","graticule")
.attr("d", function (d) {
var circle = geocircle.angle(d)
return path(circle())
})

/*
* 绘制地图
*/
d3.json("./world-continents.geo.json", function (error, root) {
if (error)
return console.error(error)

var groups = svg.append("g")
groups.selectAll("path")
.data(root.features)
.enter()
.append("path")
.attr("class","province")
.attr("d",path)
})

orthographic

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
49
50
51
52
53
54
55
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)

var projection = d3.geo.orthographic()
.center([0,0])
.scale(300)
.rotate([-90,-20])
.clipAngle(90)
.translate([padding.width/2,padding.height/2])

var path = d3.geo.path()
.projection(projection)

/*
* min 是一个极小值,来防止没有没有边界线的问题
*/ var min = 1e-4;


var angles = d3.range(0,150,8)
var geocircle = d3.geo.circle()
.origin([77,-19])

svg.append("g")
.selectAll(".geocircle")
.data(angles)
.enter()
.append("path")
.attr("class","graticule")
.attr("d", function (d) {
var circle = geocircle.angle(d)
return path(circle())
})

/*
* 绘制地图
*/
d3.json("./world-continents.geo.json", function (error, root) {
if (error)
return console.error(error)

var groups = svg.append("g")
groups.selectAll("path")
.data(root.features)
.enter()
.append("path")
.attr("class","province")
.attr("d",path)
})

D3 Geo


在D3中除了常用的学术图表之外,还支持地图的数据展示,主要分为地理路径、地理投影,D3支持少数的组件来显示和操作数据。一般地图数据会保存为JSON格式,而D3常用的有GeoJson and TopoJSON,其中GeoJson主要描述地理信息的一种基本格式。而TopoJSON则是由D3作者Mike Bostock制定的格式,他们都符合了JSON的规范。

D3支持少数的组建来显示和操作数据,这些组件会使用GeoJSON格式,他也是JavaScript中标准的地理特征表示方法。而由Mike Bostock所制定的格式TopoJSON主要是GeoJSON的扩展格式,前者表示的更加紧密。

如果要将文件转换为GeoJSON格式,需要通过使用GDAL``包中的 ogr2ogr来进行转换,当让也有从 ogr2ogr 衍生出的 ogr2gui 但本文主要通过使用 ogr2ogr来进行转换,通常 D3 Geo 常用 API 如下:

ID DA FA
d3.geo.mercator() 莫卡托投影,是正轴与圆柱投影,由荷兰地图学家莫卡托(mercator)与1569年创立
center(one[,two]) 地图中心位置,通常one是经度、two是维度
d3.geo.path() 创建一个新的地理路径生成器
projection 应用投影
d3.set() 创建集合
.has() 用于检测数据是否在集合中

数据的来源

DataV

DataV是阿里巴巴数据可视化团队,旨在让更多人看到数据可视化的魅力,本文主要使用 DATAV所提供的地理地图集(DATAV.GeoAtlas),通过使用DATAV我们可以直接得到相应地图的 JSON数据,从而避免 使用 ogr2ogr 进行二次转换。

数据可以直接通过访问http://datav.aliyun.com/tools/atlas/#&lat=30.316551722910077&lng=102.21432656555675&zoom=3.5得到,除此之外,我们也可以根据 DATAV 所提供的 API 直接进行绘制:

ID DA
https://geo.datav.aliyun.com/areas_v2/bound/100000.json JSON API
https://geo.datav.aliyun.com/areas/bound/geojson?code=100000 GeoJSON API
https://geo.datav.aliyun.com/areas_v2/bound/100000_full.json JSON API (包含子域)
https://geo.datav.aliyun.com/areas/bound/geojson?code=100000_full GeoJSON API (包含子域)

Natural Earth

Natural Earth 提供的部分 GeoJSON 存在中国地图部分不完整或存在缺陷等问题而 Github 上部分的 china.json / china.geojson 等数据可能存在通过使用 -where "ADM0_A3 ('CHN','TWN')" 进行拼合而成,因此,也可能存在中国地图中的钓鱼岛、赤尾屿、台湾岛、南海诸岛、藏南地区国界线、阿克赛钦地区国界线等错误。

因此我们强烈建议使用阿里巴巴DataV与高德开放平台所提供的在线数据提供平台: http://datav.aliyun.com/tools/atlas/#&lat=30.332329214580188&lng=106.72278672066881&zoom=3.5 内进行下载geojson或svg数据。本文虽然不采用 Natural Earth 数据,但提供使用以通过 ogr2ogr 转换的步骤和数据的简化操作。

如果我们不使用中国地图的话,可以通过Natural Earth这个带有美国特色双标组织渠道来下载所有地理数据,他主要提供了三种尺寸供我们进行下载:

ID FA DA
大规模数据 1:10m,1:10,000,000,1英寸= 158英里,1厘米= 100公里 最详细且使用与制作国家和地区的放大地图
中等规模数据 1:50m,1:50,000,000,1英寸= 790英里,1厘米= 500公里 适用于制作国家和地区的缩小地图
小规模数据 1:110m,1:110,000,000,1’’= 1,736英里,1厘米= 1,100公里 小型的示意图或小型的定位器的地球仪

当下载的时候,他主要会分为Cultural、Physical、Raster三个选项:

ID DA FA
Cultural 包含具有文化性的地理信息 具有国家和地区的边界划分地图、按照行政省划分地图、包含有飞机场、港口和地图等
Physical 包含具有物理性的地理信息 含有该国家的海岸线、陆地、海洋、河流、港口等
Raster 包含栅格地图

GeoJSON 转换

我们通过在 Natural Earth 下载的 Admin 0 – Countries1:110m 的地图数据,在此之前,我们需要安装GDAL包下的ogr2ogr程序,如果你是 Linux debian 系用户可以通过使用:

1
sudo apt-get install gdal-bin

当安装成功之后,使用ogr2ogr -version来进行查询是否安装成功,当正确输出版本信息后。我们可以将刚刚下载到的ne_110m_admin_0_countries.zip进行解压,解压后进入该目录执行:

1
ogr2ogr -f "GeoJSON" china.geojson ne_110m_admin_0_countries.shp -overwrite -where "ADM0_A3 IN ('CHN')"

也可使用 -where "ADM0_A3 IN ('CHN','USER')" 来提取多个国家数据,ISO 3166-1 alpha-3即“ADM0_A3”标准来通过三个拉丁字母表示国家名称,通常这三个字母就是该国家的代码,如CHN就是中华人民共和国的国家代码。

TopoJSON 转换

TopoJSON 是由 Mike Bostock 提供的一种 GeoJSON 扩展,通过拓扑后的扩展形式,主要使用点、弧来表示图形。一般情况点、线地理实体分别通过坐标和弧索引表示而多边形也通过弧索引来实现。

使用 TopoJSON 的特点在于其大小是 GeoJSON 大小的 80%,原因在于边界线只记录一次(边界线接壤、共用),而地理坐标都使用整数即 **共享边(ARCS)**。

因此 TopoJSON 通过明显的优点深受喜爱,除此之外,还可以通过使用 TopoJSON 内 共享边(ARCS) 的特性来完成一些较为舒服用户交互或特殊标注

TopoJSON 提供了解析 TopoJSON 格式的方法,为了保证 TopoJSON 的拓扑保留简化和过滤以及更小的文件、更快的渲染,因此 TopoJSON 还特地除了个简化步骤。除此还分为客户端和服务器,两者分别是将 GeoJSON 转换为 TopoJSON,以及将 TopoJSON 转换为 GeoJSON :

ID DA FA TO
服务器 TopoJSON.Topology 支持将 GeoJSON 转换为 TopoJSON https://github.com/topojson/topojson-server/blob/master/README.md#topology
Geo2topo 将 GeoJSON 转换为 TopoJSON https://github.com/topojson/topojson-server/blob/master/README.md#geo2topo
简化 TopoJSON.presimplify 准备用于简化的 TopoJSON https://github.com/topojson/topojson-simplify/blob/master/README.md#presimplify
TopoJSON.simplify 删除坐标来简化 https://github.com/topojson/topojson-simplify/blob/master/README.md#simplify
TopoJSON.quantile 计算简化的阀值 https://github.com/topojson/topojson-simplify/blob/master/README.md#quantile
TopoSimplify 简化 TopoJSON 删除坐标 https://github.com/topojson/topojson-simplify/blob/master/README.md#toposimplify
客户端 topoJSON.feature 将 TopoJSON 转换为 GeoJSON https://github.com/topojson/topojson-client/blob/master/README.md#feature
…… https://github.com/topojson/topojson
GeoJSON > topoJSON

通过使用 TopoJSON Server 所提供的 topojson.topology 可以通过将GeoJSON转换为TopoJSON文件,可以使用sudo npm install -g topojson-server进行安装, tpology 自带了geo2topo

我们可以通过执行 geo2topo china.json -o china_topo.json 将 geoJSON 文件转换为 TopoJSON 格式文件 china_topo.json

当然你也可以通过使用其官方所提供的 <script src="https://unpkg.com/topojson-server@3"></script> 在浏览器中进行引入,这是由官方所提供的3.0.1版本

TopoJSON > GeoJSON

可以使用 topoJSON.feature来进行转换,feature 主要分为客户端和浏览器引入两种方法。通过使用cnmp install -g topojson-client来进行全局安装,当然如果没有cnmp也可以通过nmp install -g topojson-client进行安装,但速度会比较慢。

如果通过浏览器引入我们可以通过使用 <script src="https://unpkg.com/topojson-client@3"></script> 来进行引入,这是由官方所提供的3.0.2版本。

简单绘制

GeoJSON

GeoJSON 是一个用于描述地理空间信息的数据格式,因此他的语法是符合JSON规范,只是和JSON不同之处在于对名称进行了规范,名称须为字符串,而值可以是字符串、数字、布尔、对象、数组、NULL等,通常他的外部对象格式是:

2015年,互联网工程任务组(IETF)与最初的的规范作者共同组成了GeoJSON WG,以标准化GeoJSON。RFC 7946 于2016年8月发布,他是GeoJSON格式的新规范,取代了2008年的GeoJSON 规范:

1
2
3
4
5
6
7
8
9
10
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [125.6, 10.1]
},
"properties": {
"name": "Dinagat Islands"
}
}


通常上述 code 主要分为Fature(特征)以及geometry(几何体)来表示出最外层的单独对象,在特征集合(FeatureCollection)中,最外层的GenJSON会包含很多的子对象,对于每一个GeoJSON的每个type属性值必须是下面之一:

ID DA
Point
MultiPoint 多点
LineString 线
MultiLineString 多线
Polygon
MultiPolygon 多面
GeometryCollection 几何体集合
Feature 特征
FeatureCollection 特征集合
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [
114.345703125,
23.96617587126503
]
}
}
]
}

绘制

由于我们使用的是DATAV所提供的数据,因此我们你可以通过使用d3,geo.mercator()进行投影,然后使用center()来设置出地图的中心位置。select ad translate分别设置缩放量和平移量,当定义好投影之后,通过使用d3.geo.path()来进行使用投影进行绘制地图路径。

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
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)

var projection = d3.geo.mercator()
.center([107,31])
.scale(600)
.translate([padding.width/2,padding.height/2])

var color = d3.scale.category20b()

var path = d3.geo.path()
.projection(projection)

d3.json("https://geo.datav.aliyun.com/areas/bound/geojson?code=100000_full", function (error, root) {
if (error)
return console.error(error)
console.log(root)

var groups = svg.append("g")

groups.selectAll("path")
.data(root.features)
.enter()
.append("path")
.attr("class","province")
.style("fill", function (d,i) {
return color[i]
})
.attr("d",path)
})

CSS

1
2
3
4
5
.province {
fill: white;
stroke: #25595a;
stroke-width: 1px;
}

TopoJSON

TopoJSON 是由 Mike Bostock 提供的一种 GeoJSON 扩展,通过拓扑后的扩展形式,主要使用点、弧来表示图形。一般情况点、线地理实体分别通过坐标和弧索引表示而多边形也通过弧索引来实现。

使用 TopoJSON 的特点在于其大小是 GeoJSON 大小的 80%,原因在于边界线只记录一次(边界线接壤、共用),而地理坐标都使用整数共享边(ARCS)

因此 TopoJSON 通过明显的优点深受喜爱,除此之外,还可以通过使用 TopoJSON 内 共享边(ARCS) 的特性来完成一些较为舒服用户交互或特殊标注

TopoJSON 提供了解析 TopoJSON 格式的方法,为了保证 TopoJSON 的拓扑保留简化和过滤以及更小的文件、更快的渲染,因此 TopoJSON 还特地除了个简化步骤。除此还分为客户端和服务器,两者分别是将 GeoJSON 转换为 TopoJSON,以及将 TopoJSON 转换为 GeoJSON :

ID DA FA
topojson.feature 将 TopoJSON 转换为 GeoJSON,为返回指定的对象 GeoJSON
topojson.merge 合并 Topojson 集合,并分配个目标对象
topojson.mesh 与 topojson.mesh 等效,但返回的是 TopoJSON,可以用于共享坐标
topojson.neighbors 计算出相邻数据

绘制

在下述的 code 中主要通过使用 geojson 格式转换为 topojson 格式,之后在通过使用topojson.feature将此再次使用<script src="https://unpkg.com/topojson@3.0.2/dist/topojson.js"></script> API 转换为 geojson 格式文件。因源文件是 topojson 所以转换后的数据自然是 geojson 文件的 80% 大小,这也是使用 topojson 的好处之一。

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
49
50
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)

var projection = d3.geo.mercator()
.center([107,31])
.scale(600)
.translate([padding.width/2,padding.height/2])

var color = d3.scale.category20b()

var path = d3.geo.path()
.projection(projection)

d3.json("./china_topo.json", function (error, toporoot) {
if (error)
return console.error(error)
console.log(toporoot)

/*
* (1)
* 将 TopoJSON 转换为 GeoJSON 并保存在 Georoot 中。
* Feature 主要用于返回 GeoJSON 的特征(Feature)或特征集合(FeatureCollection)
* feature(topology, object) 第一额参数表示 TopJSON 文件对象,第二个参数来表示出几何体的对象。
* (2) feature
* console 分别会输出 topjson 以及 geojson 的结果。
* 所以在定义 feature() 参数是会考虑到:
* TopoJSON 对象中,有数组 arcs(共享边)、objects(存储几何对象)、 之后对象中有一个 china 对象,所以保存中国地图的几何体,因此:
* topojson.feature(toporoot,toporoot.objects.china)
*/
var georoot = topojson.feature(toporoot,toporoot.objects.china);
console.log(georoot)

var groups = svg.append("g")
groups.selectAll("path")
.data(georoot.features)
.enter()
.append("path")
.attr("class","province")
.style("fill", function (d,i) {
return color[i]
})
.attr("d",path)
})
set and merge


通过 d3.set 创建集合,southeast 包含了各省名称之后通过使用 southeast.has() 来检查传入字符串是否在集合中,合并后保存并输出。 我们将 southeast 内设置为黑色,之后使用 datum()来绑定数据通过 svg.path 进行绘制。

使用 topojson.merge() 来进行合并,每一项保存一个省的几何信息,之后通过对象的 filter() 函数,只有在集合中的省份保存至 mergedPolygon 中。

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)

var projection = d3.geo.mercator()
.center([107,19])
.scale(600)
.translate([padding.width/2,padding.height/2])

var color = d3.scale.category20b()

var path = d3.geo.path()
.projection(projection)

d3.json("./china_topo.json", function (error, toporoot) {
if (error)
return console.error(error)
console.log(toporoot)
/*
* (1)
* 将 TopoJSON 转换为 GeoJSON 并保存在 Georoot 中。
* Feature 主要用于返回 GeoJSON 的特征(Feature)或特征集合(FeatureCollection)
* feature(topology, object) 第一额参数表示 TopJSON 文件对象,第二个参数来表示出几何体的对象。
* (2) feature
* console 分别会输出 topjson 以及 geojson 的结果。
* 所以在定义 feature() 参数是会考虑到:
* TopoJSON 对象中,有数组 arcs(共享边)、objects(存储几何对象)、 之后对象中有一个 china 对象,所以保存中国地图的几何体,因此:
* topojson.feature(toporoot,toporoot.objects.china)
*/
var georoot = topojson.feature(toporoot,toporoot.objects.china);
console.log(georoot)

/*
* (1) 创建集合
* 通过 d3.set 创建集合,southeast 包含了各省名称之后通过使用 southeast.has() 来检查传入字符串是否在集合中,合并后保存并输出。
* (2) 数据绘制
* 将 southeast 内设置为黑色,之后使用 datum()来绑定数据通过 svg.path 进行绘制。
* (3) 数据合并
* 之后通过使用 topojson.merge() 来进行合并,每一项保存一个省的几何信息,之后通过对象的 filter() 函数
* 只有在集合中的省份保存至 mergedPolygon 中。
*/
var southeast = d3.set([
"广东省","海南省","台湾省","北京市","吉林省","黑龙江省"
])
var mergedPolygon = topojson.merge(toporoot,
toporoot.objects.china.geometries.filter(function (d) {
return southeast.has(d.properties.name)
}))
console.log(mergedPolygon)

var groups = svg.append("g")

groups.selectAll("path")
.data(georoot.features.filter(function (d) {
return !southeast.has(d.properties.name)
}))
.enter()
.append("path")
.attr("class","province")
.attr("d",path)

svg.append("path")
.datum(mergedPolygon)
.attr("class","province")
.style("fill","#c6c6c6")
.attr("d",path)
})
mesh


topojson.mesh 主要提供了 网格花 TopoJSON 几何形状以形成多边形, 分别提取了内蒙古、黑龙江省的边界线,边界线最终存储在 boundary 中。

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)

var projection = d3.geo.mercator()
.center([107,19])
.scale(600)
.translate([padding.width/2,padding.height/2])

var color = d3.scale.category20b()

var path = d3.geo.path()
.projection(projection)

d3.json("./china_topo.json", function (error, toporoot) {
if (error)
return console.error(error)
console.log(toporoot)
/*
* (1)
* 将 TopoJSON 转换为 GeoJSON 并保存在 Georoot 中。
* Feature 主要用于返回 GeoJSON 的特征(Feature)或特征集合(FeatureCollection)
* feature(topology, object) 第一额参数表示 TopJSON 文件对象,第二个参数来表示出几何体的对象。
* (2) feature
* console 分别会输出 topjson 以及 geojson 的结果。
* 所以在定义 feature() 参数是会考虑到:
* TopoJSON 对象中,有数组 arcs(共享边)、objects(存储几何对象)、 之后对象中有一个 china 对象,所以保存中国地图的几何体,因此:
* topojson.feature(toporoot,toporoot.objects.china)
*/
var georoot = topojson.feature(toporoot,toporoot.objects.china);
console.log(georoot)

/*
* (mesh)
* topojson.mesh 主要提供了 网格花 TopoJSON 几何形状以形成多边形。
* 分别提取了内蒙古、黑龙江省的边界线,边界线最终存储在 boundary 中。
*/
var boundary = topojson.mesh(toporoot ,toporoot.objects.china, function (a,b) {
return a.properties.name === "内蒙古自治区" && b.properties.name === "黑龙江省"
})
console.log(boundary)
var groups = svg.append("g")

groups.selectAll("path")
.data(georoot.features)
.enter()
.append("path")
.attr("class","province")
.attr("d",path)

svg.append("path")
.datum(boundary)
.attr("class","boundary")
.style("fill","none")
.attr("d",path)
})
neighbors


通过使用 neighbors 来计算出相邻数据,并通过为没一个元素添加相邻省份的选择集,为每个选择时添加 behavior 事件,持续时间分别为 2000ms。

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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
var padding = {
width: 1000,
height: 1000
}

var svg = d3.select("body")
.append("svg")
.attr("width",padding.width)
.attr("height", padding.height)

var projection = d3.geo.mercator()
.center([107,19])
.scale(600)
.translate([padding.width/2,padding.height/2])

var color = d3.scale.category20b()

var path = d3.geo.path()
.projection(projection)

d3.json("./china_topo.json", function (error, toporoot) {
if (error)
return console.error(error)
console.log(toporoot)
/*
* (1)
* 将 TopoJSON 转换为 GeoJSON 并保存在 Georoot 中。
* Feature 主要用于返回 GeoJSON 的特征(Feature)或特征集合(FeatureCollection)
* feature(topology, object) 第一额参数表示 TopJSON 文件对象,第二个参数来表示出几何体的对象。
* (2) feature
* console 分别会输出 topjson 以及 geojson 的结果。
* 所以在定义 feature() 参数是会考虑到:
* TopoJSON 对象中,有数组 arcs(共享边)、objects(存储几何对象)、 之后对象中有一个 china 对象,所以保存中国地图的几何体,因此:
* topojson.feature(toporoot,toporoot.objects.china)
*/
var georoot = topojson.feature(toporoot,toporoot.objects.china);
console.log(georoot)

var neighbors = topojson.neighbors(toporoot.objects.china.geometries)
console.log(neighbors)

var groups = svg.append("g")

var paths = groups.selectAll("path")
.data(georoot.features)
.enter()
.append("path")
.attr("class","province")
.attr("d",path)

/*
* 通过使用 neighbors 来计算出相邻数据
* 并通过为没一个元素添加相邻省份的选择集
* 为每个选择时添加 behavior 事件,持续时间分别为 2000ms
*/
paths.each(function (d,i) {
d.neighbors = d3.selectAll(
neighbors[i].map(function (j) {
return paths[0][j]
})
)
})
.on("mouseover", function (d,i) {
d3.select(this)
.transition()
.duration(2000)
.style("fill","#9f9d9d")
d.neighbors
.transition()
.duration(2000)
.style("fill","#d8d8d8")

})
.on("mouseout",function (d,i) {
d.neighbors.style("fill","white")
.transition()
.duration(2000)
})

})

D3 选择集

选择集与数据通常被称之为数据绑定(Data-Join)也是D3的核心知识之一,被称之为Data-Driven主要原因是共解决了两个问题,分别为根据数据添加元素以及当数据发生更新时,来修改元素等

选择元素与修改元素

选择元素

D3可通过使用d3.selectd3.selectAll来进行选择,通常d3.select来选择地一个匹配的元素,而d3.selectAll来匹配所有元素,就比如:

ID DA
d3.select(“body”) 选择 body元素
d3.select(“#node”) 选择 id为 node的元素
d3.select(“.class”) 选择类为 class 的地一个元素

如果说通过上述的表格无法更加直观理解的话,也许下面的这个例子会让你更加的生动形象以及感觉到他的作用,如:

1
d3.selectAll("ui ll");

修改元素


选择元素与修改元素的区别主要在于选择元素是d3.select、d3.selectAll而修改元素则是当选择后,在进行修改的,如:

1
2
var svg = d3.select("body")
.style('fill','red')

就比如上述的codo先选择一个body元素,之后通过.style来修改元素的颜色为red,在d3.js中,修改元素共有6个,分别为:

ID DA FA
.style 修改style元素 d3.selectAll('client').style('fill','red')
.attr 更新一个属性 d3.selectAll('client').attr('cx',"50px")
.classed 添加或移除一个属性 d3.select('.client').classed('checked',true)
.property 更新元素中的属性 d3.selectAll('client').property('checked',false)
.text 更新文本中的内容 d3.select('div.title').text('Hello,d3')
.html 更新或增加html内容 d3.select('.legend').html('<div>hello,d3</div')

设定以及获取属性

select 与 selectAll

ID DA FA
select 选择单个元素
selectAll 选择全部元素

classed

1
2
3
4
5
6
7
8
9
10
11
12
<p id="title">This is D3.js</p>
<p id="data">This data</p>
<style>
.colorRed {
color: red;
}
</style>
<script>
d3.select("p")
.attr('id','title')
.classed('colorRed',true);
</script>
.classed('colorRed font',true);```来进行实现,其中```true```以及```false```分别是使用或不使用该类,通俗点就是```true```是使用,```false```是不使用。当然除此之外我们也可以使用一个万能修改元素```attr```,即:
1
2
3
4
```js
d3.select("p")
.attr('id','title')
.attr('class','colorRed font')

都可实现与:

1
2
3
d3.select("p")
.attr('id','title')
.classed('colorRed',true);

style

不仅仅支持class,修改元素中依然还支持style属性的设置,通常我们可以使用:

1
2
3
d3.select("p")
.attr('id','title')
.style('color','red');

来进行设置,但此时就会有读者发现,要如何设置多条css语句?,通常我们可以通过多个css写在一起来实现:

1
2
3
4
d3.select("p")
.attr('id','title')
.style({"color":"red",
"font-size":"20px"});

上述的code同等于<p id="title" style="color: red; font-size: 20px;">This is D3.js</p>

property

```元素在```d3```中主要用于**更新元素中的属性**,如:
1
2
3
4
5
6
```js
<input id="input" type="text" name="inputname" />
<script>
d3.select("#input")
.property("value","Hello");
</script>

也就是说表单并不存在value值,之后通过property设置了id为inputvalueHello,所以我们可以通过使用.property("value","Hello"),来设置inputvalue值,当然也不仅仅可以设置value还可以更新input的属性为submit,如:

1
2
3
4
5
<input id="input" type="text" value="Go" name="inputname" />
<script>
d3.select("#input")
.property("type","submit");
</script>

上述的code与更新value一样,只不过更新的type不一样,inputtext更新为submit为按钮类型。

text

is d3.js”之后被```d3.select("p")```所进行获取,在修改```text```数据为```Hello,d3.js```:
1
2
3
4
5
6
7
```js
<p>This is d3.js</p>
<script>
d3.select("p")
.text('Hello,d3.js')
</script>
</body>

html

1
2
3
4
5
6
7

```js+html
<p>This is d3.js</p>
<script>
d3.select("body")
.html('<h1>Hello,html</h1>')
</script>

如上述的code则是更新/修改body元素内的信息,并修改为Hello,html

添加插入和删除(append、insert、remove)


选择集可以支持添加和删除以及插入信息,主要通过append、insert、remove来完成上述操作:

1
2
3
4
5
6
7
8
9
10
11
12
<p>Vue</p>
<p id="ejs">Ejs</p>
<p>Laravel</p>

<script>
var body = d3.select("body")
body.append("p").text("D3")
body.insert("p","#ejs").text('Less')

var ejs = d3.select("#ejs")
ejs.remove()
</script>

数据绑定

数据绑定即Data-Join,数据选择以及数据绑定通常是一起的,所谓数据绑定即将数据绑定到DOM中,网页中的数据可以和元素绑定到一起,之后可以进行更改并操作元素会非常的方便,也是D3处理选择集数据的方法,在默认的情况下d3.select以及d3.selectAll是不存在数据的,所以通过数据绑定就可以使得拥有数据,通常可以使用selection.datum以及selection.data,他们的作用是:

ID DA
selection.datum 绑定一个数据到选择集中
selection.data 绑定一个数组到选择集上,数组各项值与选择集的各个元素进行绑定

datum()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

```html+js
<body>
<p>Vue</p>
<p>Ejs</p>
<p>Laravel</p>

<script>
var p = d3.select("body")
.selectAll("p");
p.datum('good');
console.log(
p.datum()
);
</script>
</body>


将 “body” 元素内的所有"p"标签,绑定数据到 “good”中,datum() 绑定了一个字符串到”good”选择集中,调用text()中的无名参数 “function(d,i)”,其中 d = data、而 i d = index,即数据与索引,之后无名函数返回了由 “d”以及”i”所结合的字符串,最终所绑定的数据被替换为了 “共有”……

1
2
3
4
5
6
7
8
9
10
11
12
13
14
<body>
<p>Vue</p>
<p>Ejs</p>
<p>Laravel</p>

<script>
var p = d3.select("body")
.selectAll("p");
p.datum('good')
.text(function(d,i) {
return d = "共有: " + i + " 个数据";
});
</script>
</body>

在d3.js中,我们可以使用一个被绑定的数据传递给子元素,即使用append方法即可实现,如:

1
2
3
4
5
6
7
8
9
10
11
12
13
<p>Vue</p>
<p>Ejs</p>
<p>Laravel</p>

<script>
var p = d3.select("body")
.selectAll("p");
p.datum('is good!')
.append("good")
.text(function(d,i) {
return " " + d;
});
</script>

之后所输出的信息将会为:

1
2
3
4
5
Vue is good!

Ejs is good!

Laravel is good!

通过console.log在控制台内输出,被绑定的数据选择集添加后,新元素也会被继承

1
2
__data__: "is good!"
__proto__: HTMLParagraphElement

data()

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

| ID | DA |
| --- | --- |
| 数组长度 > 元素数量 | 为多余数据预留元素位置,用于将来插入新的元素 |
| 数组长度 < 元素数量 | 获取多余的元素位置,用于将来的删除 |
| 数组长度 = 元素数量 | 即将用于更新数据 |


通常用于处理上述的方法被d3称之为```Data-Join```即数据连接,Data-join主要的三个关键词就是```Update、Enter、Exit```起大致意思为```更新、进入、退出```三个其作用是:

| ID | DA |
| --- | --- |
| Update | 即存在的元素,可以进行修改 |
| Enter | 代表已经丢失的元素,可以修改这些元素的属性 |
| Exit | 指多余的元素,可以进行删除 |

当我们了解到 ```data()```以及```data-Join```之后,将会来定义一个data()方法的数据绑定:

![](https://49812933408852955071488026628034-1301075051.cos.ap-nanjing.myqcloud.com/1615487000_20210311234258097_1656765781.png)
```html+js
<p>Vue</p>
<p>Ejs</p>
<p>Laravel</p>

<script>
var dataset = [1,2,3];
var p = d3.select("body")
.selectAll("p");

var update = p.data(dataset);
console.log(update);
</script>

通过上述的code中,主要使用了var dataset = [1,2,3];来定义数组的1,2,3并对应了Vue、Ejs、Laravel等元素并进行绑定,并最终通过console.log来输出绑定的结果。

Update、Enter、Exit


通常,数组长度与元素长度相等的情况较少,通常并不为相等,这就会导致数组长度为3,元素长度为5,或数组长度为3,元素长度为5的这种问题,所以引入了Update、enter、exit的概念来解决这个问题,他们的直接意思可以为:

ID DA FA
Enter 如果数组长度大于元素的数量,则部分不存在的元素将即将进入可视化状态 给选择集足够的元素
Exit 如果数组长度小于元素数量,多余的元素将会进入即将进入退出可视状态 删除多余的元素
Update 如果数组长度等于元素的树立那个,则绑定数据的元素即将被更新 修改或更新


通过上图我们可以发现,当数组大于元素时,D3为多余的数组预留了一个空位,以为后来的数据做准备。而当数组小于元素的时候,超过的数组将不会被数据进行绑定。

enter 处理方法


enter及表示数组大于了元素的数量,因此处理 enter 的方法就是为其添加元素,就如本文中的 绑定数组 “1” 对应的是一个 “

“,即是 Update,而2、3之后的则是 Enter:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<p></p>
<script>
var databases = [3,4,5];
var p = d3.selectAll("body")
.selectAll("p");

var update = p.data(databases)
var enter = update.enter();

update.text( function(d) {
return d;
})

enter.append("p")
.text(function(d) {
return d;
})
</script>


在上述的code中,我们还为此预留了一个元素,而通常的情况中,页面是没有其对应元素的,这个时候就可以通过选择一个空集,之后通过 enter来补足元素:

1
2
3
4
5
6
7
8
9
10
11
<script>
var databases = [1,2,3];
var body = d3.select("body")
body.selectAll("p")
.data(databases)
.enter()
.append("p")
.text(function(e) {
return e;
})
</script>
exit 处理方法

指的是:”如果数组长度小于元素数量“则符合 exit 的条件,那么多余的元素将不会被进行显示(俗称”删除元素“)。而处理 exit的方法也就是,当数据与数组之间没有**对应**的时候,即可删除元素:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
```js
<script>
var databases = [1,2,3];
var p = d3.select("body")
.selectAll("p")

var update = p.data(databases)
var exit = update.exit();

update.text(function(e) {
return e;
})
exit.remove()
</script>
绑定的顺序


默认的情况下data()是按照索引号来进行绑定的,就比如,第0个元素绑定数组第0项……,通常data()的一个参数是被绑定的数据,而第二个则是键值,使用此方法即可改变绑定的顺序,但通常使用此方法之后会更改其默认的绑定方式,是的其通过键值依次对应的方式来改变:

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
<p></p>
<p></p>
<p></p>

<script>
var dataset = [
{id:1 , name:"Ejs"},
{id:2 , name:"Vue"},
{id:3 , name:"Laravel"}
];
var p = d3.select("body").selectAll("p");

p.data(dataset)
.text(function(d) {
return d.id + "." + d.name;
});

dataset = [
{ id:1, name:"d3.js"},
{ id:3, name:"Less"}
];
p.data(dataset, function(d) {
return d.id;
})
.text(function(d) {
return d.id + "." + d.name;
})
</script>

首先我们定义了三个空的元素,并也相应的建立了三个数组,符合了update的更新及修改的条件,之后听过再次定义dataset来根据键值进行修改或更新信息,最终的出的结果将是:

1
2
3
1.d3.js
2.vue
3.Less

选择集常用方法

ascending and descending (排序)

ascending

d3.js 中主要用于进行数据的排序,而```descending```方法将用于从大到小的排序,需要注意的是在下述的 code 中,```sort```并不是由 d3所提供的```selection.sort```而是 js 所提供的数组方法。
1
2
3
4
```js
var number = [20,11,23,44,11,2]
number.sort(d3.ascending)
console.log(number)

descending

1
2
3
var number = [20,11,23,44,11,2]
number.sort(d3.descending)
console.log(number)

求值与计算

min or max and extent


d3.js 为我们提供了个三种的求值方法,分别为 最小值(min)、最大值(max)、以及一个中间值(extent)三种方法。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// 定义数组
var number = [20,11,23,44,11,2]

/*
min@ 最小值
max@ 最大值
extent @中间值
*/
var min = d3.min(number)
var max = d3.max(number)
var extent = d3.extent(number)

console.log('最小值:' + min)
console.log('最大值:' + max)
console.log('中间值:' + extent)

处理数据

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// 定义数组
var number = [20,11,23,44,11,2]

/*
min@ 最小值 加1
max@ 最大值 减1
extent @中间值 求余
*/
var min = d3.min(number, function(num) {
return num + 1
})

var max = d3.max(number, function(num) {
return num - 1
})

var extent = d3.extent(number, function(num) {
return num % 61
})

console.log('最小值加1:' + min)
console.log('最大值减1:' + max)
console.log('中间值求余:' + extent)

sun and mean

1
2
3
4
5
6
7
8
9
10
11
12
// 定义数组
var number = [20,11,23,44,11,2]

/*
sum @求和
mean @平均值
*/
var sum = d3.sum(number)
var mean = d3.mean(number)

console.log('总和:' + sum)
console.log('平均值:' + mean)

range

d3提供的生成和操作数组的一系列方法,可通过 range 来根据```start,stop,step```即“开始,停止,步骤”三个参数来决定数组的输出顺序及长度。
1
2
3
4
5
6
7
8
9

```js
var a = d3.range(10)
var b = d3.range(2,9)
var c = d3.range(2,10,3)

console.log(a)
console.log(b)
console.log(c)

shuffle

1
2
3
4
```js
var num = [1,2,3,4,5,6,7,8]
d3.shuffle(num)
console.log(num)

在上述的code中分别定义了数组[1,2,3,4,5,6,7,8]在i通过shuffle方法后贝重新进行随机排列为[2,3,8,1,4,7,5,6]

映射


映射(Map),是一个常见的数据结构,由键(key)以及值(value)组成,每个key分别对应一个 value,且可以根据使用 key来获取其对应的value,在 d3中,映射方法主要包括如下:

ID DA FA
d3.map 构建映射 d3.map([对象][,key])
map.has 指定的 key 是否存在 true@存在、false@不存在
map.get 如果存在则返回其对应 key 的 value 不存在则返回 undefined
map.set 为指定的 key 设置 value ,如果存在则进行覆盖
map.remove 删除或移除一个 key 不存在即返回 false
map.keys 以数组的形式返回该 map 下的所有 key
map.entries 以数组的形式返回该 map 下的所有 key and value
map.empty 如果数组为空,返回 teue,否则返回 false
map.size 返回映射大小
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
var numbar = [
{ id:1, name:'one'},
{ id:2, name:'two'},
{ id:3, name:'three'}
]

// 绑定 numbaer 数组
var map = d3.map(numbar, function(d) {
return d.id
})

/*
remove @移除 key 为1的数据
haser @key是否存在
seter @ 将key 为1的数组修改为 { id: 01, name:'oner'}
geter @输出指定key中的 key以及value
keys @输出当前所有的键值
values @返回所有的值
entries @返回所有的 key and value
size @返回索引大小
*/
map.remove(1)
var haser = map.has(1)
var seter = map.set(1, { id: 01, name:'oner'})
var geter = map.get(1)


var keys = map.keys()
var values = map.values()
var entries = map.entries()

var size = map.size()

console.log('key 1 是否存在:' + haser)
console.log(geter)

console.log(keys)
console.log(values)
console.log(entries)

console.log(size)
📖 more posts 📖