c9d89fd12bb3e0376d706cc3d8d84447316d0685.svn-base 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package org.jeecg.modules.demo.onemap.utils;
  2. import lombok.SneakyThrows;
  3. import org.geotools.data.DataStore;
  4. import lombok.extern.slf4j.Slf4j;
  5. import org.jeecg.common.util.DateUtils;
  6. import org.quartz.Job;
  7. import org.quartz.JobExecutionContext;
  8. import org.quartz.JobExecutionException;
  9. /**
  10. * @author wangkang
  11. * @email iwuang@qq.com
  12. * @date 2019/1/24 14:46
  13. */
  14. @Slf4j
  15. public class App {
  16. /* @SneakyThrows
  17. @Override
  18. public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
  19. log.info(String.format(" Jeecg-Boot 普通定时任务 SampleJob ! 时间:" + DateUtils.getTimestamp()));
  20. //ZipAndRarTools.unrar(newFile("D:\\存放资料的压缩包\\员工材料.rar"),newFile("D:\\存放资料的非压缩包\\"));
  21. ZipAndRarTools.unZip("E:\\upFiles\\工程_1627962978919.zip", "e:\\upFiles\\工程_1627962978919");
  22. // ZipAndRarTools.unrar("D:\\rarTest\\rar压缩包.rar", "D:\\rarTest");
  23. }*/
  24. public static void impShp(String id,String shpfilepath,String pgtableName){
  25. PGDatastore pgDatastore = new PGDatastore();
  26. DataStore datastore = PGDatastore.getDefeaultDatastore();
  27. Geotools geotools = new Geotools(datastore);
  28. geotools.shp2pgtable(id,shpfilepath, pgtableName);
  29. }
  30. public static void addPoint(String id,String shpfilepath,String pgtableName){
  31. PGDatastore pgDatastore = new PGDatastore();
  32. DataStore datastore = PGDatastore.getDefeaultDatastore();
  33. Geotools geotools = new Geotools(datastore);
  34. // geotools.(id,shpfilepath, pgtableName);
  35. }
  36. /*public static void main(String[] args) {
  37. PGDatastore pgDatastore = new PGDatastore();
  38. DataStore datastore = PGDatastore.getDefeaultDatastore();
  39. Geotools geotools = new Geotools(datastore);
  40. String geojsonpath = "C:\\test\\ChinaWorldCitysBigbelin\\chinaCompany2.geojson";
  41. String shpfilepath = "C:\\test\\ChinaWorldCitysBigbelin\\MuchBig.shp";
  42. String pgtableName = "MuchBigPolygon";
  43. // geotools.geojson2pgtable(geojsonpath, pgtableName);
  44. geotools.geojson2shp(geojsonpath, shpfilepath);
  45. // geotools.shp2geojson(shpfilepath, geojsonpath);
  46. // geotools.shp2pgtable(shpfilepath, pgtableName);
  47. utility.tagLast("shp导入postgis");
  48. // geotools.pgtable2geojson(pgtableName, geojsonpath);
  49. // geotools.pgtable2shp(pgtableName, shpfilepath, "geom");
  50. }*/
  51. // private static Utility utility = new Utility();
  52. }