gushoubang 9 hónapja
szülő
commit
991afa016d

+ 6 - 1
onemap-modules/onemap-spatial/src/main/java/com/onemap/spatial/service/impl/ImageServiceImpl.java

@@ -26,6 +26,7 @@ import org.locationtech.jts.io.WKTReader;
 import org.opengis.feature.simple.SimpleFeature;
 import org.opengis.filter.FilterFactory2;
 import org.opengis.style.ContrastMethod;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.imageio.ImageIO;
@@ -44,6 +45,9 @@ import java.util.Map;
 @Service
 public class ImageServiceImpl implements IImageService {
 
+    @Value("${Path.rsImage}")
+    public String rsImage;
+
     @Override
     public String getSensingImage(WktsVo wktsVo) throws Exception {
         // 创建一个 MapContent 对象
@@ -51,7 +55,8 @@ public class ImageServiceImpl implements IImageService {
         mapContent.setTitle("Quickstart");
 
         // 加载并添加 TIFF 栅格图层
-        File file = new File("D:/onemapfile/15影像.tif");
+
+        File file = new File(rsImage);
         Hints tiffHints = new Hints();
         tiffHints.add(new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE));
         // 默认坐标系EPSG:3857