我需要以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
});
答案 0 :(得分:2)
我同意 chrki ,目前无法在OpenLayers地图中显示TIFF(或GeoTiFF),如下所述:https://gis.stackexchange.com/a/98029。浏览器本身不显示TIFF图像。
作为实验,我从ArcGIS栅格图像导出了TIFF和PNG文件。然后在openlayers地图中(使用v3.18.2),我使用以下函数成功地将PNG添加为 ol.layer.Image ,但它失败了,没有通知TIFF:
{{1}}
答案 1 :(得分:1)
实际上,您可以先将图像平铺,然后将其加载到IIS中并从以下内容中获取:
var newLayer = new ol.layer.Tile({
source: new ol.source.OSM({
url: 'maps/{z}/{x}/{y}.png'
})});