nagyrc / C_fire_invasives

GNU General Public License v3.0
1 stars 1 forks source link

not sure MODIS is extracting properly in raster::extract #3

Closed nagyrc closed 5 years ago

nagyrc commented 5 years ago

https://github.com/nagyrc/C_fire_invasives/blob/59d2212953481cac6957b955e151f42d454337ae/4_add_fire_data.R#L187-L194

mbjoseph commented 5 years ago

@nagyrc I can't reproduce this locally, since I do not have the MODIS data used in the script.

mbjoseph commented 5 years ago

Instead of reprojecting the MODIS data, it would be more efficient to reproject the points. In psuedocode:

1. Project points to the raster's projection
2. Use raster::extract to get the values, and return a SpatialPointsDataFrame

No need to reproject or crop the raster if you reproject the points.

mbjoseph commented 5 years ago

@nagyrc I'm not sure whether you saw my previous replies - this is just a ping to bump it into your inbox!

nagyrc commented 5 years ago

Awesome, thanks! I'll give this a try!

nagyrc commented 5 years ago

I reprojected the points to match the raster then used raster::extract. This was much faster.