<div dir="ltr">Fala Éder...<div>muito bom</div><div><br></div><div>Abraço</div><div><br></div><div>Hélio</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/12/28 Eder Comunello [via R-br] <span dir="ltr"><<a href="mailto:ml-node+s2285057n4661367h45@n4.nabble.com" target="_blank">ml-node+s2285057n4661367h45@n4.nabble.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra">Alexandre,</div><div class="gmail_extra"><br></div><div class="gmail_extra">Atualizei seu CMR, adicionando as últimas linhas para realizar o recorte com um polígono irregular.</div>
<div class="gmail_extra">
<div class="gmail_extra"><br></div><div class="gmail_extra">### <code r<font face="courier new, monospace">></font></div><div class="im"><div class="gmail_extra"><font face="courier new, monospace">require(sp); require(rgdal); require(raster)</font></div>
<div class="gmail_extra"><font face="courier new, monospace"><br></font></div><div class="gmail_extra"><font face="courier new, monospace">## Raster-----------------------------------------------------------</font></div>
<div class="gmail_extra">
<font face="courier new, monospace">set.seed(20131226)</font></div><div class="gmail_extra"><font face="courier new, monospace">r <- raster(nc=100, nr=100)</font></div><div class="gmail_extra"><font face="courier new, monospace">r <- setValues(r, round(runif(ncell(r))* 255))</font></div>
<div class="gmail_extra"><font face="courier new, monospace">image(r,col=gray(seq(0,1,0.025)))</font></div><div class="gmail_extra"><font face="courier new, monospace"><br></font></div><div class="gmail_extra"><font face="courier new, monospace">## Borda -----------------------------------------------------------</font></div>
<div class="gmail_extra"><font face="courier new, monospace">x<-c(-125,-100,0,100,-125)</font></div><div class="gmail_extra"><font face="courier new, monospace">y<-c(-49,25,0,-50,-49)</font></div><div class="gmail_extra">
<font face="courier new, monospace">limite<-cbind(x,y)</font></div><div class="gmail_extra"><font face="courier new, monospace">lines(limite, col="yellow")</font></div><div class="gmail_extra"><font face="courier new, monospace">##</font></div>
<div class="gmail_extra"><font face="courier new, monospace"><br></font></div><div class="gmail_extra"><font face="courier new, monospace">## Converte borda para SpatialPolygon</font></div><div class="gmail_extra"><font face="courier new, monospace">spt.borda <- SpatialPolygons(list(Polygons(list(Polygon(limite)), "1")))</font></div>
<div class="gmail_extra"><font face="courier new, monospace"><br></font></div><div class="gmail_extra"><font face="courier new, monospace">### Recorte do raster contido no interior da borda</font></div><div class="gmail_extra">
<font face="courier new, monospace">r.crop <- crop(r, spt.borda, snap='out')</font></div><div class="gmail_extra"><font face="courier new, monospace">image(r.crop, asp=1)</font></div><div class="gmail_extra"><font face="courier new, monospace"><br>
</font></div></div><div class="gmail_extra"><font face="courier new, monospace">### Recorte com polígono irregular! </font></div><div class="gmail_extra"><font face="courier new, monospace">r.masked <- mask(r.crop, spt.borda)</font></div>
<div class="gmail_extra"><font face="courier new, monospace">image(r.masked, asp=1)</font></div><div class="gmail_extra"><font face="courier new, monospace">### </code></font></div><div class="gmail_extra"><br></div>
<div class="gmail_extra"><br></div></div></div><div class="im">
<br>_______________________________________________
<br>R-br mailing list
<br><a href="http://user/SendEmail.jtp?type=node&node=4661367&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br><a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" rel="nofollow" link="external" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" rel="nofollow" link="external" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.
<br>
<br>
<hr noshade size="1" color="#cccccc">
</div><div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif"><div class="im">
<div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
</div><a href="http://r-br.2285057.n4.nabble.com/R-br-Recortar-raster-com-limite-em-data-frame-tp4661344p4661367.html" target="_blank">http://r-br.2285057.n4.nabble.com/R-br-Recortar-raster-com-limite-em-data-frame-tp4661344p4661367.html</a>
</div><div class="HOEnZb"><div class="h5">
<div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
To unsubscribe from R-br, <a href="http://r-br.2285057.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3357982&code=aGVsaW9nYWxsb3JvY2hhQGdtYWlsLmNvbXwzMzU3OTgyfC0xMzQ3NTkwMDY4" target="_blank">click here</a>.<br>
<a href="http://r-br.2285057.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" target="_blank">NAML</a>
</div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Hélio Gallo Rocha<br>IFSULDEMINAS - Câmpus Muzambinho<br>
</div>