管道基础大数据平台系统开发-【后端】-Server
1
13693261870
2023-02-15 1f0549559468a1501ac572f8b26b3daedd2b44e1
src/main/java/com/lf/server/helper/GdbHelper.java
@@ -242,7 +242,7 @@
    /**
     * 设置值
     */
    private static <T> void setValue(T t, Feature f, Field field, Integer i) throws Exception {
    public static <T> void setValue(T t, Feature f, Field field, Integer i) throws Exception {
        switch (field.getType().getName()) {
            case "java.math.BigDecimal":
                double dd = f.GetFieldAsDouble(i);
@@ -313,7 +313,7 @@
    /**
     * 获取 Timestamp
     */
    private static Timestamp getTimestamp(Feature f, int index) {
    public static Timestamp getTimestamp(Feature f, int index) {
        int[] pnYear = new int[1];
        int[] pnMonth = new int[1];
        int[] pnDay = new int[1];
@@ -339,7 +339,7 @@
    /**
     * 获取 LocalDate
     */
    private static LocalDate getLocalDate(Feature f, int index) {
    public static LocalDate getLocalDate(Feature f, int index) {
        int[] pnYear = new int[1];
        int[] pnMonth = new int[1];
        int[] pnDay = new int[1];
@@ -421,15 +421,17 @@
            return null;
        }
        Integer srid = null;
        String geomType = null;
        SpatialReference sr = new SpatialReference();
        if (baseMapper instanceof GeomBaseMapper) {
            GeomBaseMapper geomMapper = (GeomBaseMapper) baseMapper;
            geomType = geomMapper.selectGeometryType(tab);
            Integer srid = geomMapper.selectSrid(tab);
            sr.ImportFromEPSG(null == srid ? 4490 : srid);
            srid = geomMapper.selectSrid(tab);
        }
        SpatialReference sr = new SpatialReference();
        sr.ImportFromEPSG(null == srid ? 4490 : srid);
        return dataSource.CreateLayer(tab, sr, getGeomType(geomType), null);
    }
@@ -439,7 +441,7 @@
     */
    private static Integer getGeomType(String geomType) {
        if (StringHelper.isEmpty(geomType)) {
            return ogr.wkbUnknown;
            return ogr.wkbPoint;
        }
        switch (geomType) {
@@ -463,7 +465,7 @@
    /**
     * 获取字段
     */
    private static void getFields(Class clazz, List<Field> list) {
    public static void getFields(Class clazz, List<Field> list) {
        try {
            Field[] fields = clazz.getDeclaredFields();
            for (Field f : fields) {
@@ -530,8 +532,10 @@
            if (t instanceof BaseGeoEntity) {
                BaseGeoEntity geoEntity = (BaseGeoEntity) t;
                Geometry geom = Geometry.CreateFromWkt(geoEntity.getGeom());
                f.SetGeometry(geom);
                if (!StringHelper.isEmpty(geoEntity.getGeom())) {
                    Geometry geom = Geometry.CreateFromWkt(geoEntity.getGeom());
                    f.SetGeometry(geom);
                }
            }
            setFeatureData(f, fields, t);