0

I am running Species Distribution Modeling in R in biomod2 package for an riverine species in the Ganges River basin so I clipped the bioclim layer with the river network that I obtained from hydrosheds. Resolution of bioclim layer and river network at 1km*1km. But the problem arose as not all coordinates fell on the raster cells (probable causes - coordinates taken at banks, river networks not correctly delineated etc.)

So how do I overcome this problem? Do I pull the coordinates to the nearest raster cell (nearest in terms of vertices? - If this is the correct method than an easier way to do this too) or do I just leave the coordinates - more than half occurrence points would be deleted.

enter image description here

Anu Rai
  • 43
  • 6
  • The best solution would be to find a higher resolution dataset, if that is not possible you can perform an extraction similar to this: https://stackoverflow.com/questions/27562076/if-raster-value-na-search-and-extract-the-nearest-non-na-pixel – drJones May 04 '20 at 23:44
  • Dear @drJones thank you for your reply. The solution that you have directed did not work for me. The first solution just didn't work froze my Rstudio for a really long time and as for the next solution the coordinate system that I have used is geographic. However, I did find nearestLand function in seegSDM package. But I am still a bit confused if dragging a coordinate into the nearest NA raster cell is the right solution. – Anu Rai May 12 '20 at 07:49
  • It depends on the data you are using. I assume this is not an issue for the bioclimatic data as that would be a continuous surface and you would not be extracting NA values. What is the information you are extracting from the hydrosheds layer? – drJones May 13 '20 at 10:17
  • Dear @drJones the hydrosheds has river network. This is an SDM of an aquatic species so I am clipping the bioclimatic data from the river network (vector lines) as opposed to clipping the variable for a polygon extent usually reserved for terrestrial species. – Anu Rai May 13 '20 at 11:03

0 Answers0