月球大数据地理空间分析展示平台-【后端】-月球后台服务
1
13693261870
2024-11-13 024e90554d19c2342f27a26f91bbea378f84da82
src/main/java/com/moon/server/helper/ShpHelper.java
@@ -15,16 +15,10 @@
import java.util.List;
import java.util.Map;
/**
 * ShapeFile帮助类
 * @author WWW
 */
@SuppressWarnings("ALL")
public class ShpHelper {
    private final static Log log = LogFactory.getLog(ShpHelper.class);
    /**
     * 读取Shp第一条记录的WKT
     */
    public static ShpRecordEntity readShpFirstRecord(String filePath) {
        Driver driver = null;
        DataSource dataSource = null;
@@ -60,9 +54,6 @@
        }
    }
    /**
     * 读取ShapeFile文件获取Mark实体类
     */
    public static List<MarkJsonEntity> readShpForMarks(String filePath) {
        Driver driver = null;
        DataSource dataSource = null;
@@ -94,9 +85,6 @@
        }
    }
    /**
     * 获取shp字段信息
     */
    private static Map<Integer, Field> getShpFields(Layer layer) {
        FeatureDefn featureDefn = layer.GetLayerDefn();
@@ -116,9 +104,6 @@
        return fields;
    }
    /**
     * 设置标绘实体类
     */
    private static List<MarkJsonEntity> setMarkJsonEntity(Layer layer, Map<Integer, Field> fieldMap) throws Exception {
        List<MarkJsonEntity> list = new ArrayList<>();
        for (int i = 0; i < layer.GetFeatureCount(); i++) {
@@ -137,14 +122,6 @@
        return list;
    }
    /**
     * 创建ShapeFile文件
     *
     * @param list 标绘JSON实体类集合
     * @param path 路径
     * @param type 类型:POINT,LINESTRING,POLYGON
     * @return ShapeFile文件名
     */
    public static String createShp(List<MarkJsonEntity> list, String path, String type) {
        Driver driver = null;
        DataSource dataSource = null;
@@ -192,9 +169,6 @@
        }
    }
    /**
     * 获取图形类型
     */
    private static int getGeometryType(String type) {
        switch (type) {
            case "POINT":
@@ -208,9 +182,6 @@
        }
    }
    /**
     * 读取数据
     */
    public static <T> List<T> readData(Class clazz, String filePath, boolean isTransform) {
        List<T> list = new ArrayList<>();