You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"[GDAL](https://gdal.org/) is today the reference toolbox to read and write raster data. It is used by almost all of the FOSS4G programmes and libraries that interact with rasters. GDAL is also used by many commercial products. A [Python API](https://gdal.org/python/) is available for GDAL that provides much of the functionality.\n",
53
-
"\n",
54
-
"The [RasterIO](https://rasterio.readthedocs.io) library makes interaction with rasters considerably more convenient, however. It is in essence a bridge between GDAL and the [NumPy](https://numpy.org/) package for scientific computing. With RasterIO rasters are easily translated into NumPy arrays and vice-versa."
55
-
]
56
-
},
57
-
{
58
-
"cell_type": "markdown",
59
-
"metadata": {},
60
-
"source": [
61
-
"## Reading in and inspecting a raster\n",
62
-
"\n",
63
-
"Possibly the most essential operation is to open a raster for processing or inspection. This is rather simple:\n",
64
-
"\n"
65
-
]
52
+
"[GDAL](https://gdal.org/) is the reference toolbox to read and write raster data. It is used by almost all of the \n",
53
+
"FOSS4G programmes and libraries that interact with rasters. GDAL is also used by many commercial products. \n",
54
+
"A [Python API](https://gdal.org/python/) is available with most of the GDAL functionality."
55
+
]
66
56
},
67
57
{
68
58
"cell_type": "code",
69
59
"execution_count": null,
70
60
"metadata": {},
71
61
"outputs": [],
72
62
"source": [
73
-
"import rasterio"
74
-
]
75
-
},
76
-
{
77
-
"cell_type": "code",
78
-
"execution_count": null,
79
-
"metadata": {},
80
-
"outputs": [],
81
-
"source": [
82
-
"world = rasterio.open('../data/world.rgb.tif')"
63
+
"from osgeo import gdal\n",
64
+
"gdal.UseExceptions()\n",
65
+
"ds = gdal.Open('../data/world.rgb.tif')\n",
66
+
"band = ds.GetRasterBand(1)\n",
67
+
"band.GetDescription()"
83
68
]
84
69
},
85
70
{
86
71
"cell_type": "markdown",
87
72
"metadata": {},
88
73
"source": [
89
-
"The `open` method returns an object of the class `DatasetReader`, which contains the raster meta-data and the set of bands included. `open` can also be invoked in write mode (with the extra argument `'w'`), in which case it returns a `DatasetWriter` type object.\n",
90
-
"\n",
91
-
"`DatasetReader` provides easy access to useful meta-data, for instance the raster dimensions:"
92
-
]
74
+
"A typical use case for using gdal in python is resampling a grid and creating overviews, so the tiff can be used as a\n",
0 commit comments