|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+-- GIS引擎数据库初始化脚本
|
|
|
2
|
+-- 创建PostGIS扩展
|
|
|
3
|
+CREATE EXTENSION IF NOT EXISTS postgis;
|
|
|
4
|
+CREATE EXTENSION IF NOT EXISTS postgis_topology;
|
|
|
5
|
+
|
|
|
6
|
+-- 创建精河县基础底图
|
|
|
7
|
+INSERT INTO gis_base_map (name, type, geom) VALUES
|
|
|
8
|
+('精河县基础底图', 'county', ST_GeomFromText('POLYGON((82.85 43.98, 83.10 43.98, 83.10 44.08, 82.85 44.08, 82.85 43.98))', 4326));
|
|
|
9
|
+
|
|
|
10
|
+-- 创建监测点位(模拟数据)
|
|
|
11
|
+INSERT INTO iot_device (device_code, name, device_type, longitude, latitude, gis_layer_name, location_geom) VALUES
|
|
|
12
|
+('SW001', '1号水位监测点', 'SW', 44.0321, 82.8973, 'water_level', ST_GeomFromText('POINT(44.0321 82.8973)', 4326)),
|
|
|
13
|
+('SW002', '2号水位监测点', 'SW', 44.0365, 82.9058, 'water_level', ST_GeomFromText('POINT(44.0365 82.9058)', 4326)),
|
|
|
14
|
+('YL001', '1号压力监测点', 'YL', 44.0410, 82.9143, 'water_pressure', ST_GeomFromText('POINT(44.0410 82.9143)', 4326)),
|
|
|
15
|
+('YL002', '2号压力监测点', 'YL', 44.0455, 82.9228, 'water_pressure', ST_GeomFromText('POINT(44.0455 82.9228)', 4326)),
|
|
|
16
|
+('ZD001', '1号浊度监测点', 'ZD', 44.0500, 82.9313, 'turbidity', ST_GeomFromText('POINT(44.0500 82.9313)', 4326)),
|
|
|
17
|
+('LL001', '1号流量监测点', 'LL', 44.0545, 82.9398, 'flow_rate', ST_GeomFromText('POINT(44.0545 82.9398)', 4326));
|
|
|
18
|
+
|
|
|
19
|
+-- 创建管网数据(模拟)
|
|
|
20
|
+INSERT INTO water_pipe_network (pipe_code, pipe_type, diameter, material, start_point_geom, end_point_geom) VALUES
|
|
|
21
|
+('P001', '主管道', 300, '铸铁', ST_GeomFromText('POINT(44.0321 82.8973)', 4326), ST_GeomFromText('POINT(44.0410 82.9143)', 4326)),
|
|
|
22
|
+('P002', '支管道', 150, 'PE', ST_GeomFromText('POINT(44.0365 82.9058)', 4326), ST_GeomFromText('POINT(44.0455 82.9228)', 4326)),
|
|
|
23
|
+('P003', '管道', 100, 'PVC', ST_GeomFromText('POINT(44.0410 82.9143)', 4326), ST_GeomFromText('POINT(44.0500 82.9313)', 4326));
|