I am trying to use raster::focal to fill some holes in many RasterLayers. I
call:
focal(raster_layer, fun = mean, w = matrix(1, nrow = 3, ncol = 3), NAonly =
TRUE, na.rm = TRUE)
I am only interested in filling in holes in a small subset of each
RasterLayer (i.e. a country when the raster is
A bunch of options is given here too:
http://rstudio-pubs-static.s3.amazonaws.com/1057_1f7e9ac569644689b7e4de78c1fece90.html
2016-03-18 10:45 GMT-04:00 Zack Holden :
> Marine,
> The focal() function in the raster library should work. You should be able
> to apply a custom
On Fri, Mar 18, 2016 at 2:43 PM, Alex Mandel wrote:
> library(rgeos)
> gCentroid
>
> http://www.rdocumentation.org/packages/rgeos/functions/topo-unary-gCentroid
>
> Assuming its a circle that would be the center.
Only if you have points uniformly (or uniform-randomly)
Oops :-[ , Barry thanks for clarification , I got it now.
I don't understand the math either but as a kind of "reparation"
for not reading well enough I found the authors java code.
https://www.spaceroots.org/documents/circle/CircleFitter.java
After download you should for standalone compilation