| | |
| | | package com.se.simu.controller; |
| | | |
| | | import com.se.simu.domain.po.SimuPo; |
| | | import com.se.simu.domain.vo.PondingVo; |
| | | import com.se.simu.domain.vo.R; |
| | | import com.se.simu.helper.StringHelper; |
| | | import com.se.simu.helper.WebHelper; |
| | |
| | | @ApiImplicitParam(name = "timestamp", value = "æ¶é´æ³", dataType = "long", paramType = "query", example = "1730217660000") |
| | | }) |
| | | @GetMapping("/{serviceName}/getWaterHeight") |
| | | public R<Double> getWaterHeight(@PathVariable String serviceName, double x, double y, long timestamp, HttpServletResponse res) { |
| | | public R<Object> getWaterHeight(@PathVariable String serviceName, double x, double y, long timestamp, HttpServletResponse res) { |
| | | try { |
| | | SimuPo simu = simuService.getSimuByServiceName(serviceName); |
| | | if (null == simu) { |
| | | return null; |
| | | } |
| | | |
| | | // æ ¹æ®æå¡å+æ¶é´æ³+åæ ï¼æ¥è¯¢å¯¹åºç积水深度 |
| | | return success(waterService.getWaterHeight(simu, x, y, timestamp)); |
| | | Double depth = waterService.getWaterHeight(simu, x, y, timestamp); |
| | | Double area = waterService.getWaterArea(simu, x, y, timestamp); |
| | | |
| | | return success(new PondingVo(depth, area)); |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | return fail(ex); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.se.simu.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | /** |
| | | * 积水è§å¾ç±» |
| | | * |
| | | * @author WWW |
| | | * @date 2024-11-06 |
| | | */ |
| | | @SuppressWarnings("ALL") |
| | | public class PondingVo { |
| | | @ApiModelProperty("积水深度") |
| | | private Double depth; |
| | | |
| | | @ApiModelProperty("积水é¢ç§¯") |
| | | private Double area; |
| | | |
| | | public PondingVo() { |
| | | } |
| | | |
| | | public PondingVo(Double depth, Double area) { |
| | | this.depth = depth; |
| | | this.area = area; |
| | | } |
| | | |
| | | public Double getDepth() { |
| | | return depth; |
| | | } |
| | | |
| | | public void setDepth(Double depth) { |
| | | this.depth = depth; |
| | | } |
| | | |
| | | public Double getArea() { |
| | | return area; |
| | | } |
| | | |
| | | public void setArea(Double area) { |
| | | this.area = area; |
| | | } |
| | | } |
| | |
| | | dataSource = driver.CreateDataSource(filePath, null); |
| | | if (null == dataSource) return false; |
| | | |
| | | layer = dataSource.CreateLayer(FileUtil.getName(filePath), ds.GetSpatialRef(), ogr.wkbPolygon, getOptions()); |
| | | layer = dataSource.CreateLayer(FileUtil.getName(filePath), ds.GetSpatialRef(), ogr.wkbPolygon); |
| | | if (null == layer) return false; |
| | | |
| | | layer.CreateField(new FieldDefn("val", ogr.OFTReal)); |
| | |
| | | return !Double.isNaN(val) && val > Integer.MIN_VALUE; |
| | | } |
| | | |
| | | public Double getWaterArea(SimuPo simu, double x, double y, Long timestamp) { |
| | | return null; |
| | | } |
| | | |
| | | public List<BuildingDepthVo> getBuildingDepthBySeid(String serviceName, String seid) { |
| | | List<BuildingDepthVo> list = readBuildingJson(serviceName); |
| | | if (CollectionUtils.isEmpty(list)) return null; |