<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    PERFEITO!!!! Thiago,<br>
    <br>
             Era isto mesmo que eu queria fazer. Minha abordagem inicial
    era trabalhar com polígonos usando o PBSmapping, mas estava difícil
    fazer a representação do contorno neste formato sobre a imagem.
    Tenho uma última questão e vou precisar combinar diferentes bandas,
    por isso a bordagem inicial usando stack(), mas vou utilizar um loop
    sobre brick() conforme me recomendou, porém o que me preocupa foi o
    processo de rasterize() que gostaria de saber se vai mudar o valor
    dos pixels? Pois quero plotar novamente como na imagem inicial em
    escala de cinza, mas se fazer um plot greyscale o valor dos pixels
    não vão ficar subjetivo?<br>
    <br>
    Obrigado,<br>
    <br>
    Alexandre<br>
    <br>
    <br>
    <div class="moz-cite-prefix">Em 06/04/2013 18:52, Thiago V. dos
      Santos escreveu:<br>
    </div>
    <blockquote
      cite="mid:1365288762.59385.YahooMailNeo@web121905.mail.ne1.yahoo.com"
      type="cite">
      <div style="color:#000; background-color:#fff; font-family:times
        new roman, new york, times, serif;font-size:12pt">
        <div style="font-family: 'times new roman', 'new york', times,
          serif; font-size: 12pt;"><span>Alexandre, </span></div>
        <div style="font-family: 'times new roman', 'new york', times,
          serif; font-size: 16px; color: rgb(0, 0, 0); background-color:
          transparent; font-style: normal;"><span><br>
          </span></div>
        <div style="font-family: 'times new roman', 'new york', times,
          serif; font-size: 16px; color: rgb(0, 0, 0); background-color:
          transparent; font-style: normal;"><span>Acredito que o codigo
            no final dessa mensagem funcione. </span></div>
        <div style="font-family: 'times new roman', 'new york', times,
          serif; font-size: 16px; color: rgb(0, 0, 0); background-color:
          transparent; font-style: normal;"><span><br>
          </span></div>
        <div style="font-family: 'times new roman', 'new york', times,
          serif; font-size: 16px; color: rgb(0, 0, 0); background-color:
          transparent; font-style: normal;"><span>O maior problema foi
            converter o seu shapefile de polylines para polygons (voce
            tinha mencionado na primeira pergunta). So consegui fazer
            isso usando uma combinacao de funcoes dos pacores maptools e
            PBSmapping - voce deve instalar esse pacote. </span></div>
        <div style="font-family: 'times new roman', 'new york', times,
          serif; font-size: 16px; color: rgb(0, 0, 0); background-color:
          transparent; font-style: normal;"><span><br>
          </span></div>
        <div style="font-family: 'times new roman', 'new york', times,
          serif; font-size: 16px; color: rgb(0, 0, 0); background-color:
          transparent; font-style: normal;"><span>Primeiro eu converti
            as polylines para polysets (classe do pacote PBSmapping) e
            em seguida polysets para poligonos. O fluxo subsequente foi
            o mesmo que eu tinha te passado anteriormente.</span></div>
        <div style="font-family: 'times new roman', 'new york', times,
          serif; font-size: 16px; color: rgb(0, 0, 0); background-color:
          transparent; font-style: normal;"><span><br>
          </span></div>
        <div style="font-family: 'times new roman', 'new york', times,
          serif; font-size: 16px; color: rgb(0, 0, 0); background-color:
          transparent; font-style: normal;"><span>Alem disso, carreguei
            a banda que voce mandou como brick (ao inves de stack) para
            para fins de simplicidade. Se voce fizer questao do stack
            para aplicar a todas as bandas da imagem, entao tera que
            fazer um loop entre elas - for (i in 1:nbands(land)){}.</span></div>
        <div style="font-family: 'times new roman', 'new york', times,
          serif; font-size: 16px; color: rgb(0, 0, 0); background-color:
          transparent; font-style: normal;"><span style="font-size:
            12pt;"> </span><br>
        </div>
        <div style="font-family: 'times new roman', 'new york', times,
          serif; font-size: 12pt;">---------------------------------------------------</div>
        <div>
          <div># Require packages</div>
          <div>require(raster)</div>
          <div>require(maptools)</div>
          <div>require(PBSmapping)</div>
          <div><br>
          </div>
          <div>#Load data</div>
          <div>land <-
             raster("LANDSAT_5_TM_20100506_217_074_L2_BAND7.tif")</div>
          <div>contorno_line <- readShapeLines ("Catas_Altas.shp",
             proj4string=CRS("+proj=utm +zone=23 +south +datum=WGS84
            +units=m +no_defs"))<br>
          </div>
          <div><br>
          </div>
          <div># Convert SpatialLines to PolySet and then to
            SpatialPolygons - this will require package PBSmapping</div>
          <div>contorno_poly <- PolySet2SpatialPolygons
            (SpatialLines2PolySet(contorno_line), close_polys=TRUE)</div>
          <div><br>
          </div>
          <div># Then, perform crop and mask procedures as usual</div>
          <div>land.crop <- crop(land, extent(contorno_poly),
            snap='out')</div>
          <div>contorno.na <- setValues(land.crop, NA)</div>
          <div>contorno.r <- rasterize(contorno_poly, contorno.na)</div>
          <div>land_mask <- mask(x=land.crop, mask=contorno_poly)</div>
          <div><br>
          </div>
          <div>#Check final result</div>
          <div>plot(land_mask)</div>
          <div style="font-family: 'times new roman', 'new york', times,
            serif; font-size: 12pt;"><span style="font-size: 12pt;">---------------------------------------------------</span><br>
          </div>
        </div>
        <div style="font-family: 'times new roman', 'new york', times,
          serif; font-size: 12pt;"><br>
        </div>
        <div style="font-family: 'times new roman', 'new york', times,
          serif; font-size: 12pt;">Saudações,<br>
          --<br>
          Thiago V. dos Santos<br>
          PhD student<br>
          Land and Atmospheric Science<br>
          University of Minnesota<br>
<a class="moz-txt-link-freetext" href="http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/index.htm">http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/index.htm</a><br>
          Phone: (612) 323 9898<br>
        </div>
        <div style="font-family: 'times new roman', 'new york', times,
          serif; font-size: 12pt;">
          <div style="font-family: 'times new roman', 'new york', times,
            serif; font-size: 12pt;">
            <div dir="ltr"> <font size="2" face="Arial">
                <hr size="1"> <b><span style="font-weight:bold;">From:</span></b>
                ASANTOS <a class="moz-txt-link-rfc2396E" href="mailto:alexandresantosbr@yahoo.com.br"><alexandresantosbr@yahoo.com.br></a><br>
                <b><span style="font-weight: bold;">To:</span></b>
                <a class="moz-txt-link-abbreviated" href="mailto:r-br@listas.c3sl.ufpr.br">r-br@listas.c3sl.ufpr.br</a>; Thiago V. dos Santos
                <a class="moz-txt-link-rfc2396E" href="mailto:thi_veloso@yahoo.com.br"><thi_veloso@yahoo.com.br></a> <br>
                <b><span style="font-weight: bold;">Sent:</span></b>
                Saturday, April 6, 2013 1:17 PM<br>
                <b><span style="font-weight: bold;">Subject:</span></b>
                Re: [R-br] Criando uma mascara com shapefile sobre
                raster<br>
              </font> </div>
            <br>
            <div id="yiv1497405944">
              <div> Thiago<br>
                <br>
                 Segue dbf e shx, prj não foi projetado ainda não,<br>
                <br>
                <a moz-do-not-send="true" rel="nofollow" target="_blank"
href="https://www.dropbox.com/s/p0idcxmh7td8hgi/Catas_Altas.dbf">https://www.dropbox.com/s/p0idcxmh7td8hgi/Catas_Altas.dbf</a>
                  ## Dbf<br>
                <br>
                <a moz-do-not-send="true" rel="nofollow" target="_blank"
href="https://www.dropbox.com/s/mssh8lq6cy61ncd/Catas_Altas.shx">https://www.dropbox.com/s/mssh8lq6cy61ncd/Catas_Altas.shx</a>
                ## Shx,<br>
                <br>
                <br>
                Muito obrigado,<br>
                <br>
                <br>
                Alexandre<br>
                <br>
                 <br>
                <div class="yiv1497405944moz-cite-prefix">Em 06/04/2013
                  14:05, Thiago V. dos Santos escreveu:<br>
                </div>
                <blockquote type="cite">
                  <div style="color: rgb(0, 0, 0); background-color:
                    rgb(255, 255, 255); font-family: 'times new roman',
                    'new york', times, serif; font-size: 12pt;">
                    <div><span>Alexandre,</span></div>
                    <div style="color: rgb(0, 0, 0); font-size: 16px;
                      font-family: 'times new roman', 'new york', times,
                      serif; background-color: transparent; font-style:
                      normal;"><span><br>
                      </span></div>
                    <div style="color: rgb(0, 0, 0); font-size: 16px;
                      font-family: 'times new roman', 'new york', times,
                      serif; background-color: transparent; font-style:
                      normal;"><span style="
                        font-size:12pt;"><span style="font-size:12pt;">O
                          .shp é só uma parte do dado, a geometria. </span>Para
                        reproduzir o seu problema, vou precisar também
                        do .dbf e do .shx, além do .prj se ele já
                        estiver projetado.</span></div>
                    <div style="color: rgb(0, 0, 0); font-size: 12pt;
                      font-family: 'times new roman', 'new york', times,
                      serif; background-color: transparent; font-style:
                      normal;"><span style="
                        font-size:12pt;"> </span><br>
                    </div>
                    <div>Saudações,<br>
                      --<br>
                      Thiago V. dos Santos<br>
                      PhD student<br>
                      Land and Atmospheric Science<br>
                      University of Minnesota<br>
                      <a moz-do-not-send="true" rel="nofollow"
                        class="yiv1497405944moz-txt-link-freetext"
                        target="_blank"
href="http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/index.htm">http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/index.htm</a><br>
                      Phone: (612) 323 9898<br>
                    </div>
                    <div style="font-family: 'times new roman', 'new
                      york', times, serif; font-size: 12pt;">
                      <div style="font-family: 'times new roman', 'new
                        york', times, serif; font-size: 12pt;">
                        <div dir="ltr"> <font size="2" face="Arial">
                            <hr size="1"> <b><span
                                style="font-weight:bold;">From:</span></b>
                            ASANTOS <a moz-do-not-send="true"
                              rel="nofollow"
                              class="yiv1497405944moz-txt-link-rfc2396E"
ymailto="mailto:alexandresantosbr@yahoo.com.br" target="_blank"
                              href="mailto:alexandresantosbr@yahoo.com.br"><alexandresantosbr@yahoo.com.br></a><br>
                            <b><span style="font-weight:bold;">To:</span></b>
                            <a moz-do-not-send="true" rel="nofollow"
                              class="yiv1497405944moz-txt-link-abbreviated"
                              ymailto="mailto:r-br@listas.c3sl.ufpr.br"
                              target="_blank"
                              href="mailto:r-br@listas.c3sl.ufpr.br">r-br@listas.c3sl.ufpr.br</a>
                            <br>
                            <b><span style="font-weight:bold;">Sent:</span></b>
                            Saturday, April 6, 2013 11:32 AM<br>
                            <b><span style="font-weight:bold;">Subject:</span></b>
                            Re: [R-br] Criando uma mascara com shapefile
                            sobre raster<br>
                          </font> </div>
                        <br>
                        <div id="yiv1497405944">
                          <div> Obrigado pela atenção Thiago,<br>
                            <br>
                               Tentei fazer um CRM, mas com raster
                            estava difícil, coloquei no dropbox mesmo,
                            segue a ultima tentativa que fiz com suas
                            dicas:<br>
                            <br>
                            #<br>
                            require(raster)<br>
                            <br>
                            #Dados<br>
                            <a moz-do-not-send="true" rel="nofollow"
                              class="yiv1497405944moz-txt-link-freetext"
                              target="_blank"
href="https://www.dropbox.com/s/lzj71k9vt6dbou1/LANDSAT_5_TM_20100506_217_074_L2_BAND7.tif#Raster">https://www.dropbox.com/s/lzj71k9vt6dbou1/LANDSAT_5_TM_20100506_217_074_L2_BAND7.tif#Raster</a>
                            in tiff<br>
                            <a moz-do-not-send="true" rel="nofollow"
                              class="yiv1497405944moz-txt-link-freetext"
                              target="_blank"
href="https://www.dropbox.com/s/bfcwpbw36gdlwjq/Catas_Altas.shp#contorno">https://www.dropbox.com/s/bfcwpbw36gdlwjq/Catas_Altas.shp#contorno</a>
                            em shapefile<br>
                            #<br>
                            land.img<-
                            stack(c("LANDSAT_5_TM_20100506_217_074_L2_BAND7.tif"))
                            ## Imagem Landsat 5<br>
                            plotRGB(land.img,1) #Plota a banda 7 da
                            imagem<br>
                            <br>
                            #Poligono de interesse em shapefile comm
                            coordenadas em UTM<br>
                            contorno<-
                            readShapeLines("Catas_Altas.shp",
                            proj4string=CRS("+proj=utm +zone=23 +south
                            +datum=WGS84 +units=m +no_defs"))<br>
                            #<br>
                            #Quero selecionar os pixels da imagem que
                            estão contidos no interior do polígono
                            contorno<br>
                            A.crop <- crop(land.img,
                            extent(contorno), snap='out')<br>
                            contorno.na<-setValues(A.crop, NA)<br>
                            contorno.r<-rasterize(contorno,
                            contorno.na) <br>
                            C <- mask(x=A.crop, mask=contorno.r)<br>
                            #<br>
                            <br>
                            <br>
                            <div class="yiv1497405944moz-cite-prefix">Em
                              05/04/2013 09:18, Thiago V. dos Santos
                              escreveu:<br>
                            </div>
                            <blockquote type="cite">
                              <div style="color: rgb(0, 0, 0);
                                background-color: rgb(255, 255, 255);
                                font-family: 'times new roman', 'new
                                york', times, serif; font-size: 12pt;">
                                <div><span>Mas você recebe algum erro ou
                                    o resultado é diferente do esperado?</span></div>
                                <div style="color: rgb(0, 0, 0);
                                  font-size: 16px; font-family: 'times
                                  new roman', 'new york', times, serif;
                                  background-color: transparent;
                                  font-style: normal;"><span><br>
                                  </span></div>
                                <div style="color: rgb(0, 0, 0);
                                  font-size: 16px; font-family: 'times
                                  new roman', 'new york', times, serif;
                                  background-color: transparent;
                                  font-style: normal;"><span>O melhor
                                    mesmo seria fornecer seus dados para
                                    tentarmos reproduzir o problema. Não
                                    dá pra colocar no dropbox? 50Mb não
                                    é nada tão grande assim...</span></div>
                                <div> </div>
                                <div>Saudações,<br>
                                  --<br>
                                  Thiago V. dos Santos<br>
                                  PhD student<br>
                                  Land and Atmospheric Science<br>
                                  University of Minnesota<br>
                                  <a moz-do-not-send="true"
                                    rel="nofollow"
                                    class="yiv1497405944moz-txt-link-freetext"
                                    target="_blank"
href="http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/index.htm">http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/index.htm</a><br>
                                  Phone: (612) 323 9898<br>
                                </div>
                                <div style="font-family:'times new
                                  roman', 'new york', times,
                                  serif;font-size:12pt;">
                                  <div style="font-family:'times new
                                    roman', 'new york', times,
                                    serif;font-size:12pt;">
                                    <div dir="ltr"> <font size="2"
                                        face="Arial">
                                        <hr size="1"> <b><span
                                            style="font-weight:bold;">From:</span></b>
                                        ASANTOS <a
                                          moz-do-not-send="true"
                                          rel="nofollow"
                                          class="yiv1497405944moz-txt-link-rfc2396E"
ymailto="mailto:alexandresantosbr@yahoo.com.br" target="_blank"
                                          href="mailto:alexandresantosbr@yahoo.com.br"><alexandresantosbr@yahoo.com.br></a><br>
                                        <b><span
                                            style="font-weight:bold;">To:</span></b>
                                        <a moz-do-not-send="true"
                                          rel="nofollow"
                                          class="yiv1497405944moz-txt-link-abbreviated"
ymailto="mailto:r-br@listas.c3sl.ufpr.br" target="_blank"
                                          href="mailto:r-br@listas.c3sl.ufpr.br">r-br@listas.c3sl.ufpr.br</a>;
                                        Thiago V. dos Santos <a
                                          moz-do-not-send="true"
                                          rel="nofollow"
                                          class="yiv1497405944moz-txt-link-rfc2396E"
ymailto="mailto:thi_veloso@yahoo.com.br" target="_blank"
                                          href="mailto:thi_veloso@yahoo.com.br"><thi_veloso@yahoo.com.br></a>
                                        <br>
                                        <b><span
                                            style="font-weight:bold;">Sent:</span></b>
                                        Thursday, April 4, 2013 9:23 PM<br>
                                        <b><span
                                            style="font-weight:bold;">Subject:</span></b>
                                        Re: [R-br] Criando uma mascara
                                        com shapefile sobre raster<br>
                                      </font> </div>
                                    <br>
                                    Thiago,<br>
                                    <br>
                                          Explicando melhor
                                    teoricamente, pois um CRM implicaria
                                    em uma <br>
                                    imagem de 50MB, tenho:<br>
                                    <br>
                                    1) Uma imagem do landsat 5 com um
                                    quadrante de interesse;<br>
                                    2)Um contorno em shapefile de uma
                                    área de 200 hectares.<br>
                                    <br>
                                        Quero utilizar apenas os pixels
                                    da imagem contidos no interior da <br>
                                    área de 200 hectares, para tanto
                                    extend() não resolve pois utiliza <br>
                                    apenas utiliza coordenadas max e min
                                    e não considera a forma (contorno) <br>
                                    do meu polígono para seleção dos
                                    pixels contidos nele.<br>
                                    <br>
                                        Não consegui realizar o que
                                    desejo com a rotina sugerida.
                                    Mascara, <br>
                                    usei como um termo que implica em
                                    área útil da imagem, não quero o <br>
                                    quadrante todo oferecido pela
                                    imagem, mas aquilo que esta contido
                                    no meu <br>
                                    shapefile.<br>
                                    <br>
                                    Obrigado pela atenção,<br>
                                    <br>
                                    Alexandre<br>
                                    <br>
                                    <br>
                                    <br>
                                    Em 04/04/2013 21:03, Thiago V. dos
                                    Santos escreveu:<br>
                                    > Alexandre,<br>
                                    ><br>
                                    > O que a área do raster tem a
                                    ver com o tipo de função usada para
                                    carregar o shapefile?<br>
                                    ><br>
                                    > Você não consegui recortar o
                                    raster com o shapefile usando os
                                    comandos que eu eu sugeri? O que
                                    exatamente você quis dizer com criar
                                    uma máscara na pergunta inicial?<br>
                                    ><br>
                                    > Saudações,<br>
                                    > --<br>
                                    > Thiago V. dos Santos<br>
                                    > PhD student<br>
                                    > Land and Atmospheric Science<br>
                                    > University of Minnesota<br>
                                    > <a moz-do-not-send="true"
                                      rel="nofollow" target="_blank"
href="http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/index.htm">http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/index.htm</a><br>
                                    > Phone: (612) 323 9898<br>
                                    ><br>
                                    ><br>
                                    > ----- Original Message -----<br>
                                    > From: ASANTOS <<a
                                      moz-do-not-send="true"
                                      rel="nofollow"
                                      ymailto="mailto:alexandresantosbr@yahoo.com.br"
                                      target="_blank"
                                      href="mailto:alexandresantosbr@yahoo.com.br">alexandresantosbr@yahoo.com.br</a>><br>
                                    > To: <a moz-do-not-send="true"
                                      rel="nofollow"
                                      ymailto="mailto:r-br@listas.c3sl.ufpr.br"
                                      target="_blank"
                                      href="mailto:r-br@listas.c3sl.ufpr.br">r-br@listas.c3sl.ufpr.br</a><br>
                                    > Cc:<br>
                                    > Sent: Thursday, April 4, 2013
                                    5:14 PM<br>
                                    > Subject: Re: [R-br] Criando uma
                                    mascara com shapefile sobre raster<br>
                                    ><br>
                                    > Thiago,<br>
                                    ><br>
                                    >            Não deu certo não,
                                    transformei em<br>
                                    >
                                    SpatialPolygons(list(Polygons(list(Polygon(contorno2)),"contorno2"))),<br>
                                    > prefiro continuar tentando com
                                    readShapeLines("Catas_Altas.shp",<br>
                                    > proj4string=CRS("+proj=utm
                                    +zone=23 +south +datum=WGS84
                                    +units=m<br>
                                    > +no_defs")), porque consigo
                                    visualizar a área sobre o raster,
                                    achei<br>
                                    > alguns posts mais usando o
                                    GRASS, mas gostaria de fazer tudo só
                                    no R.<br>
                                    ><br>
                                    > Obrigado,<br>
                                    ><br>
                                    > Alexandre<br>
                                    ><br>
                                    ><br>
                                    > Em 04/04/2013 12:18, Thiago V.
                                    dos Santos escreveu:<br>
                                    >> Alexandre,<br>
                                    >><br>
                                    >> a) Tente ler o seu
                                    shapefile com a funcao
                                    readShapePoly.<br>
                                    >><br>
                                    >> b) Se nao der certo, sugiro
                                    uma combinacao das funcoes crop e
                                    raster. Nesse caso, experimente
                                    rodar o seu codigo com as seguintes
                                    mudancas:<br>
                                    >><br>
                                    >> require("raster")<br>
                                    >> A <-
                                    stack("LANDSAT_5_TM_20100506_217_074_L2_BAND7.tif")<br>
                                    >> contorno<-
                                    readShapePoly("Catas_Altas.shp")<br>
                                    >><br>
                                    >> A.crop <- crop(A,
                                    extent(contorno), snap='out')<br>
                                    >><br>
                                    >>
                                    contorno.na<-setValues(A.crop,
                                    NA)<br>
                                    >>
                                    contorno.r<-rasterize(contorno,
                                    contorno.na) ### isso pode demorar,
                                    dependendo do seu shapefile<br>
                                    >> C <- mask(x=A.crop,
                                    mask=contorno.r)<br>
                                    >><br>
                                    >><br>
                                    >> Saudações,<br>
                                    >><br>
                                    >> --<br>
                                    >> Thiago V. dos Santos<br>
                                    >> PhD student<br>
                                    >> Land and Atmospheric
                                    Science<br>
                                    >> University of Minnesota<br>
                                    >> <a moz-do-not-send="true"
                                      rel="nofollow" target="_blank"
href="http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/index.htm">http://www.laas.umn.edu/CurrentStudents/MeettheStudents/ThiagodosSantos/index.htm</a><br>
                                    >> Phone: (612) 323 9898<br>
                                    >><br>
                                    >><br>
                                    >> ----- Original Message
                                    -----<br>
                                    >> From: ASANTOS<<a
                                      moz-do-not-send="true"
                                      rel="nofollow"
                                      ymailto="mailto:alexandresantosbr@yahoo.com.br"
                                      target="_blank"
                                      href="mailto:alexandresantosbr@yahoo.com.br">alexandresantosbr@yahoo.com.br</a>><br>
                                    >> To:<a
                                      moz-do-not-send="true"
                                      rel="nofollow"
                                      ymailto="mailto:r-br@listas.c3sl.ufpr.br"
                                      target="_blank"
                                      href="mailto:r-br@listas.c3sl.ufpr.br">r-br@listas.c3sl.ufpr.br</a><br>
                                    >> Cc:<br>
                                    >> Sent: Thursday, April 4,
                                    2013 10:31 AM<br>
                                    >> Subject: [R-br] Criando uma
                                    mascara com shapefile sobre raster<br>
                                    >><br>
                                    >> Boa tarde pessoal,<br>
                                    >><br>
                                    >>            Estou com um
                                    problema e não consigo criar uma
                                    mascara com um arquivo no formato
                                    shapefile sobre raster usando a
                                    função crop() do pacote raster, por
                                    algum motivo meu objeto contorno que
                                    é um SpatialLinesDataFrame não esta
                                    servido para oferecer o polígono
                                    limítrofe da área, alguém poderia me
                                    dar um help, segue CRM:<br>
                                    >><br>
                                    >> require("raster")<br>
                                    >> A <-
                                    stack(c("LANDSAT_5_TM_20100506_217_074_L2_BAND7.tif"))##
                                    Imagem<br>
                                    >> plotRGB(A) ## Plota a
                                    imagem<br>
                                    >> contorno<-
                                    readShapeLines("Catas_Altas.shp") 
                                    ## Contorno da área<br>
                                    >> lines(contorno,
                                    col="red")Plota o contorno<br>
                                    >> C <- crop(A,contorno) ##
                                    Recorta o que esta contido no
                                    contorno na imagem<br>
                                    >> Erro em .local(x, y, ...) :<br>
                                    >>      nenhum slot de nome
                                    "legend" para esse objeto de classe
                                    "RasterStack"<br>
                                    >><br>
                                    >><br>
                                    >> --
                                    ======================================================================<br>
                                    >> Alexandre dos Santos<br>
                                    >> Proteção Florestal<br>
                                    >> Coordenador do curso
                                    Técnico em Florestas<br>
                                    >> Vice Coordenador do curso
                                    de Engenharia Florestal<br>
                                    >> IFMT - Instituto Federal de
                                    Educação, Ciência e Tecnologia de
                                    Mato Grosso<br>
                                    >> Campus Cáceres<br>
                                    >> Caixa Postal 244<br>
                                    >> Avenida dos Ramires, s/n<br>
                                    >> Bairro: Distrito Industrial<br>
                                    >> Cáceres - MT               
                                          CEP: 78.200-000<br>
                                    >> Fone: (+55) 65 8132-8112
                                    (TIM)  (+55) 65 9686-6970 (VIVO)<br>
                                    >> e-mails:<a
                                      moz-do-not-send="true"
                                      rel="nofollow"
                                      ymailto="mailto:alexandresantosbr@yahoo.com.br"
                                      target="_blank"
                                      href="mailto:alexandresantosbr@yahoo.com.br">alexandresantosbr@yahoo.com.br</a><br>
                                    >>            <a
                                      moz-do-not-send="true"
                                      rel="nofollow"
                                      ymailto="mailto:alexandre.santos@cas.ifmt.edu.br"
                                      target="_blank"
                                      href="mailto:alexandre.santos@cas.ifmt.edu.br">alexandre.santos@cas.ifmt.edu.br</a><br>
                                    >>
                                    ======================================================================<br>
                                    >><br>
                                    >>
                                    _______________________________________________<br>
                                    >> R-br mailing list<br>
                                    >> <a moz-do-not-send="true"
                                      rel="nofollow"
                                      ymailto="mailto:R-br@listas.c3sl.ufpr.br"
                                      target="_blank"
                                      href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br>
                                    >> <a moz-do-not-send="true"
                                      rel="nofollow" target="_blank"
                                      href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>
                                    >> Leia o guia de postagem (<a
                                      moz-do-not-send="true"
                                      rel="nofollow" target="_blank"
                                      href="http://www.leg.ufpr.br/r-br-guia">http://www.leg.ufpr.br/r-br-guia</a>)
                                    e forneça código mínimo
                                    reproduzível.<br>
                                    >><br>
                                    >><br>
                                    <br>
                                    -- <br>
======================================================================<br>
                                    Alexandre dos Santos<br>
                                    Proteção Florestal<br>
                                    Coordenador do curso Técnico em
                                    Florestas<br>
                                    Vice Coordenador do curso de
                                    Engenharia Florestal<br>
                                    IFMT - Instituto Federal de
                                    Educação, Ciência e Tecnologia de
                                    Mato Grosso<br>
                                    Campus Cáceres<br>
                                    Caixa Postal 244<br>
                                    Avenida dos Ramires, s/n<br>
                                    Bairro: Distrito Industrial<br>
                                    Cáceres - MT                     
                                    CEP: 78.200-000<br>
                                    Fone: (+55) 65 8132-8112 (TIM) 
                                    (+55) 65 9686-6970 (VIVO)<br>
                                    e-mails:<a moz-do-not-send="true"
                                      rel="nofollow"
                                      ymailto="mailto:alexandresantosbr@yahoo.com.br"
                                      target="_blank"
                                      href="mailto:alexandresantosbr@yahoo.com.br">alexandresantosbr@yahoo.com.br</a><br>
                                            <a moz-do-not-send="true"
                                      rel="nofollow"
                                      ymailto="mailto:alexandre.santos@cas.ifmt.edu.br"
                                      target="_blank"
                                      href="mailto:alexandre.santos@cas.ifmt.edu.br">alexandre.santos@cas.ifmt.edu.br</a><br>
======================================================================<br>
                                    <br>
                                    <br>
                                    <br>
                                  </div>
                                </div>
                              </div>
                            </blockquote>
                            <br>
                            <pre class="yiv1497405944moz-signature">-- 
======================================================================
Alexandre dos Santos
Proteção Florestal
Coordenador do curso Técnico em Florestas
Vice Coordenador do curso de Engenharia Florestal 
IFMT - Instituto Federal de Educação, Ciência e Tecnologia de Mato Grosso
Campus Cáceres
Caixa Postal 244
Avenida dos Ramires, s/n
Bairro: Distrito Industrial 
Cáceres - MT                      CEP: 78.200-000
Fone: (+55) 65 8132-8112 (TIM)   (+55) 65 9686-6970 (VIVO)
<a moz-do-not-send="true" rel="nofollow" class="yiv1497405944moz-txt-link-abbreviated" ymailto="mailto:e-mails:alexandresantosbr@yahoo.com.br" target="_blank" href="mailto:e-mails:alexandresantosbr@yahoo.com.br">e-mails:alexandresantosbr@yahoo.com.br</a> 
        <a moz-do-not-send="true" rel="nofollow" class="yiv1497405944moz-txt-link-abbreviated" ymailto="mailto:alexandre.santos@cas.ifmt.edu.br" target="_blank" href="mailto:alexandre.santos@cas.ifmt.edu.br">alexandre.santos@cas.ifmt.edu.br</a>                    
======================================================================
</pre>
                          </div>
                        </div>
                        <br>
                        _______________________________________________<br>
                        R-br mailing list<br>
                        <a moz-do-not-send="true" rel="nofollow"
                          ymailto="mailto:R-br@listas.c3sl.ufpr.br"
                          target="_blank"
                          href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br>
                        <a moz-do-not-send="true" rel="nofollow"
                          target="_blank"
                          href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>
                        Leia o guia de postagem (<a
                          moz-do-not-send="true" rel="nofollow"
                          target="_blank"
                          href="http://www.leg.ufpr.br/r-br-guia">http://www.leg.ufpr.br/r-br-guia</a>)
                        e forneça código mínimo reproduzível.<br>
                        <br>
                      </div>
                    </div>
                  </div>
                  <br>
                  <fieldset class="yiv1497405944mimeAttachmentHeader"></fieldset>
                  <br>
                  <pre>_______________________________________________
R-br mailing list
<a moz-do-not-send="true" rel="nofollow" class="yiv1497405944moz-txt-link-abbreviated" ymailto="mailto:R-br@listas.c3sl.ufpr.br" target="_blank" href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a>
<a moz-do-not-send="true" rel="nofollow" class="yiv1497405944moz-txt-link-freetext" target="_blank" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a>
Leia o guia de postagem (<a moz-do-not-send="true" rel="nofollow" class="yiv1497405944moz-txt-link-freetext" target="_blank" href="http://www.leg.ufpr.br/r-br-guia">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.</pre>
                </blockquote>
                <br>
                <pre class="yiv1497405944moz-signature">-- 
======================================================================
Alexandre dos Santos
Proteção Florestal
Coordenador do curso Técnico em Florestas
Vice Coordenador do curso de Engenharia Florestal 
IFMT - Instituto Federal de Educação, Ciência e Tecnologia de Mato Grosso
Campus Cáceres
Caixa Postal 244
Avenida dos Ramires, s/n
Bairro: Distrito Industrial 
Cáceres - MT                      CEP: 78.200-000
Fone: (+55) 65 8132-8112 (TIM)   (+55) 65 9686-6970 (VIVO)
<a moz-do-not-send="true" rel="nofollow" class="yiv1497405944moz-txt-link-abbreviated" ymailto="mailto:e-mails:alexandresantosbr@yahoo.com.br" target="_blank" href="mailto:e-mails:alexandresantosbr@yahoo.com.br">e-mails:alexandresantosbr@yahoo.com.br</a> 
        <a moz-do-not-send="true" rel="nofollow" class="yiv1497405944moz-txt-link-abbreviated" ymailto="mailto:alexandre.santos@cas.ifmt.edu.br" target="_blank" href="mailto:alexandre.santos@cas.ifmt.edu.br">alexandre.santos@cas.ifmt.edu.br</a>                    
======================================================================
</pre>
              </div>
            </div>
            <br>
            <br>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
======================================================================
Alexandre dos Santos
Proteção Florestal
Coordenador do curso Técnico em Florestas
Vice Coordenador do curso de Engenharia Florestal 
IFMT - Instituto Federal de Educação, Ciência e Tecnologia de Mato Grosso
Campus Cáceres
Caixa Postal 244
Avenida dos Ramires, s/n
Bairro: Distrito Industrial 
Cáceres - MT                      CEP: 78.200-000
Fone: (+55) 65 8132-8112 (TIM)   (+55) 65 9686-6970 (VIVO)
<a class="moz-txt-link-abbreviated" href="mailto:e-mails:alexandresantosbr@yahoo.com.br">e-mails:alexandresantosbr@yahoo.com.br</a> 
        <a class="moz-txt-link-abbreviated" href="mailto:alexandre.santos@cas.ifmt.edu.br">alexandre.santos@cas.ifmt.edu.br</a>                    
======================================================================
</pre>
  </body>
</html>