|
@@ -3,6 +3,7 @@ package com.shkpr.service.alambizplugin.components;
|
|
|
import com.global.base.log.LogLevelFlag;
|
|
|
import com.global.base.log.LogPrintMgr;
|
|
|
import com.shkpr.service.alambizplugin.apiparam.GisSurveyThirdImportParams;
|
|
|
+import com.shkpr.service.alambizplugin.commtools.CRSUtil;
|
|
|
import com.shkpr.service.alambizplugin.commtools.ExcelUtils;
|
|
|
import com.shkpr.service.alambizplugin.commtools.PointCodeUtil;
|
|
|
import com.shkpr.service.alambizplugin.commtools.ThirdImportTemplateUtils;
|
|
@@ -13,6 +14,7 @@ import com.shkpr.service.alambizplugin.components.checker.DuplicatePointsFinder;
|
|
|
import com.shkpr.service.alambizplugin.components.checker.InvalidLinesFinder;
|
|
|
import com.shkpr.service.alambizplugin.components.checker.InvalidPropertiesFinder;
|
|
|
import com.shkpr.service.alambizplugin.constants.CommAsyncStatusEnum;
|
|
|
+import com.shkpr.service.alambizplugin.constants.CommCRSDefine;
|
|
|
import com.shkpr.service.alambizplugin.constants.ExcelEnum;
|
|
|
import com.shkpr.service.alambizplugin.constants.GisMetadataDefine;
|
|
|
import com.shkpr.service.alambizplugin.constants.GisSurveyExcelDefine;
|
|
@@ -35,8 +37,8 @@ import org.apache.commons.collections4.CollectionUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.commons.lang3.math.NumberUtils;
|
|
|
import org.locationtech.jts.geom.Coordinate;
|
|
|
+import org.locationtech.jts.geom.Geometry;
|
|
|
import org.locationtech.jts.geom.GeometryFactory;
|
|
|
-import org.locationtech.jts.geom.Point;
|
|
|
import org.locationtech.jts.geom.PrecisionModel;
|
|
|
import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.scheduling.annotation.AsyncResult;
|
|
@@ -451,14 +453,38 @@ public class GisSurveyThirdImporter {
|
|
|
layerApply.setDepth(Double.valueOf(propertyValue.getValue()));
|
|
|
}
|
|
|
}
|
|
|
- layerApply.setPropertyValues(propertyValueList);
|
|
|
|
|
|
- //填入经纬度
|
|
|
+ //处理经纬度
|
|
|
if (lng != null && lat != null) {
|
|
|
- Point geometry = geometryFactory.createPoint(new Coordinate(lng, lat));
|
|
|
+ //构建geom
|
|
|
+ Geometry geometry = geometryFactory.createPoint(new Coordinate(lng, lat));
|
|
|
+ //如源不为大地2000
|
|
|
+ if (!Objects.equals(params.getSourceCRSCode(), CommCRSDefine.CGCS2000)) {
|
|
|
+ //转换坐标系
|
|
|
+ Geometry transform = CRSUtil.transform(geometry, params.getSourceCRSCode(), CommCRSDefine.CGCS2000);
|
|
|
+ if (transform != null) {
|
|
|
+ //回填geom
|
|
|
+ geometry = transform;
|
|
|
+ //获取解析后的经纬度
|
|
|
+ Coordinate coordinate = geometry.getCoordinate();
|
|
|
+ String lngStr = BigDecimal.valueOf(coordinate.getX()).toPlainString();
|
|
|
+ String latStr = BigDecimal.valueOf(coordinate.getY()).toPlainString();
|
|
|
+ //回填经纬度属性
|
|
|
+ propertyValueList.stream()
|
|
|
+ .filter(it -> Objects.equals(it.getProperty(), GisSurveyExcelDefine.TEMPLATE.LAT))
|
|
|
+ .forEach(it -> it.setValue(latStr));
|
|
|
+ propertyValueList.stream()
|
|
|
+ .filter(it -> Objects.equals(it.getProperty(), GisSurveyExcelDefine.TEMPLATE.LNG))
|
|
|
+ .forEach(it -> it.setValue(lngStr));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //设置geom
|
|
|
layerApply.setGis(geometry);
|
|
|
}
|
|
|
|
|
|
+ //设置属性
|
|
|
+ layerApply.setPropertyValues(propertyValueList);
|
|
|
+
|
|
|
return layerApply;
|
|
|
}
|
|
|
|