1 Star 3 Fork 2

ecnuzlwang / cesium-indoor-navigation

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
addline.js 833 Bytes
一键复制 编辑 原始数据 按行查看 历史
ecnuzlwang 提交于 2017-11-13 13:50 . first commit
const fs = require('fs');
let geojsonStr = fs.readFileSync('indoor_3d.geojson');
let indoor_3d_geojson = JSON.parse(geojsonStr);
let poiStr = fs.readFileSync('poi.geojson');
let poigeojson = JSON.parse(poiStr);
let features = indoor_3d_geojson.features;
let pois = poigeojson.features;
let levelnum = 3;
let floorheight = 3;
pois.forEach((poi)=>{
let con_cord = poi.geometry.coordinates;
for(let i=0;i<levelnum-1;i++){
let feature = {
"type": "Feature",
"properties": {
"Id": i+'_to_'+(i+1)+'_'+poi.properties.Id
},
"geometry": {
"type": "LineString",
"coordinates": [[con_cord[0],
con_cord[1],
i*floorheight],
[con_cord[0],
con_cord[1],
(i+1)*floorheight]]
}
}
features.push(feature);
}
})
fs.writeFileSync('indoor_3d_withlift.geojson',JSON.stringify(indoor_3d_geojson));
JavaScript
1
https://gitee.com/ecnuzlwang/cesium-indoor-navigation.git
git@gitee.com:ecnuzlwang/cesium-indoor-navigation.git
ecnuzlwang
cesium-indoor-navigation
cesium-indoor-navigation
master

搜索帮助