From 24e92a5d5b068f24efa6c8cb2f06a50480185b5f Mon Sep 17 00:00:00 2001 From: wuww <252740454@qq.com> Date: 星期三, 16 四月 2025 16:56:15 +0800 Subject: [PATCH] 添加SimuData类 --- src/main/java/com/se/nsl/domain/po/RainGauge.java | 21 ++++ src/main/java/com/se/nsl/domain/po/SimuData.java | 237 +++++++++++++++++++++++++++++++++++++++++++++++ data/init.sql | 4 pom.xml | 1 4 files changed, 262 insertions(+), 1 deletions(-) diff --git a/data/init.sql b/data/init.sql index be5e868..49e71de 100644 --- a/data/init.sql +++ b/data/init.sql @@ -12,6 +12,7 @@ service_name varchar(200), type smallint default 1, area_type smallint default 0, + area_name varchar(200), data varchar(8000), status smallint default 0, result varchar(8000), @@ -31,6 +32,7 @@ comment on column nsl.simu.service_name is '鏈嶅姟鍚嶇О'; comment on column nsl.simu.type is '绫诲埆锛�1-棰勬祴妯℃嫙锛�2-瀹炴椂妯℃嫙锛�3-鍘嗗彶妯℃嫙'; comment on column nsl.simu.area_type is '鍖哄煙绫诲埆锛�0-鑷畾涔夛紝1-琛屾斂鍖哄垝锛�2-閲嶇偣鍖哄煙锛�3-閲嶇偣娌�'; +comment on column nsl.simu.area_name is '鍖哄煙鍚嶇О'; comment on column nsl.simu.data is '鏁版嵁(JSON)'; comment on column nsl.simu.status is '鐘舵�侊細0-鍒涘缓浠跨湡锛�1-棰勫鐞嗭紝2-鍒嗘瀽涓紝10-瀹屾垚锛�20-鍑洪敊'; comment on column nsl.simu.result is '缁撴灉(JSON)'; @@ -41,7 +43,7 @@ comment on column nsl.simu.bak is '澶囨敞'; comment on column nsl.simu.geom is '绌洪棿浣嶇疆'; --- insert into nsl.simu (name, service_name, type, area_type, status, geom) values ('棰勬祴妯℃嫙-0416', '20250416100000', 1, 1, 0, ST_GeomFromText('MULTIPOLYGON(((116.666748 39.639859,116.659403 39.626287,116.665956 39.654698,116.666748 39.639859)))')); +-- insert into nsl.simu (name, service_name, type, area_type, area_name, status, geom) values ('棰勬祴妯℃嫙-0416', '20250416100000', 1, 1, '澶у叴鍖�', 0, ST_GeomFromText('MULTIPOLYGON(((116.666748 39.639859,116.659403 39.626287,116.665956 39.654698,116.666748 39.639859)))')); select *, st_astext(geom) geom from nsl.simu; ---------------------------------------------- 2.鎺ㄦ紨鍖哄煙 diff --git a/pom.xml b/pom.xml index 1aecb89..a35c9fc 100644 --- a/pom.xml +++ b/pom.xml @@ -45,6 +45,7 @@ <dependency> <groupId>com.baomidou</groupId> <artifactId>mybatis-plus-boot-starter</artifactId> + <!--<version>3.5.7</version>--> <version>3.5.1</version> </dependency> <!--redis--> diff --git a/src/main/java/com/se/nsl/domain/po/RainGauge.java b/src/main/java/com/se/nsl/domain/po/RainGauge.java new file mode 100644 index 0000000..06140a9 --- /dev/null +++ b/src/main/java/com/se/nsl/domain/po/RainGauge.java @@ -0,0 +1,21 @@ +package com.se.nsl.domain.po; + +import io.swagger.annotations.ApiModelProperty; + +@SuppressWarnings("ALL") +public class RainGauge { + @ApiModelProperty("闆ㄩ噺璁D") + private String id; + + @ApiModelProperty("闆ㄩ噺璁″悕绉�") + private String name; + + @ApiModelProperty("X鍧愭爣") + private Double x; + + @ApiModelProperty("Y鍧愭爣") + private Double y; + + @ApiModelProperty("褰卞搷鍗婂緞") + private Double r; +} diff --git a/src/main/java/com/se/nsl/domain/po/SimuData.java b/src/main/java/com/se/nsl/domain/po/SimuData.java new file mode 100644 index 0000000..6db1aac --- /dev/null +++ b/src/main/java/com/se/nsl/domain/po/SimuData.java @@ -0,0 +1,237 @@ +package com.se.nsl.domain.po; + +import com.alibaba.fastjson.annotation.JSONField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.se.nsl.helper.GdalHelper; +import io.swagger.annotations.ApiModelProperty; +import org.gdal.osr.SpatialReference; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +@SuppressWarnings("ALL") +public class SimuData { + @ApiModelProperty("杈撳叆璺緞") + private String inPath; + + @ApiModelProperty("杈撳嚭璺緞") + private String outPath; + + @ApiModelProperty("寮�濮嬫椂闂�") + @JSONField(format = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date startTime; + + @ApiModelProperty("鏈�灏廥") + private Double minx; + + @ApiModelProperty("鏈�灏廦") + private Double miny; + + @ApiModelProperty("鏈�澶") + private Double maxx; + + @ApiModelProperty("鏈�澶") + private Double maxy; + + @ApiModelProperty("鍧愭爣绯籌D") + private Integer epsg; + + @ApiModelProperty("绫诲埆:1-棰勬祴妯℃嫙,2-瀹炴椂妯℃嫙,3-鍘嗗彶妯℃嫙") + private Integer type; + + @ApiModelProperty("闄嶉洦妯″紡:姝f�佸垎甯億骞冲潎鍒嗗竷|娉㈠姩骞冲潎鍒嗗竷|鎸佺画涓婂崌") + private String mode; + + @ApiModelProperty("闄嶉洦鎬婚噺(mm)") + private Double total; + + @ApiModelProperty("闄嶉洦鏃堕暱(h)") + private Integer duration; + + @ApiModelProperty("闄嶉洦寮哄害(mm/h)") + private Double intensity; + + @ApiModelProperty("鍘嗗彶闆ㄦ儏:XX骞�50mm闄嶉洦|XX骞�75mm闄嶉洦|XX骞�100mm闄嶉洦|鏂板闄嶉洦鍘嗗彶鏁版嵁") + private String history; + + @ApiModelProperty("棰勬祴鏁版嵁:闄嶉洦鍦烘|姘旇薄鏁版嵁|閫愬皬鏃堕鎶ユ暟鎹畖鑷畾涔夊弬鏁�") + private String prediction; + + @ApiModelProperty("闆ㄩ噺绫诲埆:闆ㄩ噺璁″疄鏃舵暟鎹畖姘旇薄瀹炴椂鏁版嵁") + private String category; + + @ApiModelProperty("闆ㄩ噺璁″垪琛�") + private List<RainGauge> gauges; + + public SimuData() { + gauges = new ArrayList<>(); + } + + public SimuData(String inPath, String outPath, Date startTime, Double minx, Double miny, Double maxx, Double maxy, Integer epsg, Integer type, Double total, Integer duration, Double intensity) { + this(); + this.inPath = inPath; + this.outPath = outPath; + this.startTime = startTime; + this.minx = minx; + this.miny = miny; + this.maxx = maxx; + this.maxy = maxy; + this.epsg = epsg; + this.type = type; + this.total = total; + this.duration = duration; + this.intensity = intensity; + } + + public void setPath(String inPath, String outPath) { + this.inPath = inPath; + this.outPath = outPath; + } + + public String getBbox() { + // "116.64388473935195,39.884315914604464,116.64754729082588,39.887069143903496"; + return minx + "," + miny + "," + maxx + "," + maxy; + } + + public SpatialReference getSpatialReference() { + return GdalHelper.createSpatialReference(this.getEpsg()); + } + + public String getInPath() { + return inPath; + } + + public void setInPath(String inPath) { + this.inPath = inPath; + } + + public String getOutPath() { + return outPath; + } + + public void setOutPath(String outPath) { + this.outPath = outPath; + } + + public Date getStartTime() { + return startTime; + } + + public void setStartTime(Date startTime) { + this.startTime = startTime; + } + + public Double getMinx() { + return minx; + } + + public void setMinx(Double minx) { + this.minx = minx; + } + + public Double getMiny() { + return miny; + } + + public void setMiny(Double miny) { + this.miny = miny; + } + + public Double getMaxx() { + return maxx; + } + + public void setMaxx(Double maxx) { + this.maxx = maxx; + } + + public Double getMaxy() { + return maxy; + } + + public void setMaxy(Double maxy) { + this.maxy = maxy; + } + + public Integer getEpsg() { + return epsg; + } + + public void setEpsg(Integer epsg) { + this.epsg = epsg; + } + + public Integer getType() { + return type; + } + + public void setType(Integer type) { + this.type = type; + } + + public String getMode() { + return mode; + } + + public void setMode(String mode) { + this.mode = mode; + } + + public Double getTotal() { + return total; + } + + public void setTotal(Double total) { + this.total = total; + } + + public Integer getDuration() { + return duration; + } + + public void setDuration(Integer duration) { + this.duration = duration; + } + + public Double getIntensity() { + return intensity; + } + + public void setIntensity(Double intensity) { + this.intensity = intensity; + } + + public String getHistory() { + return history; + } + + public void setHistory(String history) { + this.history = history; + } + + public String getPrediction() { + return prediction; + } + + public void setPrediction(String prediction) { + this.prediction = prediction; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public List<RainGauge> getGauges() { + return gauges; + } + + public void setGauges(List<RainGauge> gauges) { + this.gauges = gauges; + } +} -- Gitblit v1.9.3