
需要安装geobuf和pbf这两个库
cnpm i -S geobuf pbf
引入
import geobuf from 'geobuf'; import Pbf from 'pbf';
使用:
let geojson_multiPolygon = { type: 'Feature', properties: {}, geometry: { type: 'MultiPolygon', coordinates: [ [ [ [109.2041015625, 30.088107753367257], [115.02685546875, 30.088107753367257], [115.02685546875, 32.7872745269555], [109.2041015625, 32.7872745269555], [109.2041015625, 30.088107753367257] ] ], [ [ [112.9833984375, 26.82407078047018], [116.69677734375, 26.82407078047018], [116.69677734375, 29.036960648558267], [112.9833984375, 29.036960648558267], [112.9833984375, 26.82407078047018] ] ] ] } }; let a = geobuf.encode(geojson_multiPolygon, new Pbf()); console.log('序列化:', a); let b = geobuf.decode(new Pbf(a)); console.log('反序列化:', b);
上一个:v-model.trim使用
热门文章
- 动物疫苗生产企业排行(动物疫苗生产企业排行榜最新)
- 11月5日 | SingBox每天更新19.5M/S免费节点订阅链接
- 12月5日 | SingBox每天更新20.5M/S免费节点订阅链接
- 1月2日 | SingBox每天更新20.9M/S免费节点订阅链接
- 宠物美容师学校(宠物美容师学校信阳)
- 12月24日 | SingBox每天更新19.3M/S免费节点订阅链接
- 1月15日 | SingBox每天更新20.7M/S免费节点订阅链接
- 12月6日 | SingBox每天更新22.2M/S免费节点订阅链接
- 12月1日 | SingBox每天更新20.1M/S免费节点订阅链接
- Spark(30) — Spark SQL中更多Parquet文件读写(scala)