Skip to content

Commit 4b185d1

Browse files
authored
Fix mapshader config example (#95)
* fix mapshader YAML config example on the readme file * fix xarray error when constructing a variable without using the .data property
1 parent 8f119eb commit 4b185d1

3 files changed

Lines changed: 14 additions & 6 deletions

File tree

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,23 @@ metadata:
5757
version: 1
5858

5959
sources:
60-
- name: Elevation
61-
key: elevation-user
60+
- name: Global Elevation Example
61+
key: elevation-example
6262
text: Elevation
63-
description: Global elevation
63+
description: Global elevation example
6464
geometry_type: raster
6565
shade_how: linear
66-
span: min/max
66+
cmap:
67+
- white
68+
- black
69+
span:
70+
- 58
71+
- 248
72+
raster_padding: 0
6773
raster_interpolate: linear
6874
xfield: geometry
6975
yfield: geometry
70-
filepath: ~/mapshader/mapshader/tests/fixtures/elevation.tif
76+
filepath: mapshader/tests/fixtures/elevation.tif
7177
transforms:
7278
- name: squeeze
7379
args:
@@ -82,6 +88,8 @@ sources:
8288
- name: reproject_raster
8389
args:
8490
epsg: 3857
91+
service_types:
92+
- tile
8593
```
8694

8795
This configuration file can then be passed to the flask server upon startup:

mapshader/commands/tif_to_netcdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def tif_to_netcdf(
134134
arr = reproject_raster(arr, epsg=crs)
135135

136136
dataset = xr.Dataset(
137-
data_vars={data_variable: (['y', 'x'], arr.chunk(chunks))},
137+
data_vars={data_variable: (['y', 'x'], arr.chunk(chunks).data)},
138138
coords={'x': arr.coords[x], 'y': arr.coords[y]},
139139
)
140140
dataset.attrs = dict(name=data_variable)

mapshader/tests/fixtures/shade.nc

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)