| | |
| | | import com.baomidou.mybatisplus.core.metadata.OrderItem; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.lf.server.entity.bd.DlgAgnpEntity; |
| | | import com.lf.server.entity.ctrl.ShpRecordEntity; |
| | | import com.lf.server.entity.data.MetaFileEntity; |
| | | import com.lf.server.helper.FileHelper; |
| | | import com.lf.server.helper.GdalHelper; |
| | | import com.lf.server.helper.StringHelper; |
| | | import com.lf.server.mapper.bd.DlgAgnpMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 综合展示 |
| | |
| | | public String selectWktById(Integer id) { |
| | | return dlgAgnpMapper.selectWktById(id); |
| | | } |
| | | |
| | | public ShpRecordEntity readShpFirstRecord(List<MetaFileEntity> list) { |
| | | String fileName = null; |
| | | for (MetaFileEntity mf : list) { |
| | | if (mf.getName().toLowerCase().indexOf(".shp") > -1) { |
| | | fileName = mf.getPath(); |
| | | break; |
| | | } |
| | | } |
| | | if (StringHelper.isEmpty(fileName)) { |
| | | return null; |
| | | } |
| | | |
| | | ShpRecordEntity sr = GdalHelper.readShpFirstRecord(fileName); |
| | | FileHelper.deleteFiles(list); |
| | | |
| | | return sr; |
| | | } |
| | | } |