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