gpt4 book ai didi

openlayers-3 - 显示 GeoTiff 图像 Openlayers 3

转载 作者:行者123 更新时间:2023-12-02 03:58:11 25 4
gpt4 key购买 nike

我需要以 GeoTiff 格式显示光栅图像,它是通过 QGIS 进行地理引用的。看起来 Openlayers 3.15 不支持这种格式。你知道这件事吗?

var agentUrl = 'http://localhost:9925/Wgis/assets/img/allertaMeteoGeo.tif';

var bounds = [ 713101.704, 4044061.027, 713101.704, 4044061.027];



var view2 = new ol.View({
center : [ -87.7302542509315, 43.744459064634 ],
projection : "EPSG:3857",
zoom : 12
});

var sorgente = new ol.source.ImageMapGuide({
projection : "EPSG:3857",
url : agentUrl,
metersPerUnit : 111319.4908,

imageSize: [792, 452],
ratio : 2
});

var raster = new ol.layer.Image({
extent : bounds,
source : sorgente
});

var map2 = new ol.Map({
layers : [ raster ],
target : 'map2',
view : view2
});

最佳答案

我同意 chrki 的观点,目前无法在 OpenLayers map 中显示 TIFF(或 GeoTiFF),如下所述:https://gis.stackexchange.com/a/98029 。浏览器本身不显示 TIFF 图像。

作为实验,我从 ArcGIS 栅格图像导出了 TIFF 和 PNG 文件。然后在 openlayers map (使用 v3.18.2)中,我使用以下函数成功添加 PNG 作为 ol.layer.Image,但失败,且未通知 TIFF:

function addImage() {

extent = [-13602803.9769, 4920816.12423, -13599949.5192, 4923458.74552]; // [left, bottom, right, top]

var projection = new ol.proj.Projection({
code: 'xkcd-image',
units: 'pixels',
extent: extent
});

var StaticImage = new ol.layer.Image({
source: new ol.source.ImageStatic({
attributions: 'yada yada',
url: /robs/gis_data/LiDAR Elevations2.png',
projection: projection,
imageExtent: extent
})
});

map.addLayer(StaticImage);
map.getView().fit(extent, map.getSize());
}

关于openlayers-3 - 显示 GeoTiff 图像 Openlayers 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37207329/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com