package com.se.nsl.domain.po; import com.se.nsl.domain.dto.PointDto; import com.se.nsl.helper.GdalHelper; import io.swagger.annotations.ApiModelProperty; import org.gdal.ogr.Geometry; import org.gdal.ogr.ogr; @SuppressWarnings("ALL") public class PondingPo { @ApiModelProperty("积水区域") private String polygon; @ApiModelProperty("积水点") private String point; @ApiModelProperty("积水深度") private Double depth; @ApiModelProperty("面积") private Double area; public PondingPo() { } public PondingPo(Geometry polygon, PointDto dto) { Geometry point = new Geometry(ogr.wkbPoint); point.AddPoint_2D(dto.getX(), dto.getY()); point.AssignSpatialReference(polygon.GetSpatialReference()); //GdalHelper.toWgs84(polygon.GetSpatialReference(), polygon); //GdalHelper.toWgs84(polygon.GetSpatialReference(), point); polygon.TransformTo(GdalHelper.SR4326); point.TransformTo(GdalHelper.SR4326); this.polygon = polygon.ExportToWkt(); this.point = point.ExportToWkt(); this.depth = dto.getVal(); this.area = polygon.Area(); } public PondingPo(String polygon, String point, Double depth) { this.polygon = polygon; this.point = point; this.depth = depth; } public String getPolygon() { return polygon; } public void setPolygon(String polygon) { this.polygon = polygon; } public String getPoint() { return point; } public void setPoint(String point) { this.point = point; } 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; } }