microsoft / farmvibes-ai

FarmVibes.AI: Multi-Modal GeoSpatial ML Models for Agriculture and Sustainability

Home Page:https://microsoft.github.io/farmvibes-ai/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SoilGrids Workflow Not Functioning for Smaller Farm Sizes.

click2cloud-sagarB opened this issue · comments

Dear Farmvibes Team,
When we are running "data_ingestion/soil/soilgrids" workflow for small farms
it gets fails and raise RuntimeError "RuntimeError: Failed to run op download_soilgrids in workflow run id 7a2d566b-88e7-4609-809e-90bf46e540b2 for input with message id 00-7a2d566b88e74609809e90bf46e540b2-a2b733f86d78174f-01. Error description: <class 'RuntimeError'>: RuntimeError(f"Failed request for {id} in {self.url} after {MAX_RETRIES} retries.")\nRuntimeError: Failed request for soc_15-30cm_mean in https://maps.isric.org/mapserv?map=/map/soc.map after 5 retries". Can we take action to prevent it from failing for smaller size farms?
Is there a certain farm size for which your team is aware that soilgrid process will not function?

Additionally, for somewhat bigger farms (10–20 acres), even if the workflow is successful, the resulting TIFF file generated from workflow output contains empty or null lat long information.

Attached to this issue, you will find:

  1. Log file for workflow failure for small farm.

  2. Output tif file from soilgrid workflow for 15 acres farms with empty or null lat long information.

    soilgrid.zip

Hi @click2cloud-sagarB, thanks for filling this issue. One potential reason for the issue related to small farms is that the polygon is smaller than the soilgrids pixels resolution. Soilgrids documentation says the resolution varies between 250m and 1km (https://www.isric.org/explore/soilgrids/faq-soilgrids#When_100_metres_resolution).

Hi @click2cloud-sagarB , as @py5gol mentioned the highest Soilgrids resolution is 250m. You can buffer your polygon (as little as 0.0025 degrees, i.e. ~500m) and get a few pixels (I just tried that with your polygon and it worked). As for larger polygons returning null data, this seems to be a different issue. Can you share more details?

Hi @edrodrigues-ag , Thank you for your quick response!
I tried buffering the polygon for little farms, and it worked perfectly!
Since you asked, I'm providing further details below for somewhat bigger polygons (10–20 acres) that are giving null data.
I am running the "data_ingestion/soil/soilgrids" soil grid workflow for a farm of 15 acres. The workflow was finished properly, but when I try to extract lat/long data from the tif file that was generated, I get a null result, unlike with bigger farms (~more than 20 acres in area).
I've included the

  1. code snippet I used to extract the lat, long data from the generated tiff file
  2. polygonal .wkt file which include polygonal co-ordinates of 15 acres farm
  3. generated tif file for 15 acres farm

input_files.zip

Hi @click2cloud-sagarB , this other polygon still seems quite small. Could you please try to buffer it a bit?

Hi, @edrodrigues-ag , with a small buffer, it functioned just like small farms (means works perfectly with buffer), but the difference is that in small farms, the workflow itself fails without buffer, but in somewhat bigger farms, the workflow was successful but output tif file did not included information about lat,long and each pixel values.

Closing this issue, as discussed with @click2cloud-sagarB online.