Hello,
I am attempting to construct a crop type classification pipeline based on label data from the Zindi farm pin crop detection challenge.
I am able to download the necessary data for my Area of interest and I am able to rasterize the label data. The problem I have is the rasterized labels have incorrect border values as shown in the image below (You can see all polygon border values are random):
I have tried using buffer/erosion/ etc with no success. Following Simon Grest’s write up (GitHub - simongrest/farm-pin-crop-detection-challenge: 8th place solution to Zindi's FarmPin Crop Detection Challenge), he has no issues with rasterization although he used eo-learn v0.6.
The land cover data is a vector train.shp file and I rasterize it as follows:
land_cover_path = './train/test.shp'
land_cover_data = gpd.read_file(land_cover_path)
land_cover_data.dropna(inplace=True)
land_cover_data.to_crs({'init': 'EPSG:32734'},inplace=True)
land_cover_datat'Crop_Id_Ne'] = land_cover_data.Crop_Id_Ne.astype('uint8')
rasterization_task = VectorToRasterTask(land_cover_data, (FeatureType.MASK_TIMELESS, 'LULC'),
values_column='Crop_Id_Ne', raster_shape=(FeatureType.MASK, 'IS_DATA'),
raster_dtype=np.uint8)
I am using EO-learn v0.10.1 installed using conda from the conda-forge channel.
I have no problems with the SI_LULC_pipeline example notebook so I’m not sure what could be wrong.
Does anyone have such experience when rasterizing a vector? Any help on how to resolve this issue will greatly be appreciated.
Many thanks.