1
0
chenendian 2 mesiacov pred
rodič
commit
d70b3825c4

+ 26 - 8
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/service/cadastre/impl/CadastreManageServiceImpl.java

@@ -87,7 +87,9 @@ public class CadastreManageServiceImpl implements CadastreManageService {
                 Layer layer = ds.GetLayer(i);
                 Layer layer = ds.GetLayer(i);
                 String layerName = layer.GetName();
                 String layerName = layer.GetName();
                 //todo 相关代码
                 //todo 相关代码
-                if (!layerName.equalsIgnoreCase("T_CGZJ_CWTC_M")) {
+                if (!layerName.equalsIgnoreCase("T_CGZJ_CWTC_M")
+                    && !layerName.equalsIgnoreCase("T_FZSS_FXRW_GIS")
+                ) {
                     continue;
                     continue;
                 }
                 }
                 boolean haveGeom = false;
                 boolean haveGeom = false;
@@ -153,7 +155,9 @@ public class CadastreManageServiceImpl implements CadastreManageService {
                 Layer layer = ds.GetLayer(i);
                 Layer layer = ds.GetLayer(i);
                 String layerName = layer.GetName();
                 String layerName = layer.GetName();
                 //todo 相关代码
                 //todo 相关代码
-                if (!layerName.equalsIgnoreCase("T_CGZJ_CWTC_M")) {
+                if (!layerName.equalsIgnoreCase("T_CGZJ_CWTC_M")
+                    && !layerName.equalsIgnoreCase("T_FZSS_FXRW_GIS")
+                ) {
                     continue;
                     continue;
                 }
                 }
                 CompareGemoVo compareGemoVo = new CompareGemoVo();
                 CompareGemoVo compareGemoVo = new CompareGemoVo();
@@ -278,7 +282,10 @@ public class CadastreManageServiceImpl implements CadastreManageService {
             for (int i = 0; i < ds.GetLayerCount(); i++) {
             for (int i = 0; i < ds.GetLayerCount(); i++) {
                 Layer layer = ds.GetLayer(i);
                 Layer layer = ds.GetLayer(i);
                 //todo 相关代码
                 //todo 相关代码
-                if (!layer.GetName().equalsIgnoreCase("T_CGZJ_CWTC_M")) {
+                if (
+                        !layer.GetName().equalsIgnoreCase("T_CGZJ_CWTC_M") &&
+                        !layer.GetName().equalsIgnoreCase("T_FZSS_FXRW_GIS")
+                ) {
                     continue;
                     continue;
                 }
                 }
 
 
@@ -518,6 +525,11 @@ public class CadastreManageServiceImpl implements CadastreManageService {
             Geometry geom = feature.GetGeometryRef();
             Geometry geom = feature.GetGeometryRef();
             String ewkt = "";
             String ewkt = "";
             if (geom != null) {
             if (geom != null) {
+                geom = geom.MakeValid();
+                int type = geom.GetGeometryType() & 0xFF;
+                if (type != ogr.wkbPolygon && type != ogr.wkbMultiPolygon) {
+                    continue; // 直接跳过
+                }
                 // 将几何对象转换为 WKT 格式
                 // 将几何对象转换为 WKT 格式
                 ewkt = "SRID=" + 4326 + ";" + geom.ExportToWkt();;
                 ewkt = "SRID=" + 4326 + ";" + geom.ExportToWkt();;
             }
             }
@@ -528,8 +540,6 @@ public class CadastreManageServiceImpl implements CadastreManageService {
 
 
 
 
 
 
-
-
     /**
     /**
      * 获取对比的矢量图层
      * 获取对比的矢量图层
      *
      *
@@ -672,7 +682,9 @@ public class CadastreManageServiceImpl implements CadastreManageService {
         //3.如果都有历史版本,则把当前版本删除,把历史版本修改为当前版本。
         //3.如果都有历史版本,则把当前版本删除,把历史版本修改为当前版本。
         List<String>  layerNameList = getLayerNameList(uploadId);
         List<String>  layerNameList = getLayerNameList(uploadId);
         for(String layerName : layerNameList){
         for(String layerName : layerNameList){
-            if (!layerName.equalsIgnoreCase("T_CGZJ_CWTC_M")) {
+            if (!layerName.equalsIgnoreCase("T_CGZJ_CWTC_M")
+                && !layerName.equalsIgnoreCase("T_FZSS_FXRW_GIS")
+            ) {
                 continue;
                 continue;
             }
             }
 
 
@@ -683,7 +695,11 @@ public class CadastreManageServiceImpl implements CadastreManageService {
             }
             }
         }
         }
         for(String layerName : layerNameList){
         for(String layerName : layerNameList){
-            if (!layerName.equalsIgnoreCase("T_CGZJ_CWTC_M")) {
+            if (
+                    !layerName.equalsIgnoreCase("T_CGZJ_CWTC_M") &&
+                    !layerName.equalsIgnoreCase("T_FZSS_FXRW_GIS"))
+
+            {
                 continue;
                 continue;
             }
             }
             cadastreFileMapper.deleteByValidFlag("0", layerName.toLowerCase(Locale.ROOT));
             cadastreFileMapper.deleteByValidFlag("0", layerName.toLowerCase(Locale.ROOT));
@@ -744,7 +760,9 @@ public class CadastreManageServiceImpl implements CadastreManageService {
                 Layer layer = ds.GetLayer(i);
                 Layer layer = ds.GetLayer(i);
                 String layerName = layer.GetName();
                 String layerName = layer.GetName();
                 //todo 相关代码
                 //todo 相关代码
-                if (!layerName.equalsIgnoreCase("T_CGZJ_CWTC_M")) {
+                if (!layerName.equalsIgnoreCase("T_CGZJ_CWTC_M")
+                    && !layerName.equalsIgnoreCase("T_FZSS_FXRW_GIS")
+                ) {
                     continue;
                     continue;
                 }
                 }
                 LayerAndDbData layerAndDbData = new LayerAndDbData();
                 LayerAndDbData layerAndDbData = new LayerAndDbData();