|
|
@@ -68,12 +68,14 @@ public class CadastreManageServiceImpl implements CadastreManageService {
|
|
|
if (!cadastreFile.getStatus().equalsIgnoreCase("3")) {
|
|
|
log.info("校验未通过,不能入库");
|
|
|
result = "校验未通过,不能入库";
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
String gdbPath = cadastreFile.getUnzipPath();
|
|
|
DataSource ds = ogr.Open(gdbPath + "/" + cadastreFile.getName(), 0); // 0 = 只读
|
|
|
if (ds == null) {
|
|
|
log.warn("无法打开 gdb");
|
|
|
+ result = "无法打开gdb文件,不能入库";
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
@@ -128,11 +130,6 @@ public class CadastreManageServiceImpl implements CadastreManageService {
|
|
|
// cadastreFileMapper.addValidFlagColumn("t_cgzj_cwtc_m");
|
|
|
// //todo 这里进行
|
|
|
// List<Map<String,String>> collumTypes = cadastreFileMapper.selectTableCollumAndType("mzdzw");
|
|
|
- if(true){
|
|
|
- //log.info(collumTypes.toString());
|
|
|
- return compareResultVo;
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
try {
|
|
|
List<CompareGemoVo> gemos = new ArrayList<>();
|
|
|
@@ -422,13 +419,18 @@ public class CadastreManageServiceImpl implements CadastreManageService {
|
|
|
}
|
|
|
|
|
|
if (haveGeom.equals(true)) {
|
|
|
- String wkt = null;
|
|
|
+ String ewkt = null;
|
|
|
Geometry geom = feature.GetGeometryRef();
|
|
|
if (geom != null) {
|
|
|
+ // 创建空间参考对象(例如 WGS84,SRID 4326)
|
|
|
+// SpatialReference spatialRef = new SpatialReference();
|
|
|
+// spatialRef.SetWellKnownGeogCS("WGS84");
|
|
|
+// // 为几何体设置空间参考(SRID 4326)
|
|
|
+// geom.AssignSpatialReference(spatialRef);
|
|
|
// 将几何对象转换为 WKT 格式
|
|
|
- wkt = geom.ExportToWkt();
|
|
|
+ ewkt = "SRID=" + 4326 + ";" + geom.ExportToWkt();;
|
|
|
}
|
|
|
- map.put("geom", wkt);
|
|
|
+ map.put("geom", ewkt);
|
|
|
}
|
|
|
list.add(map);
|
|
|
}
|
|
|
@@ -537,9 +539,10 @@ public class CadastreManageServiceImpl implements CadastreManageService {
|
|
|
boolean addRes = false;
|
|
|
if (!CollectionUtils.isEmpty(theValueList)) {
|
|
|
for (Map<String, Object> map : theValueList) {
|
|
|
- Collection<Object> values = map.values();
|
|
|
- Collection<String> keys = map.keySet();
|
|
|
- cadastreFileMapper.insertTableData(tableName, keys, values);
|
|
|
+// Collection<Object> values = map.values();
|
|
|
+// Collection<String> keys = map.keySet();
|
|
|
+ Integer shpDbSRID = 4326;
|
|
|
+ cadastreFileMapper.insertTableData(tableName,map,shpDbSRID);
|
|
|
}
|
|
|
}
|
|
|
return addRes;
|