Farm Pin Crop Detection Challenge
$10,000 USD
Classify fields in South Africa by crop type using Sentinel-2 satellite imagery
4 March–1 September 2019 23:59
612 data scientists enrolled, 68 on the leaderboard
Train shape file issue
published 30 Jul 2019, 14:28

Hi there - has anyone else experienced an issue with the train shape file? I'm exploring the dataset in SNAP prior to starting and although I can import the test set one fine, the train set one fails to import the vector data and claims an IO Error (null pointer exception) occurred.

Hey KayJay, yea this is due to some of the farms in the training set being outside the raster of the JEP dumps. This is why we have JEP and JFP dumps.

One way to overcome this is to remove all the farms from the training set which are not inside the bounds of the JEP / JFP images. There are various ways to do this, but the easiest would probably be do reproject the shape file to the same CRS as the raster, and then use geopandas's functions to determine whether a farm's center point is within the bounding box of the raster.

The way I did it was to actually use rasterio's masking functionality, because it returns a ValueError if the polygon is outside the raster bounds.

If you just want to get a feel for SNAP though, try loading in the test set. I think that works.

Thanks Renier! Really helpful.