This will save processing time in the long run, as you work with larger raster files. However, you are only working with 55mb files. Make sure you have set the path to your tif. Now load the library raster the function raster to import the tif-file included in the zip file. Our goal is to create the most advanced and affordable photo editor. The full sample, including files at different resolutions, can be downloaded from here. Suggest new features at our GitHub or Facebook. This dataset is a freely available sample for the swissALTI3D data. Notice that the results above suggest that the overlay() function is in fact just a bit faster than the regular raster math approach. Download the sample dataset here and unzip it into your project folder. microbenchmark (( naip_multispectral_st ] - naip_multispectral_st ]) / ( naip_multispectral_st ] + naip_multispectral_st ]), times = 5 ) # Unit: seconds # expr # (naip_multispectral_st] - naip_multispectral_st])/(naip_multispectral_st] + naip_multispectral_st]) # min lq mean median uq max neval # 2.528051 2.560168 2.583259 2.566227 2.614948 2.646902 5 # is overlay faster? microbenchmark ( overlay ( naip_multispectral_st ], naip_multispectral_st ], fun = normalized_diff ), times = 5 ) # Unit: seconds # expr # overlay(naip_multispectral_st], naip_multispectral_st], fun = normalized_diff) # min lq mean median uq max neval # 1.844418 1.867522 1.868953 1.868801 1.879466 1.884559 5 # what if you make your stack a brick - is it faster? naip_multispectral_br <- brick ( naip_multispectral_st ) inMemory ( naip_multispectral_br ) # FALSE microbenchmark ( overlay ( naip_multispectral_br ], naip_multispectral_br ], fun = normalized_diff ), times = 5 ) # Unit: seconds # expr # overlay(naip_multispectral_br], naip_multispectral_br], fun = normalized_diff) # min lq mean median uq max neval # 1.451341 1.633023 1.683456 1.695315 1.696663 1.940938 5 Library ( microbenchmark ) # is the raster in memory? inMemory ( naip_multispectral_st ) # FALSE # How long does it take to calculate ndvi without overlay.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |