// 排水接混接点标注_L const fs = require('fs'); const wuShuiColor = "#FBBC05"; // 黄色 const yuanGuan = 310000; /** * 找不到横截面数据全部按圆管处理半径0.8 * @param {*} inFilePath * @param {*} outFilePath */ function readLineFile(inFilePath, outFilePath) { try { // 同步读取GeoJSON文件 const data = fs.readFileSync(inFilePath, 'utf8'); // 解析GeoJSON数据 const geojson = JSON.parse(data); for (let i = 0; i < geojson.features.length; i++) { let feature = geojson.features[i]; // 圆管 geojson.features[i].properties["符号风格"] = yuanGuan geojson.features[i].properties["符号颜色"] = wuShuiColor geojson.features[i].properties["x长"] = 0.1 geojson.features[i].properties["x宽"] =0.1 } // 同步写入GeoJSON文件 fs.writeFileSync(outFilePath, JSON.stringify(geojson, null, 2)); console.log('GeoJSON文件已成功保存'); } catch (err) { console.error('操作GeoJSON文件时出错:', err); } } readLineFile("./data/guanxian/工业管线情况说明/原始数据/工业管线情况说明_L.geojson", "./data/guanxian/工业管线情况说明/符号字段/工业管线情况说明_L.geojson");