<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Caros Pedro e Alexandre,<br>
    Excelentes sugestões!<br>
    Muito obrigado,<br>
    Abraço,<br>
    PauloFR<br>
    <br>
    <div class="moz-cite-prefix">Às 11:18 de 15-03-2016, Pedro Venâncio
      escreveu:<br>
    </div>
    <blockquote
cite="mid:CAMCJChsBYrJTpve9cEPa13tXfjTceJr1WOkgT205Qpx3mTfK6w@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>Olá Paulo,<br>
                    <br>
                  </div>
                  Isso não só está disponível no QGIS, como existem, no
                  QGIS, diversas formas de o fazer.<br>
                  <br>
                </div>
                Deixo-lhe, como exemplo, alguns dos exercícios do
                workshop que eu ministrei no 2.º Encontro de
                Utilizadores QGIS, em Coimbra: <a
                  moz-do-not-send="true"
                  href="http://qgis.pt/workshops_qgis2014/ws_processing_qgis_day_2014.pdf"><a class="moz-txt-link-freetext" href="http://qgis.pt/workshops_qgis2014/ws_processing_qgis_day_2014.pdf">http://qgis.pt/workshops_qgis2014/ws_processing_qgis_day_2014.pdf</a></a><br>
              </div>
              Veja os exemplos nos diapositivos: 70-75; 100-102;
              106-108.<br>
              <br>
            </div>
            Pode fazer-se exatamente o mesmo, recorrendo ao Field
            Calculator. Um exemplo pequeno feito aqui com a COS2007.
            Basta no Field Calculator colocar a expressão:<br>
            <br>
            CASE <br>
                WHEN "CLASSE_NI3" = 'Vinha' THEN 221011<br>
                WHEN "CLASSE_NI3" = 'Olivais' THEN 223011<br>
                WHEN "CLASSE_NI3" = 'Indústria' THEN 121011<br>
                ELSE 999999<br>
            END<br>
            <br>
          </div>
          <div>sendo CLASSE_NI3 a coluna que contém a descrição da
            ocupação (neste caso, 3 exemplos do nível 3 da COS 2007).<br>
          </div>
          <div><br>
          </div>
          <div>Depois é só fazer a transformação de vetor para raster,
            como também é explicado no workshop que coloquei em cima.<br>
          </div>
          <div><br>
          </div>
          Cumprimentos,<br>
        </div>
        Pedro Venâncio<br>
        <div>
          <div><br>
            <br>
            <div><br>
            </div>
          </div>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">No dia 15 de março de 2016 às 10:17,
          Paulo Flores Ribeiro <span dir="ltr"><<a
              moz-do-not-send="true"
              href="mailto:paulo.flores.mail@gmail.com" target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:paulo.flores.mail@gmail.com">paulo.flores.mail@gmail.com</a></a>></span>
          escreveu:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000"> Caro José Aranha,<br>
              Obrigado pela resposta. A solução que propõe também me
              parece a melhor. Fico um pouco surpreendido por não ser
              possível fazer isto totalmente dentro do QGIS, por exemplo
              através de uma função dentro da "calculadora de campos"
              que criasse um novo campo numérico cujos valores fizessem
              uma correspondência com as categorias de um campo de
              string pré existente. Talvez seja uma sugestão para os
              developers do QGIS, a quem aproveito para agradecer o
              excelente trabalho que têm feito.<br>
              Abraço,<br>
              PauloFR
              <div>
                <div class="h5"><br>
                  <br>
                  Às 16:38 de 14-03-2016, Jose Aranha escreveu:<br>
                  <blockquote type="cite">
                    <div dir="ltr"><span style="font-size:12.8px">Boa
                        tarde</span>
                      <div style="font-size:12.8px"><br>
                      </div>
                      <div style="font-size:12.8px">Penso que a solução
                        do seu problema passa por criar uma tabela com a
                        legenda referente à ocupação solo e com um
                        código relativo a essa legenda.</div>
                      <div style="font-size:12.8px">Por exemplo</div>
                      <div style="font-size:12.8px"><br>
                      </div>
                      <div style="font-size:12.8px">1 - Criar uma tabela
                        USO_CODE.DBF</div>
                      <div style="font-size:12.8px"><br>
                      </div>
                      <div style="font-size:12.8px">2- Criar os campos
                        USO_SOLO e CODE_USO</div>
                      <div style="font-size:12.8px"><br>
                      </div>
                      <div style="font-size:12.8px">3- Preencher a
                        tabela</div>
                      <div style="font-size:12.8px"><br>
                      </div>
                      <div style="font-size:12.8px">USO_SOLO            
                                      CODE_USO</div>
                      <div style="font-size:12.8px">Floresta de
                        resinosas               312</div>
                      <div style="font-size:12.8px">Urbano continuo    
                                          111</div>
                      <div style="font-size:12.8px"><br>
                      </div>
                      <div style="font-size:12.8px">4 - Na tabela de
                        atributos da sua shapefile cria um novo campo
                        designado por CODE_USO</div>
                      <div style="font-size:12.8px"><br>
                      </div>
                      <div style="font-size:12.8px">5 - Faz a ligação
                        (JOIN) entre a tabela de atributos da sua
                        shapefile e a tabela USO_CODE, usando o campo
                        USO_SOLO como elemento de ligação entre as duas
                        tabelas.</div>
                      <div style="font-size:12.8px"><br>
                      </div>
                      <div style="font-size:12.8px">6 - Depois de
                        estabelecida a ligação, preenche o campo
                        CODE_USO da sua tabela dizendo que é igual ao
                        campo CODE_USO da tabela que criou no ponto 1</div>
                      <div style="font-size:12.8px"><br>
                      </div>
                      <div style="font-size:12.8px">7- Depois de
                        preenchidos todos os registos, remove o JOIN e
                        grava a edição</div>
                      <div style="font-size:12.8px"><br>
                      </div>
                      <div style="font-size:12.8px">8 - Manda
                        transformar a shapefile numa raster file usando
                        o campo CODE_USO como campo guia.</div>
                      <div style="font-size:12.8px"><br>
                      </div>
                      <div style="font-size:12.8px">Espero que seja esta
                        a solução do seu problema.</div>
                      <div style="font-size:12.8px"><br>
                      </div>
                      <div style="font-size:12.8px">Cumprimentos</div>
                      <div style="font-size:12.8px"><br>
                      </div>
                      <div style="font-size:12.8px">José Aranha.</div>
                      <div style="font-size:12.8px"><br>
                      </div>
                      <div style="font-size:12.8px"> </div>
                    </div>
                    <div class="gmail_extra"><br>
                      <div class="gmail_quote">No dia 14 de março de
                        2016 às 16:31, Jose Aranha <span dir="ltr"><<a
                            moz-do-not-send="true"
                            href="mailto:j.aranha.utad@gmail.com"
                            target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:j.aranha.utad@gmail.com">j.aranha.utad@gmail.com</a></a>></span>
                        escreveu:<br>
                        <blockquote class="gmail_quote" style="margin:0
                          0 0 .8ex;border-left:1px #ccc
                          solid;padding-left:1ex">
                          <div dir="ltr">Boa tarde
                            <div><br>
                            </div>
                            <div>Penso que a solução do seu problema
                              passa por criar uma tabela com a legenda
                              referente à ocupação solo e com um código
                              relativo a essa legenda.</div>
                            <div>Por exemplo</div>
                            <div>USO_SOLO</div>
                          </div>
                          <div class="gmail_extra">
                            <div>
                              <div><br>
                                <div class="gmail_quote">No dia 14 de
                                  março de 2016 às 16:07, Paulo Flores
                                  Ribeiro <span dir="ltr"><<a
                                      moz-do-not-send="true"
                                      href="mailto:paulo.flores.mail@gmail.com"
                                      target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:paulo.flores.mail@gmail.com">paulo.flores.mail@gmail.com</a></a>></span>
                                  escreveu:<br>
                                  <blockquote class="gmail_quote"
                                    style="margin:0 0 0
                                    .8ex;border-left:1px #ccc
                                    solid;padding-left:1ex">
                                    <div bgcolor="#FFFFFF"
                                      text="#000000"> Olá Gilberto,<br>
                                      Obrigado pelo seu interesse. <br>
                                      A minha ideia é a seguinte:
                                      imagine que temos um shapefile com
                                      100 polígonos, representando as
                                      classes de uso do solo de uma
                                      região. As classes possíveis são
                                      20, por exemplo (ou seja, "matos",
                                      "floresta de produção", "floresta
                                      natural", "áreas urbanas", "áreas
                                      agrícolas de regadio", "áreas de
                                      pastagens", etc. etc.). Como são
                                      20 classes e temos 100 polígonos,
                                      cada classe aparece repetida
                                      várias vezes (por exemplo, há
                                      vários polígonos com "floresta
                                      natural", outros com "áreas
                                      urbanas", etc.). Eu gostava de
                                      passar este shapefile para raster,
                                      mantendo a mesma legenda das 20
                                      classes de uso do solo. O meu
                                      problema é que a minha variável de
                                      interesse (usos do solo) é
                                      categórica (ou nominal) e não é
                                      numérica, pelo que a passagem para
                                      raster tem de ser feita começando
                                      por atribuir códigos numéricos às
                                      20 classes, criando um campo novo
                                      no shapefile, que depois será
                                      então utilizado para converter
                                      para raster.<br>
                                      Eu creio que posso fazer isto com
                                      ajuda do Excel, mas gostava de
                                      saber se há um modo mais expedito
                                      de o fazer, totalmente dentro do
                                      QGIS.<br>
                                      Consegui explicar bem?<br>
                                      Abraço,<br>
                                      Paulo<br>
                                      P.S.: Estou a usar o QGIS 2.14.0
                                      (64bit) no Windows 10
                                      <div>
                                        <div><br>
                                          <br>
                                          <div>Às 11:17 de 14-03-2016,
                                            Gilberto Cugler escreveu:<br>
                                          </div>
                                          <blockquote type="cite">
                                            <div dir="ltr">
                                              <div class="gmail_default"
                                                style="font-family:comic
                                                sans
                                                ms,sans-serif;font-size:large;color:#674ea7">Quais

                                                os campos do seu shp?</div>
                                              <div class="gmail_default"
                                                style="font-family:comic
                                                sans
                                                ms,sans-serif;font-size:large;color:#674ea7">um

                                                abraço do Brasil</div>
                                            </div>
                                            <div class="gmail_extra"><br>
                                              <div class="gmail_quote">Em
                                                13 de março de 2016
                                                21:24, Paulo Flores
                                                Ribeiro <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:paulo.flores.mail@gmail.com"
                                                    target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:paulo.flores.mail@gmail.com">paulo.flores.mail@gmail.com</a></a>></span>
                                                escreveu:<br>
                                                <blockquote
                                                  class="gmail_quote"
                                                  style="margin:0 0 0
                                                  .8ex;border-left:1px
                                                  #ccc
                                                  solid;padding-left:1ex">Bom
                                                  dia,<br>
                                                  Quero fazer um raster
                                                  de usos do solo a
                                                  partir de um shape de
                                                  polígonos (por exemplo
                                                  um extracto do COS90).
                                                  Cada cor no raster
                                                  corresponderá a uma
                                                  categoria de uso do
                                                  solo. Como a variável
                                                  é categórica (i.e. não
                                                  numérica), não posso
                                                  usar o menu «Raster
                                                  > Conversão >
                                                  Rasterizar». Será
                                                  possível usar a
                                                  "Calculadora de
                                                  campos" do shape para
                                                  criar um campo
                                                  numérico onde cada
                                                  valor corresponda a
                                                  uma única categoria de
                                                  uso do solo definida
                                                  num campo de string
                                                  existente na tabela,
                                                  de modo a depois poder
                                                  ser usado para a
                                                  conversão para raster?
                                                  A minha ideia era
                                                  tentar fazer isto sem
                                                  precisar de ir ao
                                                  GRASS ou ao Excel...<br>
                                                  Obrigado,<br>
                                                  PauloFR<br>
_______________________________________________<br>
                                                  Portugal mailing list<br>
                                                  <a
                                                    moz-do-not-send="true"
href="mailto:Portugal@lists.osgeo.org" target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:Portugal@lists.osgeo.org">Portugal@lists.osgeo.org</a></a><br>
                                                  <a
                                                    moz-do-not-send="true"
href="http://lists.osgeo.org/mailman/listinfo/portugal" rel="noreferrer"
                                                    target="_blank"><a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/portugal">http://lists.osgeo.org/mailman/listinfo/portugal</a></a></blockquote>
                                              </div>
                                              <br>
                                              <br clear="all">
                                              <div><br>
                                              </div>
                                              -- <br>
                                              <div>
                                                <div dir="ltr">
                                                  <div><br>
                                                  </div>
                                                  <div><br>
                                                  </div>
                                                  <font size="4"><font
                                                      color="#999999">Gilberto

                                                      Cugler</font></font><span
style="color:rgb(153,153,153);font-size:large"> .´.</span></div>
                                              </div>
                                            </div>
                                            <br>
                                            <fieldset></fieldset>
                                            <br>
                                            <pre>_______________________________________________
Portugal mailing list
<a moz-do-not-send="true" href="mailto:Portugal@lists.osgeo.org" target="_blank">Portugal@lists.osgeo.org</a>
<a moz-do-not-send="true" href="http://lists.osgeo.org/mailman/listinfo/portugal" target="_blank">http://lists.osgeo.org/mailman/listinfo/portugal</a></pre>
                                          </blockquote>
                                          <br>
                                        </div>
                                      </div>
                                    </div>
                                    <br>
_______________________________________________<br>
                                    Portugal mailing list<br>
                                    <a moz-do-not-send="true"
                                      href="mailto:Portugal@lists.osgeo.org"
                                      target="_blank">Portugal@lists.osgeo.org</a><br>
                                    <a moz-do-not-send="true"
                                      href="http://lists.osgeo.org/mailman/listinfo/portugal"
                                      rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/portugal</a><br>
                                  </blockquote>
                                </div>
                                <br>
                                <br clear="all">
                                <div><br>
                                </div>
                                -- <br>
                              </div>
                            </div>
                            <div>
                              <div dir="ltr">
                                <div>
                                  <div dir="ltr"><span
                                      style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">............................................................</span>
                                    <div style="font-size:12.8px"><span
style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">Professor

                                        Associado com Agregação</span><br
style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">
                                      <span
                                        style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">PhD

                                        in GIS/RS (Kingston University -
                                        England)</span><br
                                        style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">
                                      <span
                                        style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">Eng.

                                        Florestal (UTAD)</span></div>
                                    <div style="font-size:12.8px">Investigador
                                      - CITAB - <a
                                        moz-do-not-send="true"
                                        href="http://www.citab.pt"
                                        target="_blank"><a class="moz-txt-link-abbreviated" href="http://www.citab.pt">www.citab.pt</a></a><br
style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">
                                      <br
                                        style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">
                                      <span
                                        style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">Diretor

                                        do Dept. de Ciências Florestais
                                        e Arquitetura Paisagista</span><br
style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">
                                      <span
                                        style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">Universidade

                                        de Trás-os-Montes e Alto Douro</span><br
style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">
                                      <span
                                        style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">Qt.

                                        de Prados</span><br
                                        style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">
                                      <span
                                        style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">5001-801

                                        Vila Real</span><br
                                        style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">
                                      <span
                                        style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">tel.

                                        <a moz-do-not-send="true"
                                          href="tel:259%20350%20856"
                                          value="+351259350856"
                                          target="_blank">259 350 856</a>
                                        - Telm. <a
                                          moz-do-not-send="true"
                                          href="tel:917%20503%20049"
                                          value="+351917503049"
                                          target="_blank">917 503 049</a></span><br
style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">
                                      <span
                                        style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">________________________________________</span></div>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </div>
                        </blockquote>
                      </div>
                      <br>
                      <br clear="all">
                      <div><br>
                      </div>
                      -- <br>
                      <div>
                        <div dir="ltr">
                          <div>
                            <div dir="ltr"><span
                                style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">............................................................</span>
                              <div style="font-size:12.8px"><span
                                  style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">Professor

                                  Associado com Agregação</span><br
                                  style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">
                                <span
                                  style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">PhD

                                  in GIS/RS (Kingston University -
                                  England)</span><br
                                  style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">
                                <span
                                  style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">Eng.

                                  Florestal (UTAD)</span></div>
                              <div style="font-size:12.8px">Investigador
                                - CITAB - <a moz-do-not-send="true"
                                  href="http://www.citab.pt"
                                  target="_blank">www.citab.pt</a><br
                                  style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">
                                <br
                                  style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">
                                <span
                                  style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">Diretor

                                  do Dept. de Ciências Florestais e
                                  Arquitetura Paisagista</span><br
                                  style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">
                                <span
                                  style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">Universidade

                                  de Trás-os-Montes e Alto Douro</span><br
style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">
                                <span
                                  style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">Qt.

                                  de Prados</span><br
                                  style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">
                                <span
                                  style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">5001-801

                                  Vila Real</span><br
                                  style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">
                                <span
                                  style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">tel.

                                  <a moz-do-not-send="true"
                                    href="tel:259%20350%20856"
                                    value="+351259350856"
                                    target="_blank">259 350 856</a> -
                                  Telm. <a moz-do-not-send="true"
                                    href="tel:917%20503%20049"
                                    value="+351917503049"
                                    target="_blank">917 503 049</a></span><br
style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">
                                <span
                                  style="color:rgb(0,0,0);font-family:monospace;font-size:12.675px">________________________________________</span></div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    <br>
                    <fieldset></fieldset>
                    <br>
                    <pre>_______________________________________________
Portugal mailing list
<a moz-do-not-send="true" href="mailto:Portugal@lists.osgeo.org" target="_blank">Portugal@lists.osgeo.org</a>
<a moz-do-not-send="true" href="http://lists.osgeo.org/mailman/listinfo/portugal" target="_blank">http://lists.osgeo.org/mailman/listinfo/portugal</a></pre>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            Portugal mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:Portugal@lists.osgeo.org">Portugal@lists.osgeo.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.osgeo.org/mailman/listinfo/portugal"
              rel="noreferrer" target="_blank">http://lists.osgeo.org/mailman/listinfo/portugal</a><br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Portugal mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Portugal@lists.osgeo.org">Portugal@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/portugal">http://lists.osgeo.org/mailman/listinfo/portugal</a></pre>
    </blockquote>
    <br>
  </body>
</html>