将高程数据导入地理视图/全息视图(数据格式)

时间:2017-05-31 21:55:17

标签: bokeh raster holoviews geoviews

如何将其他栅格格式导入到教程中显示的netCDF文件以外的地理视图/全息视图中?例如,我想导入一个ESRI .bil文件并将其包装到地理视图图像中,但它没有正确导入。有没有办法做到这一点,我错过了一步吗?

最终我希望能够将点数据投影到正确纬度,长位置的光栅图像上以提取数据,但我似乎无法将点投射到正确的位置。

from cartopy import crs
import holoviews as hv
import xarray as xr
import geoviews as gv
import pandas as pd
from osgeo import gdal



kdims = ['easting', 'northing']
vdims = ['elevation']
xr_raster = gv.Dataset(DEM, kdims=kdims, vdims=vdims, crs=crs.PlateCarree())

image = gv.Image(xr_raster, crs=crs.PlateCarree()) (style={'cmap':'inferno'})

image

这提供了这个错误:TypeError:shape()得到了一个意外的关键字参数' gridded'

import iris
iris_raster = iris.load_cube('/path/to/raster.bil')

此错误为:ValueError:找不到给定缓冲区的格式规范。

我只是成功使用gdal导入数据,然后将其绘制为Holoviews Raster或Geoviews Image:

Test = gdal.Open(Data_path + "DEM.bil")
DEM = Test.ReadAsArray()

hv.notebook_extension()
%opts Raster [xrotation=20] Points (color='r')[xrotation=20]

#Import point data
df = pd.read_csv(path+name)
stream_dataset = gv.Dataset(df, kdims=['x', 'y'], vdims=['elevation', 'chi', 'flow_distance'])
stream = hv.Points(stream_dataset)

#Import raster
raster = hv.Raster(DEM)(style={'cmap':'inferno'}) 
image = gv.Image(DEM, crs=crs.PlateCarree()) (style={'cmap':'inferno'})

raster + stream + image

结果如下:

Results

0 个答案:

没有答案