1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- package org.jeecg.modules.demo.onemap.utils;
- import lombok.SneakyThrows;
- import org.geotools.data.DataStore;
- import lombok.extern.slf4j.Slf4j;
- import org.jeecg.common.util.DateUtils;
- import org.quartz.Job;
- import org.quartz.JobExecutionContext;
- import org.quartz.JobExecutionException;
- /**
- * @author wangkang
- * @email iwuang@qq.com
- * @date 2019/1/24 14:46
- */
- @Slf4j
- public class App {
- /* @SneakyThrows
- @Override
- public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
- log.info(String.format(" Jeecg-Boot 普通定时任务 SampleJob ! 时间:" + DateUtils.getTimestamp()));
- //ZipAndRarTools.unrar(newFile("D:\\存放资料的压缩包\\员工材料.rar"),newFile("D:\\存放资料的非压缩包\\"));
- ZipAndRarTools.unZip("E:\\upFiles\\工程_1627962978919.zip", "e:\\upFiles\\工程_1627962978919");
- // ZipAndRarTools.unrar("D:\\rarTest\\rar压缩包.rar", "D:\\rarTest");
- }*/
- public static void impShp(String id,String shpfilepath,String pgtableName){
- PGDatastore pgDatastore = new PGDatastore();
- DataStore datastore = PGDatastore.getDefeaultDatastore();
- Geotools geotools = new Geotools(datastore);
- geotools.shp2pgtable(id,shpfilepath, pgtableName);
- }
- public static void addPoint(String id,String shpfilepath,String pgtableName){
- PGDatastore pgDatastore = new PGDatastore();
- DataStore datastore = PGDatastore.getDefeaultDatastore();
- Geotools geotools = new Geotools(datastore);
- // geotools.(id,shpfilepath, pgtableName);
- }
- /*public static void main(String[] args) {
- PGDatastore pgDatastore = new PGDatastore();
- DataStore datastore = PGDatastore.getDefeaultDatastore();
- Geotools geotools = new Geotools(datastore);
- String geojsonpath = "C:\\test\\ChinaWorldCitysBigbelin\\chinaCompany2.geojson";
- String shpfilepath = "C:\\test\\ChinaWorldCitysBigbelin\\MuchBig.shp";
- String pgtableName = "MuchBigPolygon";
- // geotools.geojson2pgtable(geojsonpath, pgtableName);
- geotools.geojson2shp(geojsonpath, shpfilepath);
- // geotools.shp2geojson(shpfilepath, geojsonpath);
- // geotools.shp2pgtable(shpfilepath, pgtableName);
- utility.tagLast("shp导入postgis");
- // geotools.pgtable2geojson(pgtableName, geojsonpath);
- // geotools.pgtable2shp(pgtableName, shpfilepath, "geom");
- }*/
- // private static Utility utility = new Utility();
- }
|