| | |
| | | import com.se.simu.utils.CsvToSQLiteUtils; |
| | | import com.se.simu.utils.ShpToolUtils; |
| | | import com.se.simu.utils.ZarrUtils; |
| | | import com.se.simu.utils.ZipUtils; |
| | | import io.swagger.annotations.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.util.*; |
| | | |
| | |
| | | @GetMapping(value = "/testZarr", produces = "application/json; charset=UTF-8") |
| | | public R<Boolean> testZarr(@RequestParam("name") String tableName) throws IOException { |
| | | List<String> list = CsvToSQLiteUtils.getNameList(tableName); |
| | | String basePath="D:\\城市内涝\\sem\\雨量站点数据\\降雨量zarr\\"; |
| | | String basePath="D:\\城市内涝\\sem\\雨量站点数据\\"+tableName+"\\rainfall\\"; |
| | | for (String src : list |
| | | ) { |
| | | File directories = new File(basePath); |
| | | if (!directories.exists()) { |
| | | directories.mkdirs(); |
| | | System.out.println("Directories created successfully."); |
| | | } else { |
| | | System.out.println("Directories already exist."); |
| | | } |
| | | List<StationRainVo> stationRainVos = CsvToSQLiteUtils.getList(tableName, src); |
| | | ZarrUtils.saveZarrRainfall(basePath+src,stationRainVos); |
| | | ZarrUtils.saveZarrTime(basePath+src,stationRainVos); |
| | | ZipUtils.toZarr(basePath+src,basePath+src+".zip"); |
| | | System.out.println(src+"的zarr数据生成====================="); |
| | | } |
| | | return success(true); |