First, the user would have to initialize the geotile using a raster file, i.e., gt = GeoTile('/path/to/raster/file.tif') Second, the user would have to generate the mask by specifying the directory for the shapefile and the output directory for the resulting raster, i.e., gt.mask('/path/to/shapefile.shp', '/path/to/output/file.tif').
The documentation also states clearly that, "The output raster will have similar metadata as the input raster."
So I tried creating a mask using a sample shapefile and initializing the geotile using my 3-band RGB image, and the resulting mask was not binary but an RGB image.
From your tutorial, I saw that you initialized your geotile using an existing binary mask, and as such, you could get a binary mask when you masked your shapefile. In reality, however, there would not be an existing mask for a user to use to initialize their geotile. The only raster that would be available is the multiband image. Kindly take a look and fix the error.
In order to solve this issue, you need to use gt.rasterization() function. The propose of mask function is to clip the raster dataset which is similar to extract by mask function in ArcGIS.
from the Geotile documentation on how to generate the mask, the code used was as follows:
First, the user would have to initialize the geotile using a raster file, i.e.,
gt = GeoTile('/path/to/raster/file.tif')
Second, the user would have to generate the mask by specifying the directory for the shapefile and the output directory for the resulting raster, i.e.,gt.mask('/path/to/shapefile.shp', '/path/to/output/file.tif')
.The documentation also states clearly that, "The output raster will have similar metadata as the input raster."
So I tried creating a mask using a sample shapefile and initializing the geotile using my 3-band RGB image, and the resulting mask was not binary but an RGB image.
From your tutorial, I saw that you initialized your geotile using an existing binary mask, and as such, you could get a binary mask when you masked your shapefile. In reality, however, there would not be an existing mask for a user to use to initialize their geotile. The only raster that would be available is the multiband image. Kindly take a look and fix the error.
This message from udemy course here: https://www.udemy.com/course/deep-learning-application-for-earth-observation/?referralCode=B4655A8A918826871A40