智慧水务管理系统 - 精河县供水工程综合管理平台

init-postgis.sql 1.8KB

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