小蚂蚁 发表于 2021-10-6 13:58:27

Java调用echarts提供的地图压缩方法来压缩地图

今天小编就为大家分享一篇关于Java调用echarts提供的地图压缩方法来压缩地图,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧
由于默认情况下的 geojson 文件太大,echarts 提供了方法可以压缩地图。

geojson 介绍:http://geojson.org/
echarts 提供了压缩算法,但是代码是 javascript 的,参考代码写个 java 的也可以,但是通过 java 提供的脚本引擎可以很方便的直接执行 js。
本文压缩代码参考下面的项目:

https://github.com/giscafer/mapshaper-plus
这里的算法也是来源于 echarts
从该项目提取出压缩地图的 js 代码,简化后如下:


function convert2echarts(rawstr,filename,type){
var results="";
var json = json.parse(rawstr);
// meta tag
json.utf8encoding = true;
var features = json.features;
if (!features) {
    return;
}
features.foreach(function (feature){
    var encodeoffsets = feature.geometry.encodeoffsets = [];
    var coordinates = feature.geometry.coordinates;
    if (feature.geometry.type === 'polygon') {
      coordinates.foreach(function (coordinate, idx){
      coordinates = encodepolygon(
          coordinate, encodeoffsets = []
      );
      });
    } else if(feature.geometry.type === 'multipolygon') {
      coordinates.foreach(function (polygon, idx1){
      encodeoffsets = [];
      polygon.foreach(function (coordinate, idx2) {
          coordinates = encodepolygon(
            coordinate, encodeoffsets = []
          );
      });
      });
    }
});
if(type==='json'){
    results=json.stringify(json);
}else{
    results=addechartsjswrapper(json.stringify(json), filename);
}
return results;
};
function encodepolygon(coordinate, encodeoffsets) {
var result = '';
var prevx = quantize(coordinate);
var prevy = quantize(coordinate);
// store the origin offset
encodeoffsets = prevx;
encodeoffsets = prevy;
for (var i = 0; i < coordinate.length; i++) {
    var point = coordinate;
    result+=encode(point, prevx);
    result+=encode(point, prevy);
    prevx = quantize(point);
    prevy = quantize(point);
}
return result;
}
function addamdwrapper(jsonstr) {
return ['define(function() {',
    'return ' + jsonstr + ';',
    '});'].join('\n');
}
function addechartsjswrapper(jsonstr,filename) {
return ['(function (root, factory) {',
    "if (typeof define === 'function' && define.amd) {",
    "    define(['exports', 'echarts'], factory);",
    "} else if (typeof exports === 'object' && typeof exports.nodename !== 'string') {",
    "    factory(exports, require('echarts'));",
    "} else {",
    "    factory({}, root.echarts);",
    "}",
    " }(this, function (exports, echarts) {",
    "    var log = function (msg) {",
    "      if (typeof console !== 'undefined') {",
    "      console && console.error && console.error(msg);",
    "      }",
    "    }",
    " if (!echarts) {",
    "    log('echarts is not loaded');",
    "      return;",
    "    }",
    " if (!echarts.registermap) {",
    "    log('echarts map is not loaded')",
    "    return;",
    " }",
    " echarts.registermap('"+filename+"',"+ jsonstr,
    ' )}));'].join('\n');
}
function encode(val, prev){
// quantization
val = quantize(val);
// var tmp = val;
// delta
val = val - prev;
if (((val << 1) ^ (val >> 15)) + 64 === 8232) {
    //wtf, 8232 will get syntax error in js code
    val--;
}
// zigzag
val = (val << 1) ^ (val >> 15);
// add offset and get unicode
return string.fromcharcode(val+64);
// var tmp = {'tmp' : str};
// try{
//   eval("(" + json.stringify(tmp) + ")");
// }catch(e) {
//   console.log(val + 64);
// }
}
function quantize(val) {
return math.ceil(val * 1024);
}
一个河北省的 geojson 示例(文件大小为 55 kb):


{"type": "featurecollection",
"cp":,
"size":"1300",
"features":
[
{"type": "feature","properties":{"id":"1308","name":"承德市","cp":,"childnum":11},"geometry":{"type":"polygon","coordinates":[[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]]}},
{"type": "feature","properties":{"id":"1307","name":"张家口市","cp":,"childnum":15},"geometry":{"type":"polygon","coordinates":[[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]]}},
{"type": "feature","properties":{"id":"1306","name":"保定市","cp":,"childnum":23},"geometry":{"type":"polygon","coordinates":[[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]]}},
{"type": "feature","properties":{"id":"1302","name":"唐山市","cp":,"childnum":11},"geometry":{"type":"polygon","coordinates":[[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]]}},
{"type": "feature","properties":{"id":"1309","name":"沧州市","cp":,"childnum":15},"geometry":{"type":"polygon","coordinates":[[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]]}},
{"type": "feature","properties":{"id":"1301","name":"石家庄市","cp":,"childnum":19},"geometry":{"type":"polygon","coordinates":[[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]]}},
{"type": "feature","properties":{"id":"1305","name":"邢台市","cp":,"childnum":18},"geometry":{"type":"polygon","coordinates":[[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]]}},
{"type": "feature","properties":{"id":"1304","name":"邯郸市","cp":,"childnum":18},"geometry":{"type":"polygon","coordinates":[[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]]}},
{"type": "feature","properties":{"id":"1303","name":"秦皇岛市","cp":,"childnum":5},"geometry":{"type":"polygon","coordinates":[[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]]}},
{"type": "feature","properties":{"id":"1311","name":"衡水市","cp":,"childnum":11},"geometry":{"type":"polygon","coordinates":[[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]]}},
{"type": "feature","properties":{"id":"1310","name":"廊坊市","cp":,"childnum":9},"geometry":{"type":"multipolygon","coordinates":[[[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]],[[,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,]]]}}
]
}
下面使用 java 8 中的脚本引擎执行该代码。


package tk.mybatis;
import javax.script.invocable;
import javax.script.scriptengine;
import javax.script.scriptenginemanager;
import javax.script.scriptexception;
import java.io.filenotfoundexception;
import java.io.filereader;
public class encoder {
public static final scriptengine engine = new scriptenginemanager().getenginebyname("nashorn");
static {
    try {
      //注意这里的 encode.js 路径,文件内容就是上面的 js 代码
      engine.eval(new filereader(encoder.class.getresource("/encode.js").getpath()));
    } catch (scriptexception e) {
      e.printstacktrace();
    } catch (filenotfoundexception e) {
      e.printstacktrace();
    }
}
public static final invocable invocable = (invocable) engine;
/**
   * 压缩为 echarts 格式的地图
   * @param geojson
   * @param filename
   * @param type   json 或 其他(按js处理)
   * @return
   */
public static string convert2echarts(string geojson, string filename, string type) {
    try {
      return (string) invocable.invokefunction("convert2echarts", geojson, filename, type);
    } catch (scriptexception e) {
      throw new runtimeexception(e);
    } catch (nosuchmethodexception e) {
      throw new runtimeexception(e);
    }
}
}
用法:


string json = encoder.convert2echarts(
"上面提供的河北省的geojson内容", "河北省", "json");
压缩后的结果如下(文件大小为 9 kb):


{
"type": "featurecollection",
"cp": [115.4004,
39.4688],
"size": "1300",
"features": [{
    "type": "feature",
    "properties": {
      "id": "1308",
      "name": "承德市",
      "cp": [117.5757,
      41.4075],
      "childnum": 11
    },
    "geometry": {
      "type": "polygon",
      "coordinates": ["@@llnlmxn&bdquo;&bdquo;ivvlunb@vvxxjwl@l&thorn;Žvnnv&bdquo;j&tilde;_@wkm&scaron;k&bdquo;b&sbquo;x&bdquo;wxk&tilde;wxx&scaron;klb&sup2;k@nvvvb&bdquo;l@wlu&sup2;&bdquo;lkvnujvz@vvb@l&aring;&frac14;mvuvnb&ocirc;avx@°ub@lwbx&scaron;@b@bvb°x&bdquo;@vx&egrave;lvl&scaron;a&aelig;@&thorn;b&sup2;k°@lvuŽ@xn@vw&sbquo;lxb@¤vx&scaron;kvvvlnm°_ƨ¤@auiva&bdquo;alkx&rsaquo;°k&bdquo;&trade;v@&bdquo;alwuvy&bdquo;u@k&oacute;&trade;°&fnof;na°uvuumu&aelig;w@mklvu&fnof;wvi&bdquo;w&scaron;lnn@xlvnk&bdquo;myu@&fnof;u°uxav@u¥&fnof;u@u&aelig;&trade;@avukwu&macr;&fnof;au@wluv@bkbmkulmkkuvukmviuwlwv&sup2;&trade;uml°u@w&bdquo;luwvm@uuk@_&fnof;kuu&uuml;axw@&fnof;vkuu@mviuulmnivvvb&egrave;vlknbvk&scaron;@ni&tilde;@nvnwvlvk&bdquo;k&bdquo;&bdquo;&tilde;vnb@auivw@in&trade;°@lvni&scaron;@lwĢ@°uvl@b&bdquo;@vyuu&fnof;a@w@wunu@w&ccedil;&macr;&trade;k@ukkjwa&ucirc;bmk@mva&thorn;u@amkw&fnof;@mxukk&yuml;&fnof;£@a&bdquo;kl@um°uxwla&bdquo;al@nmlxnw°znw@a&fnof;wv&trade;@&fnof;akbĉ¥vmu@&fnof;i&fnof;v&fnof;u&fnof;jkumwu&trade;kbmkua&fnof;kkuvu@kv@@klw—&trade;wau@km&fnof;xv&egrave;nbmluu&fnof;k&fnof;x&macr;jkb&fnof;i@jmiuwu@&fnof;lml@xkj@u&trade;k&fnof;k@avkwwa—iww&fnof;mu&fnof;@mu@j@uaċu&trade;auu&fnof;vki±&fnof;k@uu&fnof;@ubvvm@uvk&fnof;l&fnof;lkiwauluw&fnof;xuju&bdquo;&fnof;@wbub@lkxuxm@@jvn@j@b&bdquo;n&fnof;b@vkx@b&scaron;lu&sbquo;&aelig;n&bdquo;j&scaron;avxnkvvmzx&sbquo;°v@_ljxxwx&fnof;k&macr;b&aring;amu&fnof;@lui&rsaquo;b&ntilde;j@l&ccedil;kki&ccedil;`kxwl@&bdquo;&fnof;@@buvub&macr;xwkk&bdquo;&aring;&bdquo;vlulw@&fnof;Žn|ul@i&trade;lmuuuvm@kw&fnof;nkkma&macr;xukwmnwvw&yacute;l&bdquo;mŽ&trade;vubuvwb@lnxm&bdquo;xvŽmbxx&rsaquo;|@&bdquo;nb@`&trade;&bdquo;&fnof;v&fnof;@kb&fnof;lu&bdquo;mvulkbvxk&ordm;mnm@@xk|&scaron;bĢ&uuml;l&scaron;"],
      "encodeoffsets": [[118868,
      42784]]
    }
},
{
    "type": "feature",
    "properties": {
      "id": "1307",
      "name": "张家口市",
      "cp": [115.1477,
      40.8527],
      "childnum": 15
    },
    "geometry": {
      "type": "polygon",
      "coordinates": ["@@k&trade;ġ&ucirc;&trade;al¥@wn@nml&sup1;uwlavknuv&fnof;&bdquo;kla&bdquo;@&bdquo;u&scaron;&fnof;@_ma@&fnof;&oelig;¥wwnau&sbquo;wn&fnof;mw@kxavuva&scaron;unmwuk°&trade;l&fnof;nuvuxwvw&trade;iwv&oacute;kui@wx&fnof;xuu@mma@kukwlkw@yk@&fnof;avkuuċauu@wk@unm@uvmlm±iu&fnof;kj&trade;kw&fnof;@a&bdquo;i@m@u&bdquo;&fnof;v&fnof;&bdquo;ula&bdquo;@vxv&fnof;xmvwnkwk&fnof;ku_k@m¥&fnof;mx_&trade;jmnu@km@u@kmu&trade;v&fnof;u@u&trade;@umk@@l&fnof;mw@&ucirc;£w&fnof;ka@wk&trade;@a&fnof;i@mmk@mua@umu&fnof;i&fnof;ww@awu&fnof;bu@kb&ccedil;@kw&fnof;@makvuk&trade;u@a&fnof;m@au@mxku&fnof;b&fnof;kuxu&fnof;±kxvwluk@wku@v&trade;@wxua@wbux&fnof;ji&fnof;Ž@|v&egrave;vvx@±&ecirc;&macr;kui&fnof;`&macr;uulvx@v&fnof;@uk&fnof;i&fnof;vklmvkkm&scaron;@nuj&yacute;bkiujvx&scaron;vvxvbu&bdquo;vj&bdquo;un&trade;°bv&bdquo;mlu°&bdquo;xnk@ul@lv&egrave;vux&scaron;x@w&bdquo;@vx&scaron;v&sbquo;k&thorn;b&bdquo;n@vnbv&bdquo;m`&fnof;ux&trade;kw@uvkl&trade;km&frac14;@lunujvnv&bdquo;xv@vm@@lv&bdquo;kl&fnof;ikl@v&fnof;wlŽulwkul@mj&bdquo;@blbuvulmzujuxm@uubċ&uuml;k@ub@v&scaron;lvv&bdquo;|&ocirc;bvŽm&scaron;ukuku@m&bdquo;&bdquo;@vlvn&frac14;wbuj&macr;@@&bdquo;°&scaron;nill&egrave;l&tilde;@nx&scaron;wll&oelig;k&sbquo;j@bkxlxkxlxulklj&fnof;&scaron;xl@bw&bdquo;n`@n&aelig;Žxxll@xl@xb&sbquo;l&oelig;klvlixblvubujw@lx@vl@vvŽ&scaron;x&scaron;j&scaron;w&bdquo;n@wnl°k&bdquo;bvbl@vi@k&bdquo;@u@nmvmv@xuwi@axm@&trade;vuukwmn@lmuuk@mumk@unwvĉ@&fnof;&fnof;mu_v@xj&ocirc;vvu&scaron;lvun@&scaron;llunjl_n@&scaron;ml@xŽlllw&sup2;lvjul@vmbvblvxmvnl&scaron;@Ť|&bdquo;nn@&uuml;Ž@b&scaron;l&bdquo;@@xv`&bdquo;unb@vllvb&sup2;j&sbquo;xn¥&aelig;&ntilde;@¥&thorn;@"],
      "encodeoffsets": [[118868,
      42784]]
    }
},
{
    "type": "feature",
    "properties": {
      "id": "1306",
      "name": "保定市",
      "cp": [115.0488,
      39.0948],
      "childnum": 23
    },
    "geometry": {
      "type": "polygon",
      "coordinates": ["@@vbxw&scaron;@@ulv@xvlxkwu&sup2;lv&bdquo;vw&bdquo;l&bdquo;alvnwv@@b&bdquo;n@b&scaron;vvllunb&bdquo;@lx&egrave;@lav@&bdquo;axv@b&sbquo;x&bdquo;x&bdquo;j&sbquo;nv@vvb@nnl@n&bdquo;j@bl&scaron;l@&bdquo;a&scaron;&fnof;u_vwuwvu&scaron;kum&trade;ukb±mvw&oelig;u@viuw@uwk&bdquo;@vu@ynl&bdquo;m@iv@&sbquo;bnk&bdquo;lvavmnilaxwv@@wvl°@@xnx&bdquo;@v`v@vbuvvlvknwnl@ll@@_v@vvna&aelig;@&oelig;kvx&aelig;@n&fnof;@w&fnof;kmu—&trade;wm@km@k&uuml;kxu@&ntilde;w±niuwv&fnof;&bdquo;kla@i°wu±k&scaron;kmm&macr;m&fnof;_&fnof;jn&fnof;a&fnof;ww@ivauama@w&fnof;u&fnof;mu@mvw@axk@mwa@£km@a&fnof;_kvmunww@&macr;b&fnof;kumk@&fnof;v&ccedil;m@@kuu&trade;kuu&trade;@uvuamvuawikb@xu@@amukk&fnof;vkam@@kvukuwmkmuklub@xmj&fnof;&trade;u@uimv&ucirc;vmnuw&fnof;j&fnof;u@v&fnof;x@uwm@ub°|u&scaron;mxklmx@`ulu@@uw@@xkn&macr;@makv&trade;umxub&trade;°&fnof;lu&scaron;&fnof;bub&fnof;nuj&fnof;uuv&fnof;a&trade;lkbuu&rsaquo;juu@muuu&fnof;jka&fnof;@&trade;xuiwj&fnof;un&fnof;j@v&trade;z&fnof;@kb@`@bln@l&trade;b&fnof;Ž@x@&scaron;@&scaron;&bdquo;@xl&sbquo;bnbvb&bdquo;@&bdquo;&bdquo;vjlinl&scaron;bvw@u&bdquo;k&bdquo;l@lbnan@vb&sbquo;j&ocirc;ln&sbquo;uzlv@l&egrave;lvbvk@lvx—vwxx`wxxz&sbquo;bv`uxv¤nx@&bdquo;bvlvnvlul"],
      "encodeoffsets": [[117304,
      40512]]
    }
},
{
    "type": "feature",
    "properties": {
      "id": "1302",
      "name": "唐山市",
      "cp": [118.4766,
      39.6826],
      "childnum": 11
    },
    "geometry": {
      "type": "polygon",
      "coordinates": ["@@&bdquo;@vvl@&sup2;&bdquo;lj&bdquo;uvv&scaron;bČvvb&sbquo;@@inv&bdquo;@&sbquo;v&bdquo;nxx&tilde;jxb&sbquo;xul@b&bdquo;l&scaron;l@vli@wnk&bdquo;kv@vxnj@i&bdquo;jla°i&bdquo;w&bdquo;lvvnkmau&ccedil;&bdquo;wvk&ocirc;a&uuml;&macr;&bdquo;@nv°wnjlav@vunuuaw&macr;wxwwwna@£uawku&macr;&fnof;&macr;@avukkuamuu&fnof;n»&sbquo;an&trade;&bdquo;ivwuwlk&scaron;@&bdquo;llwvaku@k&bdquo;_l&fnof;&scaron;b&thorn;u°@&scaron;y°n&bdquo;@&bdquo;k&egrave;kww&trade;ţ¥ĉō&fnof;kġwuw&macr;£&macr;&fnof;&ccedil;wţw&fnof;@kk@k&fnof;¥&yacute;w&aring;b&ccedil;¤&ucirc;ťv&trade;lw°@ĸ&trade;x@vvvulvlkl@v@x&fnof;`ub@xm@uwb&fnof;k@&aelig;vbnlwv@lnxubl&sbquo;@x&macr;lmu&trade;vkkwlkk@_uk@u@ummuxmvxlwvulku@`w@uluk@xljxzv@@xml@vu@ux@kk@wbuk@xn`&fnof;xmjn&scaron;m&scaron;kxuvbuvlvvxubv@nkll&bdquo;kvk&thorn;bvkxi°kv&scaron;mvuiukulvxvjvlkv@v&fnof;@ubu@wuu@ubuk@b@n&fnof;v@vklmb@b"],
      "encodeoffsets": [[120398,
      41159]]
    }
},
{
    "type": "feature",
    "properties": {
      "id": "1309",
      "name": "沧州市",
      "cp": [116.8286,
      38.2104],
      "childnum": 15
    },
    "geometry": {
      "type": "polygon",
      "coordinates": ["@@@ln@u&egrave;&bdquo;Žl@vn&bdquo;l°ax@mxnvlu&bdquo;`@bln@¤xb@nwl@bux@nnv&sbquo;&bdquo;&bdquo;v@xnbvbub@j&sbquo;x&bdquo;x&bdquo;b&sbquo;mxa@k&bdquo;uvwlw&bdquo;k&bdquo;k&ocirc;vm@w&trade;kkk@kl»&egrave;&fnof;m&trade;vkxkla°@xvv@vi@ml@@vn@vx@v@j&bdquo;@vxuzvv&scaron;&scaron;&sup2;blvk|@&scaron;Ġ@@»&scaron;@vk@v&egrave;llk@xnj@aliul&bdquo;a&bdquo;vvb&scaron;@&bdquo;n@a&bdquo;u@wuiv@mun@mkxml@ll@lnw&scaron;b@xv@@a&bdquo;vvb&bdquo;v&bdquo;@vv&bdquo;ivw&egrave;b&tilde;i&egrave;»&fnof;ǟlw&scaron;avu&aring;u&fnof;&fnof;&trade;um@kvu&trade;wvkauwma&oacute;u&fnof;juu&macr;&ntilde;u¥mk&trade;&macr;ua&fnof;k&aring;n&ccedil;y&oacute;xmw&ucirc;x&macr;aċb&ucirc;a&rsaquo;j—w&trade;&yacute;u&macr;»&fnof;a&oacute;&oacute;um@i&fnof;&scaron;vvl@b&fnof;lujwlx@@x&scaron;xuxl¤v@v&bdquo;nvuv&bdquo;xvbv&scaron;@Ž&bdquo;@@vvn&bdquo;°vŽ@ţu&macr;v&fnof;um&fnof;uwv@mux&fnof;a&fnof;bukuwua&ccedil;kn&bdquo;&fnof;vk|wb@vnlmv@bkv@n&bdquo;xw`&aring;_uv&fnof;v@b&fnof;uklvx@vmlu&fnof;x@vvl@x—vwvl@vw@uum@"],
      "encodeoffsets": [[118485,
      39280]]
    }
},
{
    "type": "feature",
    "properties": {
      "id": "1301",
      "name": "石家庄市",
      "cp": [114.4995,
      38.1006],
      "childnum": 19
    },
    "geometry": {
      "type": "polygon",
      "coordinates": ["@@la&bdquo;@&scaron;y@u&bdquo;i&sbquo;m&bdquo;vxivj&scaron;w&bdquo;@lb&bdquo;ivvnv&sbquo;@vv&oelig;ivvla&scaron;k&bdquo;bvu&bdquo;vvi&bdquo;mva&bdquo;av&trade;&bdquo;k&scaron;&macr;vanw&scaron;vlunb°@lm@wx@@vv@vk@_nwlknwv&trade;&macr;¥van@vx&sbquo;@&bdquo;w@u&bdquo;v&bdquo;ivxnm&uuml;unuvjv@&bdquo;&scaron;ni@wvalknv@k&sbquo;mu£na@mvk°k&bdquo;lva@uu@u&fnof;mknwwkxu@aww@@km@uau@@klk@ukawaunamm@u&bdquo;a&macr;wwu@uk&fnof;l@Žun@x&trade;v&trade;luxvjub&trade;lmu@auwukmkkluum@mw—x&fnof;a&fnof;mmkkwum@@u&macr;juum&trade;ku&macr;@mkĉx&yacute;w&yacute;¥l&fnof;u&oacute;Žmwkuuuwvkkm&trade;kkmlx&bdquo;lxvlvxxj@nvjnz@vwl@`nx@&scaron;&fnof;x&fnof;@kvuumjmixx&bdquo;jv&bdquo;&fnof;nuv&fnof;@uvv&bdquo;@lu&scaron;&fnof;`uxvv&fnof;&bdquo;&fnof;lxl@l@b@vmx@b&trade;xn°&trade;u&fnof;bkkwlxlw@@b&fnof;k&bdquo;mkulmaklulmb@&scaron;xb@xmxu`v&bdquo;b@`llx@nwvxl@&sbquo;°wlxnlb&bdquo;kvk&bdquo;xvb@&tilde;x@l_lj@v@xnŽ&bdquo;i"],
      "encodeoffsets": [[116562,
      39691]]
    }
},
{
    "type": "feature",
    "properties": {
      "id": "1305",
      "name": "邢台市",
      "cp": [114.8071,
      37.2821],
      "childnum": 18
    },
    "geometry": {
      "type": "polygon",
      "coordinates": ["@@nklln&scaron;llxuvvlvnx&ocirc;&bdquo;v&sbquo;k&thorn;|&thorn;xĊwnl°@lvn&scaron;vv°i@vn@v&sbquo;lxnl&bdquo;n&bdquo;b&tilde;wnxn@vvlknlvlvx@bnv&scaron;kvauivw&scaron;k&scaron;u@wvm@&macr;@u¥vmu_°l&scaron;k&bdquo;k&sbquo;w@lx&sbquo;va&bdquo;u@w&scaron;u&fnof;uuklu&oacute;w@uvu&oelig;ul&fnof;°k&bdquo;wlku_na&bdquo;kvnlkkk&scaron;wwa@i&oelig;jva@iljnu@&bdquo;kvuumvlaxul@lm@kxw&yacute;&ntilde;nk&fnof;&trade;±&trade;k@wğ&rsaquo;@@u@mkĉlmvj@zmlnŽwlu&yacute;ju_&fnof;@@&scaron;mjkxuvlbkl&yacute;@&yacute;a&trade;b&macr;@&macr;±j&aring;wġauu@&fnof;ku&trade;@mvi±buk&fnof;l&trade;wux&fnof;jka&fnof;l&oacute;kulwbuvkkmnk@@bmluŽ&fnof;l@b@mnmjkuul&fnof;a&fnof;bnŽmn@lvv@|n@&bdquo;l@b&sbquo;znx@`vz@b&bdquo;xnv@xl&bdquo;lbnkvx"],
      "encodeoffsets": [[116764,
      38346]]
    }
},
{
    "type": "feature",
    "properties": {
      "id": "1304",
      "name": "邯郸市",
      "cp": [114.4775,
      36.535],
      "childnum": 18
    },
    "geometry": {
      "type": "polygon",
      "coordinates": ["@@&bdquo;bvklvninm&sbquo;@@a&bdquo;kvnk@al@nmllvuxavk&ocirc;l&bdquo;klb&bdquo;ivw&scaron;x&bdquo;kvl&sup2;a&sbquo;jnu&scaron;@lv@&bdquo;vvĢb&aelig;x&sup2;i°Ž°@&scaron;a&thorn;b&thorn;@lkkavulwni@&trade;&bdquo;@v`&thorn;i&sbquo;vxkmnk@y&sbquo;inuĊk&fnof;&ccedil;kuuamuuk&fnof;&fnof;@au@u&trade;&fnof;k@wuwvkvjvkkw°a@&bdquo;mk@ux@vv&bdquo;lvw@w&scaron;wva@&macr;xm@@luiwau@uwkxwmu@uwmukkmn@lkv&fnof;&sup2;&trade;v&fnof;auluvmjuuuw&fnof;lma@&trade;umkium&rsaquo;l—mv&scaron;mx@b&trade;luamk&aring;l@vmbku&macr;k&yacute;amzkjub±vkb&trade;l@lu@wikj&fnof;zkkmk&fnof;nualwkkkw@@nkbk@ww&macr;xuvuj@xlj@x&fnof;@xlwlku&fnof;`vunawa&bdquo;uv@uvi&fnof;auxuumv&fnof;k@i@w@&ccedil;&bdquo;u@@u@b&fnof;&sbquo;@nmkxmx&trade;@uxkvwux&bdquo;@`vlll@`&trade;zx&sbquo;&yacute;b@b&sbquo;&bdquo;@vuvkiujvz°kvlnllknl&bdquo;xllvvuvlxuj@nn&sbquo;&bdquo;i@mvulbn@@Žm&bdquo;@bv&bdquo;nv"],
      "encodeoffsets": [[116528,
      37885]]
    }
},
{
    "type": "feature",
    "properties": {
      "id": "1303",
      "name": "秦皇岛市",
      "cp": [119.2126,
      40.0232],
      "childnum": 5
    },
    "geometry": {
      "type": "polygon",
      "coordinates": ["@@lnv@xb&tilde;&scaron;kx@lu@@luvlv&bdquo;lvbnl&sbquo;a&scaron;lxvvn&sbquo;l&bdquo;i&bdquo;v&bdquo;u&bdquo;jv@unĊ|la&bdquo;b&scaron;@nj°um&fnof;v@&bdquo;wn@vu&bdquo;jvi°bnwlxnwvlvk&sup2;b&sbquo;akk&bdquo;li@auav&fnof;uwvuualavwnuvak¥&scaron;x@w&sbquo;k&oelig;lv&oacute;m&bdquo;muk@_lw&scaron;@n_uk@al&aring;@ğ&aring;ƑŃ&yacute;m&fnof;@&ntilde;—ţ&ccedil;l&fnof;l&fnof;@&macr;m&trade;z&macr;@&yacute;v&trade;ak&bdquo;&fnof;`@llvubkx&fnof;k&trade;@klvxux&fnof;jm&scaron;bm&frac14;v&bdquo;nvvblluv@b&bdquo;°v°xlvb@¤mbxxwx°xxŽvbmvuvu@kbmi&macr;xmu&fnof;@&ucirc;°&oacute;bul"],
      "encodeoffsets": [[121411,
      41254]]
    }
},
{
    "type": "feature",
    "properties": {
      "id": "1311",
      "name": "衡水市",
      "cp": [115.8838,
      37.7161],
      "childnum": 11
    },
    "geometry": {
      "type": "polygon",
      "coordinates": ["@@&bdquo;kvlv@x°x&fnof;b@vnnmbvŽxblb@vkl@lv@vbn@@l&sbquo;@xx@bwvxlmxnlv&bdquo;v@@vub&fnof;k&macr;lul@nmbv¤n@l&sbquo;lxnlvuv@ln@lb&bdquo;ullnv@bv@@wlaxjvbnuvbvu&scaron;@vv&scaron;lvvn@vvx@@u&sbquo;kxu&tilde;u@wuk@u&bdquo;wvnk@uuwlk&bdquo;v@a&bdquo;uvu&aelig;`x_&fnof;w@mlu@anumk@uxal¥&bdquo;um&fnof;&egrave;lvbvxvl&bdquo;a&bdquo;bvw@nxu&sbquo;vn&bdquo;&bdquo;v°uŤv@u&fnof;&macr;um@u&fnof;@@u&trade;ua&fnof;wvumuu&fnof;u@k£vw&trade;w@ww@xk&fnof;iua@wu@@al@uk@_mkxk&fnof;buu@avkm&scaron;@xm&fnof;&fnof;±@kb&ccedil;aklğvauw@a@&fnof;mkuj&fnof;k@ykw@£&fnof;wx@lknk@wvkbuŽvnuv&fnof;l@&sbquo;mvki@jub&rsaquo;i@jxb&trade;xllklum&fnof;lmbv`kl&fnof;x&macr;lk&bdquo;&rsaquo;vuv@v&ocirc;xkvvl&bdquo;v&trade;v@x&fnof;vubw@kx&fnof;l&trade;l&macr;kv`unv|°@"],
      "encodeoffsets": [[118024,
      38549]]
    }
},
{
    "type": "feature",
    "properties": {
      "id": "1310",
      "name": "廊坊市",
      "cp": [116.521,
      39.0509],
      "childnum": 9
    },
    "geometry": {
      "type": "multipolygon",
      "coordinates": [["@@la&bdquo;u&scaron;&scaron;@&scaron;unl@vwbklwxnivv&bdquo;v@x&bdquo;jlbul&scaron;xvbn@@k&bdquo;mv@@x°wvinjmn&sup2;@lmvbnl@amkv_kwlmx@@lvamaxa&fnof;avu@unjvanllukaw@uavakk@ilkuu@an@ln@alku&fnof;kiva@a@klaukuv@ukuv&macr;&scaron;kv&fnof;v@kum&fnof;u@@a&macr;imjuu@vv@ul@u&fnof;@@wxuwa@ukwm&trade;@&fnof;x@@w@al@@aviumvuuuvwuknk@i@&trade;l¥ku±a&trade;&trade;uuvyuw&fnof;@@i@uuwm@@uk@@nuju@wu&macr;@kbwluln&scaron;&ccedil;&bdquo;k&frac14;@lll&scaron;l@xun&oacute;Ž&fnof;l&fnof;lkxux&fnof;v@lwb&bdquo;i&bdquo;`°nnn&trade;llŽv&sup2;&macr;x@jkb&fnof;lu&bdquo;vxmjx&sup2;@&ograve;wv&ucirc;l@lln@&sbquo;xn&tilde;&scaron;nv&bdquo;l"],
      ["@@@kx@valaa@kwi@uxw@wanauiw@uaukķŽk_w@uvuku&scaron;@b&fnof;@uamxvxnjubwvxlvbn@w°kb@u@w&oacute;&frac14;miu&frac14;k`v&bdquo;@bvbl@&bdquo;lx@lu&ocirc;vlu&oelig;iv`lx&bdquo;vn@lulvn@&bdquo;l@uva&fnof;iuwl£um&trade;vwu@@uukluuun&fnof;vl@k&scaron;unlvwua&rsaquo;@&trade;u"]],
      "encodeoffsets": [[[119037,
      40467]],
      [[119970,
      40776]]]
    }
}],
"utf8encoding": true
}
总结
以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对CodeAE代码之家的支持。如果你想了解更多相关内容请查看下面相关链接
原文链接:https://blog.csdn.net/isea533/article/details/79194819

http://www.zzvips.com/article/173087.html
页: [1]
查看完整版本: Java调用echarts提供的地图压缩方法来压缩地图