Skip to content

Commit 43e16da

Browse files
committed
add a zarr sample + vsizip
1 parent c4afd6a commit 43e16da

4 files changed

Lines changed: 24 additions & 0 deletions

File tree

workshop/jupyter/content/data/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ and sometimes also GeoJSON.
1616

1717
NB "Antarctica" has been removed from the "countries" datasets as it gave
1818
problems with reprojections...
19+
20+
Sample_geozarr has been produced in the scope of this training using numpy with random numbers.
5.87 KB
Binary file not shown.

workshop/jupyter/content/notebooks/05-raster-data.ipynb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,27 @@
123123
"\n"
124124
]
125125
},
126+
{
127+
"cell_type": "markdown",
128+
"metadata": {},
129+
"source": [
130+
"GDAL supports a wide variety of input format, and can also combine it with virtual filesystems, such as within a zipfile"
131+
]
132+
},
133+
{
134+
"cell_type": "code",
135+
"execution_count": null,
136+
"metadata": {},
137+
"outputs": [],
138+
"source": [
139+
"from osgeo import gdal\n",
140+
"import matplotlib.pyplot as plt\n",
141+
"# Notice how the zarr file is referenced within the zip file\n",
142+
"raster_path = '/vsizip/../data/sample_geozarr.zarr.zip/sample_geozarr.zarr'\n",
143+
"dataset = gdal.Open(raster_path)\n",
144+
"r = plt.imshow(ds.GetRasterBand(1).ReadAsArray())\n"
145+
]
146+
},
126147
{
127148
"cell_type": "markdown",
128149
"metadata": {},

workshop/jupyter/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ pygeometa # >0.7 removed by Just
1313
matplotlib
1414
fiona
1515
rasterio
16+
zarr

0 commit comments

Comments
 (0)