text: var http = require('https');
  var fs = require('fs');
  
  function getdata(){
    fs.mkdir('./data/',function(err) {
      if (err) {
        console.log("data文件夹已经存在");
      }
      getData("100000");
    })
  }
  
    var earthRadiusMeters = 6371000.0;
    var metersPerDegree = 2.0 * Math.PI * earthRadiusMeters / 360.0;
    var radiansPerDegree = Math.PI / 180.0;
    var degreesPerRadian = 180.0 / Math.PI;
    var pointArr;
  
    pointArr = new Array();
    var arr =  [
      [
        110.379257,
        34.600646
      ],
      [
        110.29549,
        34.610988
      ],
      [
        110.23636,
        34.670551
      ],
      [
        110.231432,
        34.701055
      ],
      [
        110.259149,
        34.73794
      ],
      [
        110.232664,
        34.803308
      ],
      [
        110.233896,
        34.837201
      ],
      [
        110.259765,
        34.881878
      ],
      [
        110.257301,
        34.93487
      ],
      [
        110.325671,
        35.014785
      ],
      [
        110.369402,
        35.158727
      ],
      [
        110.383569,
        35.244287
      ],
      [
        110.398968,
        35.278485
      ],
      [
        110.45009,
        35.327803
      ],
      [
        110.477808,
        35.413672
      ],
      [
        110.536322,
        35.455598
      ],
      [
        110.549873,
        35.505295
      ],
      [
        110.609619,
        35.632321
      ],
      [
        110.57759,
        35.701346
      ],
      [
        110.571431,
        35.80089
      ],
      [
        110.549257,
        35.877527
      ],
      [
        110.511684,
        35.879951
      ],
      [
        110.516612,
        35.972008
      ],
      [
        110.49259,
        35.994279
      ],
      [
        110.490127,
        36.040254
      ],
      [
        110.467953,
        36.074597
      ],
      [
        110.447011,
        36.164495
      ],
      [
        110.45625,
        36.226783
      ],
      [
        110.474112,
        36.248018
      ],
      [
        110.474112,
        36.306864
      ],
      [
        110.45933,
        36.330969
      ],
      [
        110.487047,
        36.394088
      ],
      [
        110.47288,
        36.453305
      ],
      [
        110.503677,
        36.487948
      ],
      [
        110.488895,
        36.556707
      ],
      [
        110.496902,
        36.582175
      ],
      [
        110.394656,
        36.676768
      ],
      [
        110.402663,
        36.697399
      ],
      [
        110.438388,
        36.685885
      ],
      [
        110.447011,
        36.737687
      ],
      [
        110.388497,
        36.765013
      ],
      [
        110.416214,
        36.790892
      ],
      [
        110.406975,
        36.824904
      ],
      [
        110.422989,
        36.859859
      ],
      [
        110.376178,
        36.882356
      ],
      [
        110.408823,
        36.892406
      ],
      [
        110.425453,
        36.960325
      ],
      [
        110.382953,
        37.021975
      ],
      [
        110.444547,
        37.007164
      ],
      [
        110.421757,
        37.038693
      ],
      [
        110.460561,
        37.044901
      ],
      [
        110.535706,
        37.11507
      ],
      [
        110.53509,
        37.137969
      ],
      [
        110.576974,
        37.173257
      ],
      [
        110.651503,
        37.256643
      ],
      [
        110.690307,
        37.287115
      ],
      [
        110.678604,
        37.318051
      ],
      [
        110.695234,
        37.34945
      ],
      [
        110.630561,
        37.373228
      ],
      [
        110.644111,
        37.435017
      ],
      [
        110.745125,
        37.450693
      ],
      [
        110.770995,
        37.538516
      ],
      [
        110.795017,
        37.566029
      ],
      [
        110.771611,
        37.594479
      ],
      [
        110.768531,
        37.645663
      ],
      [
        110.796248,
        37.66319
      ],
      [
        110.706321,
        37.705332
      ],
      [
        110.750669,
        37.736095
      ],
      [
        110.735886,
        37.770629
      ],
      [
        110.663821,
        37.803256
      ],
      [
        110.650887,
        37.840122
      ],
      [
        110.59422,
        37.921821
      ],
      [
        110.522771,
        37.954853
      ],
      [
        110.507989,
        38.012859
      ],
      [
        110.501829,
        38.098134
      ],
      [
        110.520308,
        38.119319
      ],
      [
        110.509221,
        38.192245
      ],
      [
        110.565887,
        38.215283
      ],
      [
        110.57759,
        38.297035
      ],
      [
        110.661358,
        38.308773
      ],
      [
        110.701394,
        38.353362
      ],
      [
        110.746973,
        38.366029
      ],
      [
        110.77777,
        38.44105
      ],
      [
        110.796864,
        38.453702
      ],
      [
        110.845524,
        38.439644
      ],
      [
        110.874473,
        38.453702
      ],
      [
        110.870777,
        38.510376
      ],
      [
        110.900342,
        38.515525
      ],
      [
        110.920052,
        38.581973
      ],
      [
        110.880016,
        38.618446
      ],
      [
        110.916357,
        38.674055
      ],
      [
        110.915125,
        38.704412
      ],
      [
        110.965016,
        38.755755
      ],
      [
        111.009363,
        38.847614
      ],
      [
        111.009979,
        38.932373
      ],
      [
        110.980414,
        38.970063
      ],
      [
        111.038313,
        39.020285
      ],
      [
        111.094363,
        39.030046
      ],
      [
        111.138095,
        39.064432
      ],
      [
        111.173819,
        39.135011
      ],
      [
        111.163348,
        39.152644
      ],
      [
        111.247732,
        39.302351
      ],
      [
        111.213855,
        39.301425
      ],
      [
        111.155341,
        39.338918
      ],
      [
        111.155341,
        39.368065
      ],
      [
        111.125776,
        39.366678
      ],
      [
        111.143022,
        39.407834
      ],
      [
        111.171971,
        39.42355
      ],
      [
        111.337043,
        39.420777
      ],
      [
        111.364144,
        39.467445
      ],
      [
        111.418963,
        39.500232
      ],
      [
        111.441137,
        39.596657
      ],
      [
        111.462079,
        39.626157
      ],
      [
        111.438057,
        39.643206
      ],
      [
        111.502115,
        39.663015
      ],
      [
        111.618527,
        39.633069
      ],
      [
        111.646245,
        39.644128
      ],
      [
        111.722621,
        39.605877
      ],
      [
        111.783599,
        39.588819
      ],
      [
        111.842729,
        39.620166
      ],
      [
        111.87907,
        39.605877
      ],
      [
        111.93204,
        39.61233
      ],
      [
        111.923417,
        39.663936
      ],
      [
        111.957294,
        39.688804
      ],
      [
        111.970229,
        39.79646
      ],
      [
        112.034286,
        39.852981
      ],
      [
        112.042294,
        39.886044
      ],
      [
        112.174721,
        40.051125
      ],
      [
        112.183344,
        40.084093
      ],
      [
        112.232003,
        40.133058
      ],
      [
        112.233235,
        40.170101
      ],
      [
        112.28559,
        40.197985
      ],
      [
        112.310227,
        40.256457
      ],
      [
        112.345336,
        40.256457
      ],
      [
        112.418017,
        40.295259
      ],
      [
        112.456205,
        40.300278
      ],
      [
        112.509176,
        40.270154
      ],
      [
        112.6299,
        40.235906
      ],
      [
        112.72845,
        40.168272
      ],
      [
        112.750624,
        40.167815
      ],
      [
        112.844863,
        40.203926
      ],
      [
        112.892906,
        40.326284
      ],
      [
        113.039499,
        40.37006
      ],
      [
        113.11526,
        40.380999
      ],
      [
        113.251382,
        40.413352
      ],
      [
        113.277252,
        40.38738
      ],
      [
        113.316056,
        40.319898
      ],
      [
        113.387505,
        40.318985
      ],
      [
        113.559968,
        40.348631
      ],
      [
        113.680692,
        40.443867
      ],
      [
        113.763228,
        40.473914
      ],
      [
        113.794641,
        40.518049
      ],
      [
        113.855619,
        40.457071
      ],
      [
        113.890112,
        40.466631
      ],
      [
        113.948626,
        40.514865
      ],
      [
        114.011452,
        40.515775
      ],
      [
        114.061959,
        40.528964
      ],
      [
        114.076741,
        40.57579
      ],
      [
        114.041633,
        40.608503
      ],
      [
        114.059495,
        40.633027
      ],
      [
        114.074277,
        40.723325
      ],
      [
        114.134639,
        40.737381
      ],
      [
        114.160509,
        40.716523
      ],
      [
        114.209168,
        40.629848
      ],
      [
        114.283081,
        40.590785
      ],
      [
        114.273842,
        40.553063
      ],
      [
        114.293552,
        40.551245
      ],
      [
        114.267066,
        40.474369
      ],
      [
        114.298479,
        40.446599
      ],
      [
        114.286161,
        40.42474
      ],
      [
        114.31203,
        40.372795
      ],
      [
        114.389638,
        40.351367
      ],
      [
        114.446305,
        40.372795
      ],
      [
        114.470942,
        40.349543
      ],
      [
        114.530688,
        40.344983
      ],
      [
        114.510978,
        40.303016
      ],
      [
        114.46971,
        40.267872
      ],
      [
        114.406269,
        40.245954
      ],
      [
        114.362537,
        40.250064
      ],
      [
        114.303407,
        40.231795
      ],
      [
        114.255364,
        40.236363
      ],
      [
        114.235654,
        40.198442
      ],
      [
        114.14511,
        40.177416
      ],
      [
        114.097683,
        40.193871
      ],
      [
        114.073046,
        40.168729
      ],
      [
        114.073046,
        40.168729
      ],
      [
        114.101995,
        40.099655
      ],
      [
        114.084748,
        40.070816
      ],
      [
        114.044712,
        40.05662
      ],
      [
        114.019459,
        40.102859
      ],
      [
        113.989278,
        40.112469
      ],
      [
        113.959097,
        40.033718
      ],
      [
        113.910438,
        40.011725
      ],
      [
        114.021307,
        39.992017
      ],
      [
        114.047176,
        39.916339
      ],
      [
        114.067502,
        39.922304
      ],
      [
        114.17406,
        39.897521
      ],
      [
        114.212248,
        39.918633
      ],
      [
        114.229494,
        39.899357
      ],
      [
        114.201161,
        39.882831
      ],
      [
        114.225183,
        39.857114
      ],
      [
        114.395182,
        39.867218
      ],
      [
        114.390254,
        39.819441
      ],
      [
        114.408732,
        39.782207
      ],
      [
        114.408117,
        39.65196
      ],
      [
        114.431522,
        39.614174
      ],
      [
        114.49558,
        39.608182
      ],
      [
        114.51529,
        39.564838
      ],
      [
        114.568877,
        39.574062
      ],
      [
        114.530073,
        39.484995
      ],
      [
        114.501739,
        39.476682
      ],
      [
        114.496812,
        39.438339
      ],
      [
        114.470942,
        39.408759
      ],
      [
        114.480797,
        39.350023
      ],
      [
        114.43029,
        39.306981
      ],
      [
        114.437066,
        39.259279
      ],
      [
        114.416124,
        39.243063
      ],
      [
        114.47587,
        39.216181
      ],
      [
        114.443841,
        39.173984
      ],
      [
        114.388406,
        39.176767
      ],
      [
        114.360689,
        39.134082
      ],
      [
        114.369928,
        39.107623
      ],
      [
        114.345907,
        39.075116
      ],
      [
        114.252284,
        39.073723
      ],
      [
        114.180835,
        39.0491
      ],
      [
        114.157429,
        39.06118
      ],
      [
        114.10877,
        39.052352
      ],
      [
        114.097067,
        39.083477
      ],
      [
        114.064422,
        39.094158
      ],
      [
        114.050872,
        39.135939
      ],
      [
        114.006524,
        39.122943
      ],
      [
        113.994821,
        39.095551
      ],
      [
        113.961561,
        39.100659
      ],
      [
        113.930148,
        39.063503
      ],
      [
        113.898119,
        39.067684
      ],
      [
        113.80696,
        38.989598
      ],
      [
        113.776779,
        38.986807
      ],
      [
        113.76754,
        38.959828
      ],
      [
        113.776163,
        38.885814
      ],
      [
        113.795257,
        38.86066
      ],
      [
        113.855619,
        38.828972
      ],
      [
        113.836525,
        38.79587
      ],
      [
        113.839605,
        38.758554
      ],
      [
        113.802648,
        38.76322
      ],
      [
        113.775547,
        38.710014
      ],
      [
        113.720728,
        38.713283
      ],
      [
        113.70225,
        38.65163
      ],
      [
        113.612939,
        38.646022
      ],
      [
        113.603084,
        38.58665
      ],
      [
        113.561816,
        38.558115
      ],
      [
        113.5612,
        38.485557
      ],
      [
        113.583374,
        38.459793
      ],
      [
        113.537794,
        38.418083
      ],
      [
        113.525475,
        38.382916
      ],
      [
        113.557504,
        38.343508
      ],
      [
        113.54457,
        38.270734
      ],
      [
        113.570439,
        38.237375
      ],
      [
        113.649895,
        38.229855
      ],
      [
        113.678844,
        38.20541
      ],
      [
        113.711489,
        38.213873
      ],
      [
        113.720728,
        38.174843
      ],
      [
        113.797105,
        38.163083
      ],
      [
        113.825438,
        38.169199
      ],
      [
        113.810039,
        38.112729
      ],
      [
        113.876561,
        38.055273
      ],
      [
        113.872249,
        37.990228
      ],
      [
        113.901198,
        37.985041
      ],
      [
        113.936307,
        37.923237
      ],
      [
        113.959097,
        37.906244
      ],
      [
        113.976959,
        37.816965
      ],
      [
        114.006524,
        37.813656
      ],
      [
        114.044712,
        37.762116
      ],
      [
        114.000981,
        37.735149
      ],
      [
        113.993589,
        37.706752
      ],
      [
        114.061343,
        37.722372
      ],
      [
        114.12848,
        37.698231
      ],
      [
        114.139567,
        37.675977
      ],
      [
        114.115545,
        37.620075
      ],
      [
        114.123553,
        37.60159
      ],
      [
        114.036705,
        37.49438
      ],
      [
        114.014531,
        37.424564
      ],
      [
        113.973879,
        37.403178
      ],
      [
        113.962792,
        37.355633
      ],
      [
        113.90243,
        37.309962
      ],
      [
        113.886416,
        37.23902
      ],
      [
        113.853155,
        37.2152
      ],
      [
        113.832213,
        37.167536
      ],
      [
        113.773083,
        37.1518
      ],
      [
        113.758301,
        37.075459
      ],
      [
        113.788482,
        37.059704
      ],
      [
        113.771851,
        37.01672
      ],
      [
        113.791561,
        36.987572
      ],
      [
        113.76138,
        36.956022
      ],
      [
        113.792793,
        36.894798
      ],
      [
        113.773083,
        36.855072
      ],
      [
        113.731815,
        36.858902
      ],
      [
        113.696707,
        36.882356
      ],
      [
        113.676381,
        36.855551
      ],
      [
        113.680692,
        36.789933
      ],
      [
        113.600004,
        36.753029
      ],
      [
        113.549497,
        36.75207
      ],
      [
        113.535946,
        36.732412
      ],
      [
        113.499606,
        36.740564
      ],
      [
        113.465113,
        36.707953
      ],
      [
        113.506997,
        36.705075
      ],
      [
        113.476816,
        36.655171
      ],
      [
        113.486671,
        36.635008
      ],
      [
        113.54457,
        36.623484
      ],
      [
        113.539642,
        36.594186
      ],
      [
        113.588301,
        36.562955
      ],
      [
        113.554425,
        36.494682
      ],
      [
        113.587069,
        36.461005
      ],
      [
        113.635729,
        36.45138
      ],
      [
        113.670221,
        36.424906
      ],
      [
        113.708409,
        36.423461
      ],
      [
        113.731199,
        36.363257
      ],
      [
        113.736127,
        36.324702
      ],
      [
        113.712105,
        36.303489
      ],
      [
        113.716417,
        36.262492
      ],
      [
        113.676997,
        36.222439
      ],
      [
        113.697939,
        36.181883
      ],
      [
        113.651743,
        36.172224
      ],
      [
        113.712721,
        36.129708
      ],
      [
        113.655439,
        36.124876
      ],
      [
        113.673917,
        36.111826
      ],
      [
        113.68562,
        36.056219
      ],
      [
        113.661598,
        36.042673
      ],
      [
        113.694859,
        36.026707
      ],
      [
        113.678844,
        35.985565
      ],
      [
        113.637576,
        35.98847
      ],
      [
        113.654207,
        35.931322
      ],
      [
        113.637576,
        35.869769
      ],
      [
        113.660982,
        35.837277
      ],
      [
        113.585222,
        35.825635
      ],
      [
        113.604316,
        35.797008
      ],
      [
        113.587685,
        35.736808
      ],
      [
        113.592613,
        35.692114
      ],
      [
        113.622794,
        35.674618
      ],
      [
        113.62341,
        35.630862
      ],
      [
        113.578446,
        35.63378
      ],
      [
        113.547649,
        35.656632
      ],
      [
        113.55812,
        35.622108
      ],
      [
        113.513773,
        35.573943
      ],
      [
        113.498374,
        35.532566
      ],
      [
        113.440476,
        35.50773
      ],
      [
        113.386889,
        35.503833
      ],
      [
        113.348085,
        35.468268
      ],
      [
        113.31236,
        35.481424
      ],
      [
        113.298194,
        35.427325
      ],
      [
        113.23352,
        35.453161
      ],
      [
        113.189789,
        35.449261
      ],
      [
        113.185477,
        35.409283
      ],
      [
        113.163919,
        35.408796
      ],
      [
        113.149137,
        35.350743
      ],
      [
        113.126347,
        35.332197
      ],
      [
        113.067217,
        35.353671
      ],
      [
        112.997,
        35.362455
      ],
      [
        112.992072,
        35.296068
      ],
      [
        112.936022,
        35.284346
      ],
      [
        112.907072,
        35.245753
      ],
      [
        112.818377,
        35.258457
      ],
      [
        112.766022,
        35.203718
      ],
      [
        112.720443,
        35.206652
      ],
      [
        112.628052,
        35.263342
      ],
      [
        112.637291,
        35.225716
      ],
      [
        112.513487,
        35.218384
      ],
      [
        112.390915,
        35.238911
      ],
      [
        112.36751,
        35.220339
      ],
      [
        112.288053,
        35.21985
      ],
      [
        112.304684,
        35.252105
      ],
      [
        112.242474,
        35.235002
      ],
      [
        112.21722,
        35.253082
      ],
      [
        112.058924,
        35.279951
      ],
      [
        112.078634,
        35.219362
      ],
      [
        112.03983,
        35.194429
      ],
      [
        112.066315,
        35.153346
      ],
      [
        112.062004,
        35.055937
      ],
      [
        112.016424,
        35.06916
      ],
      [
        111.903091,
        35.079933
      ],
      [
        111.810084,
        35.062304
      ],
      [
        111.807005,
        35.032914
      ],
      [
        111.740483,
        35.004493
      ],
      [
        111.66965,
        34.988319
      ],
      [
        111.681969,
        34.951056
      ],
      [
        111.646861,
        34.938794
      ],
      [
        111.570484,
        34.843094
      ],
      [
        111.527984,
        34.849968
      ],
      [
        111.502731,
        34.829834
      ],
      [
        111.439289,
        34.838183
      ],
      [
        111.389398,
        34.815098
      ],
      [
        111.345666,
        34.831798
      ],
      [
        111.29208,
        34.806747
      ],
      [
        111.260667,
        34.820502
      ],
      [
        111.232949,
        34.789551
      ],
      [
        111.148566,
        34.80773
      ],
      [
        111.118385,
        34.756622
      ],
      [
        111.035233,
        34.74089
      ],
      [
        110.976103,
        34.706466
      ],
      [
        110.929907,
        34.731548
      ],
      [
        110.89911,
        34.661693
      ],
      [
        110.870777,
        34.636098
      ],
      [
        110.812263,
        34.624775
      ],
      [
        110.749437,
        34.652342
      ],
      [
        110.710017,
        34.605078
      ],
      [
        110.610851,
        34.60754
      ],
      [
        110.533242,
        34.583406
      ],
      [
        110.488279,
        34.610988
      ],
      [
        110.424837,
        34.588332
      ],
      [
        110.379257,
        34.600646
      ]
    ];
  
  b();
  c();
  d();
  
  
    function getData(str) {
    var html = '';
    http.get('https://geo.datav.aliyun.com/areas_v2/bound/' + str + '_full.json', function (req, res) {
      req.on('data', function (data) {
        html += data;
      });
      req.on('end', function () {
        var json = html.toString();
        if (json.indexOf('The specified key does not exist.') < 0) {
          writeJson(json, str);
          if(json.indexOf("adcode") > -1){
            var data = JSON.parse(json).features;
            for (let j = 0; j < data.length; j++) {
              getData(data[j].properties.adcode);
            }
          }
        }else{
          getDataL(str)
        }
      });
    });
  
  }
  function getDataL(str) {
    var html = '';
    http.get('https://geo.datav.aliyun.com/areas_v2/bound/' + str + '.json', function (req, res) {
      req.on('data', function (data) {
        html += data;
      });
      req.on('end', function () {
        var json = html.toString();
        writeJson(json, str);
      });
    });
  }
  function writeJson(json, str) {
    fs.writeFile('./data/' + str + '.json', json, function (err) {
      if (err) {
        console.log(err);
      }
      console.log('success');
    })
  }
  
  //https://www.cnblogs.com/grimm/p/5097383.html
  function calculateArea(points) {
    if (points.length > 2) {
      var areaMeters2 = PlanarPolygonAreaMeters2(points);
      if (areaMeters2 > 1000000.0) {
        //北京面积：16410.54平方千米
        areaMeters2 = SphericalPolygonAreaMeters2(points);
        console.log("面积c：", areaMeters2);
      }
    }
  }
  
  /*球面多边形面积计算*/
  function SphericalPolygonAreaMeters2(points) {
    var totalAngle = 0;
    for (var i = 0; i < points.length; i++) {
      var j = (i + 1) % points.length;
      var k = (i + 2) % points.length;
      totalAngle += Angle(points[i], points[j], points[k]);
    }
    var planarTotalAngle = (points.length - 2) * 180.0;
    var sphericalExcess = totalAngle - planarTotalAngle;
    if (sphericalExcess > 420.0) {
      totalAngle = points.length * 360.0 - totalAngle;
      sphericalExcess = totalAngle - planarTotalAngle;
    } else if (sphericalExcess > 300.0 && sphericalExcess < 420.0) {
      sphericalExcess = Math.abs(360.0 - sphericalExcess);
    }
    return sphericalExcess * radiansPerDegree * earthRadiusMeters * earthRadiusMeters;
  }
  
  /*角度*/
  function Angle(p1, p2, p3) {
    var bearing21 = Bearing(p2, p1);
    var bearing23 = Bearing(p2, p3);
    var angle = bearing21 - bearing23;
    if (angle < 0) {
      angle += 360;
    }
    return angle;
  }
  
  
  /*方向*/
  function Bearing(from, to) {
    var lat1 = from[1] * radiansPerDegree;
    var lon1 = from[0] * radiansPerDegree;
    var lat2 = to[1] * radiansPerDegree;
    var lon2 = to[0] * radiansPerDegree;
    var angle = -Math.atan2(Math.sin(lon1 - lon2) * Math.cos(lat2), Math.cos(lat1) * Math.sin(lat2) - Math.sin(lat1) * Math.cos(lat2) * Math.cos(lon1 - lon2));
    if (angle < 0) {
      angle += Math.PI * 2.0;
    }
    angle = angle * degreesPerRadian;
    return angle;
  }
  
  /*平面多边形面积*/
  function PlanarPolygonAreaMeters2(points) {
    var a = 0;
    for (var i = 0; i < points.length; ++i) {
      var j = (i + 1) % points.length;
      var xi = points[i][0] * metersPerDegree * Math.cos(points[i][1] * radiansPerDegree);
      var yi = points[i][1] * metersPerDegree;
      var xj = points[j][0] * metersPerDegree * Math.cos(points[j][1] * radiansPerDegree);
      var yj = points[j][1] * metersPerDegree;
      a += xi * yj - xj * yi;
    }
    return Math.abs(a / 2);
  }
  
  
  
  
  
  function b() {
    var temp=arr;
    var arr_len=arr.length;
    var s = temp[0][1] * (temp[arr_len -1][0]-temp[1][0])
    for(let i=1;i< arr_len;i++){
      s += temp[i][1] * (temp[i-1][0] - temp[(i+1)%arr_len][0])
    }
    console.log('面积b：',Math.round(Math.abs(s/2)*9101160000.085981,6));
    return Math.round(Math.abs(s/2)*9101160000.085981,6)
  }
  
  
  function c() {
    calculateArea(arr);
  }
  function d() {
    computeSignedArea(arr);
  }
  function computeSignedArea(path) {
  //传入path：{
  //   [{lat:,lng:}],[{lat:,lng:}],[{lat:,lng:}]
  let radius= 6371009
  let len = path.length;
  if (len < 3) return 0;
  let total = 0;
  let  prev = path[len - 1];
  let prevTanLat = Math.tan(((Math.PI / 2 - prev[0]/180*Math.PI) / 2));
  let prevLng = (prev[1])/180*Math.PI;
  for (let i in path) {
    let tanLat = Math.tan((Math.PI / 2 -
      (path[i][0])/180*Math.PI) / 2);
    let lng = (path[i][1])/180*Math.PI;
    total += polarTriangleArea(tanLat, lng, prevTanLat, prevLng);
    prevTanLat = tanLat;
    prevLng = lng;
  }
    console.log('面积d：',Math.abs(total * (radius * radius)));
  
  return Math.abs(total * (radius * radius));
  }
  function polarTriangleArea(tan1,lng1,tan2,lng2) {
    let deltaLng = lng1 - lng2;
    let t = tan1 * tan2;
    return 2 * Math.atan2(t * Math.sin(deltaLng), 1 + t * Math.cos(deltaLng));
  }
  