<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><br><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Bom dia pessoal,<div>Espero que possam me ajudar.</div><div><br></div><div>Entro em contato para pedir uma ajuda em uma interpolação que estou tentando fazer. </div><div>Já usei o mesmos comandos abaixo para realizar interpolações de variáveis de um lago por ordinary kriging com 240 pontos, sem problemas.</div><div><br></div><div>Agora estou tentando interpolar a batimetria do lago, para tanto criei pontos no limite do lago com valor zero,  cerca de 1200 pontos. </div><div>Usando a mesma metodologia, a predição “predict( )" para o grid passa de 3 horas e não tive paciência para esperar mais, visto que as outras vezes que usei a predição para o grid demorou cerca de 2 minutos para 240 pontos interpolados.</div><div>Imagino que a quantidade de pontos seja o problema.</div><div><br></div><div>Alguém teria alguma sugestão de caminho que tivesse menos custo computacional, pois acho que a quantidade de pontos seja o problema.</div><div><br></div><div>Agradeço desde já a atenção.</div><div><br></div><div>Segue abaixo os comandos utilizados:</div><div><br></div><div><div>>library(geoR)</div><div>>library(raster)</div><div>>library(gstat)</div><div>>library(rgdal)</div><div>>interpol_pcsand<-data_interpol[,c(1,2,6)]</div><div><br></div><div>>coordinates(interpol_pcsand)<- ~long+lat</div><div><br></div><div>#setting the CRS for the geospatial data, same as the mask and grid </div><div>>projection(interpol_pcsand)<-'+proj=utm +zone=22 +south +ellps=aust_SA +units=m +no_defs '</div><div><br></div><div>#search for duplicated coords</div><div>>dup.coords(interpol_pcsand$coords)</div><div><br></div><div>#Creating  a gstat object</div><div>>g_pcsand <- gstat(id="pcsand", formula=pcsand ~ 1, data=interpol_pcsand)</div><div><br></div><div># variogram with eye ball fitting</div><div>> v.eye_sand <- eyefit(variog(as.geodata(interpol_pcsand["pcsand"]), max.dist = 20000))</div><div><br></div><div>#saving a readable file for gstat</div><div>>ve.fit <- as.vgm.variomodel(v.eye[[1]])</div><div><br></div><div>#updating the gstat object</div><div>>g_pcsand <- gstat(g_pcsand, id="pcsand", model=ve.fit_pcsand )</div><div><br></div><div><b>#predicting to new data</b></div><div><b># grid4 diemensions - </b></div><div><b>#features    : 1630464 </b></div><div><b>#extent      : 468333.3, 499983.3, 6634933, 6681223  (xmin, xmax, ymin, ymax)</b></div><div><b>#coord. ref. : +proj=utm +zone=22 +south +ellps=aust_SA +units=m +no_defs </b></div><div><b>>p_pcsand <- predict(g_pcsand, model=ve.fit_pcsand , newdata=grid4) </b></div><div><br></div><div>#write a raster with the interpolated matrix</div><div>rasterpcsand_pred <- rasterFromXYZ(as.data.frame(p_pcsand)[, c("x", "y", "data.pred")])</div><div><br></div><div>#Create raster tif file</div><div><br></div><div>>writeRaster(raster, filename="raster.tif", overwrite=TRUE)</div></div><br><br><div apple-content-edited="true">
<div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>_________________________________<br>Thiago Cesar Lima Silveira<br>PhD candidate - Zoology PUCRS - Brazil<br>Visitor PhD. student - School of Ocean Sciences -  Bangor University</div><div><span style="font-size: 10pt; text-align: justify;">Building Westbury Mouth</span></div><div><span style="font-size: 13px; text-align: justify;">Room Nautilus 327</span></div><div><span style="font-size: 10pt; text-align: justify;">Menai Bridge - Isle of Anglesey - UK</span></div><div>Telephone.: 07843 115244<br>e-mail: <a href="mailto:thiago.cesar@acad.pucrs.br">thiago.cesar@acad.pucrs.br</a><br>CV: <a href="http://lattes.cnpq.br/5960267776845701">http://lattes.cnpq.br/5960267776845701</a></div></div></div>
</div>
<br></div></div></div><br></body></html>