How to extract imd rainfall data for polygons(district level) within a shapefile?.

Used PyQGIS , solution (given below) wherein output for each day of all polygons is exported as .csv file. Had to give a while loop since for loop was giving some error. I was wondering whether

  1. my procedure is right

  2. is it possible to append the zonalstat for each day in the same shapefile/or output csv file?

    while i <366:
        processing.run("native:zonalstatisticsfb",{'INPUT':'path to shapefile','INPUT_RASTER':'path to nc.file/_Clim_Pred_LRF_New_RF25_IMD0p252014.nc','RASTER_BAND':i,'COLUMN_PREFIX':'_'+str(i)+'_','STATISTICS':[0,1,2,5,6],'OUTPUT':'outputpath/2014output_band'+str(i)+'.csv'})
  • 1
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Sep 24, 2022 at 19:45


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.