|
@@ -3,15 +3,16 @@ const turf = require('@turf/turf');
|
|
|
const parse = require('wellknown');
|
|
|
|
|
|
const wuShuiColor = "#AD835D";
|
|
|
-const wuShuiCircle = 5000061;
|
|
|
-const wuShuiFang = 5000141;
|
|
|
+// const wuShuiCircle = 5000061;
|
|
|
+const wuShuiCircle = 500005;
|
|
|
+const wuShuiFang = 500003;
|
|
|
|
|
|
const wuShuiFangJing = 500008;
|
|
|
const wuShuiCircleJing = 500005;
|
|
|
|
|
|
|
|
|
-const fangGuan=962048;
|
|
|
-const yuanGuan=962052;
|
|
|
+const fangGuan=12010001;
|
|
|
+const yuanGuan=510000;
|
|
|
|
|
|
function readLineFile(inFilePath, outFilePath) {
|
|
|
try {
|
|
@@ -62,6 +63,17 @@ function readPointFile(inFilePath, outFilePath) {
|
|
|
for (let i = 0; i < geojson.features.length; i++) {
|
|
|
let feature = geojson.features[i]
|
|
|
|
|
|
+ // const z = feature.geometry.coordinates[2]
|
|
|
+ let zDepth=feature.properties["井底深"]
|
|
|
+ // const zStart = z;
|
|
|
+ // const zEnd =zStart-zDepth
|
|
|
+ if (zDepth===0){
|
|
|
+ zDepth=1.2
|
|
|
+ }
|
|
|
+
|
|
|
+ geojson.features[i].properties["zScale"]=zDepth/1.2
|
|
|
+
|
|
|
+
|
|
|
let gaiCai = geojson.features[i].properties["井盖材"]
|
|
|
if (gaiCai !== null) {
|
|
|
|
|
@@ -111,7 +123,7 @@ function readPointFile(inFilePath, outFilePath) {
|
|
|
|
|
|
// 同步写入GeoJSON文件
|
|
|
fs.writeFileSync(outFilePath, JSON.stringify(geojson, null, 2));
|
|
|
- console.log('GeoJSON文件已成功保存');
|
|
|
+ console.log('GeoJSON井盖文件已成功保存');
|
|
|
} catch (err) {
|
|
|
console.error('操作GeoJSON文件时出错:', err);
|
|
|
}
|
|
@@ -133,18 +145,18 @@ function getJingLine(inFilePath, outFilePath) {
|
|
|
const lat = feature.geometry.coordinates[1]
|
|
|
const z = feature.geometry.coordinates[2]
|
|
|
|
|
|
+ const zDepth=feature.properties["井底深"]
|
|
|
const zStart = z;
|
|
|
- const zEnd = feature.properties["井底深"]
|
|
|
+ const zEnd =zStart-zDepth
|
|
|
|
|
|
const lineGeom = turf.lineString([
|
|
|
[lng, lat, zStart],
|
|
|
[lng, lat, zEnd]
|
|
|
]);
|
|
|
|
|
|
- geojson.features[i].geometry = lineGeom.geometry;
|
|
|
-
|
|
|
-
|
|
|
+ geojson.features[i].properties["zScale"]=zEnd/1.2
|
|
|
|
|
|
+ geojson.features[i].geometry = lineGeom.geometry;
|
|
|
let gaiCai = geojson.features[i].properties["井盖材"]
|
|
|
if (gaiCai !== null) {
|
|
|
let gui = geojson.features[i].properties["井盖规"]
|
|
@@ -186,6 +198,6 @@ function getJingLine(inFilePath, outFilePath) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-readLineFile("./data/guanxian/污水/原始数据/污水_L.geojson", "./data/guanxian/污水/符号字段/污水_L.geojson");
|
|
|
+// readLineFile("./data/guanxian/污水/原始数据/污水_L.geojson", "./data/guanxian/污水/符号字段/污水_L.geojson");
|
|
|
readPointFile("./data/guanxian/污水/原始数据/污水_P.geojson", "./data/guanxian/污水/符号字段/污水_P.geojson");
|
|
|
-getJingLine("./data/guanxian/污水/原始数据/污水_P.geojson", "./data/guanxian/污水/符号字段/污水_P_line.geojson");
|
|
|
+// getJingLine("./data/guanxian/污水/原始数据/污水_P.geojson", "./data/guanxian/污水/符号字段/污水_P_line.geojson");
|