diff --git a/README.md b/README.md index 4c15f67..9d773c5 100644 --- a/README.md +++ b/README.md @@ -57,17 +57,23 @@ metadata: version: 1 sources: - - name: Elevation - key: elevation-user + - name: Global Elevation Example + key: elevation-example text: Elevation - description: Global elevation + description: Global elevation example geometry_type: raster shade_how: linear - span: min/max + cmap: + - white + - black + span: + - 58 + - 248 + raster_padding: 0 raster_interpolate: linear xfield: geometry yfield: geometry - filepath: ~/mapshader/mapshader/tests/fixtures/elevation.tif + filepath: mapshader/tests/fixtures/elevation.tif transforms: - name: squeeze args: @@ -82,6 +88,8 @@ sources: - name: reproject_raster args: epsg: 3857 + service_types: + - tile ``` This configuration file can then be passed to the flask server upon startup: diff --git a/mapshader/commands/tif_to_netcdf.py b/mapshader/commands/tif_to_netcdf.py index 5bec56c..028b536 100644 --- a/mapshader/commands/tif_to_netcdf.py +++ b/mapshader/commands/tif_to_netcdf.py @@ -134,7 +134,7 @@ def tif_to_netcdf( arr = reproject_raster(arr, epsg=crs) dataset = xr.Dataset( - data_vars={data_variable: (['y', 'x'], arr.chunk(chunks))}, + data_vars={data_variable: (['y', 'x'], arr.chunk(chunks).data)}, coords={'x': arr.coords[x], 'y': arr.coords[y]}, ) dataset.attrs = dict(name=data_variable) diff --git a/mapshader/tests/fixtures/shade.nc b/mapshader/tests/fixtures/shade.nc index 5d703eb..fdbb2ab 100644 Binary files a/mapshader/tests/fixtures/shade.nc and b/mapshader/tests/fixtures/shade.nc differ