Importante

Translation is a community effort you can join. This page is currently translated at 51.45%.

16.2. Trabalhando com a tabela de atributos

A tabela de atributos exibe informações sobre as feições de uma camada selecionada. Cada linha da tabela representa uma feição (com ou sem geometria) e cada coluna contém uma informação específica sobre a feição. As feições da tabela podem ser pesquisadas, selecionadas, movidas ou mesmo editadas.

16.2.1. Prefácio: Tabelas espaciais e não espaciais

QGIS allows you to load spatial and non-spatial layers. This currently includes tables supported by GDAL and delimited text, as well as the PostgreSQL, MS SQL Server, SpatiaLite and Oracle providers. All loaded layers are listed in the Layers panel. Whether a layer is spatially enabled or not determines whether you can interact with it on the map.

As tabelas não espaciais podem ser navegadas e editadas usando a visualização da tabela de atributos. Além disso, eles podem ser usados ​​para pesquisas de campo. Por exemplo, você pode usar colunas de uma tabela não espacial para definir valores de atributos ou um intervalo de valores permitidos para serem adicionados a uma camada vetorial específica durante a digitalização. Dê uma olhada no widget de edição na seção Propriedades do formulário de atributos para descobrir mais.

16.2.2. Apresentando a Interface da Tabela de Atributos

Para abrir a tabela de atributos para uma camada vetorial, ative a camada clicando nela Painel Camadas. Em seguida, no menu principal: seleção de menus: menu Camada, escolha openTable :menuselection: Abrir tabela de atributos. Também é possível clicar com o botão direito do mouse na camada e escolher openTable Abrir Tabela de Atributo no menu suspenso ou clique em openTable :guilabel: botão Abrir tabela de atributos na barra de ferramentas Atributos. Se você preferir atalhos, F6 abrirá a tabela de atributos. Shift+F6 abrirá a tabela de atributos filtrada para os recursos selecionados e: kbd:Ctrl+F6 abrirá a tabela de atributos filtrados para os recursos visíveis.

Isso abrirá uma nova janela que exibe os atributos da feição para a camada (figure_attributes_table). De acordo com a configuração em :menuselection: menu Configurações –> Opções –> Fonte de dados, a tabela de atributos será aberta em uma janela encaixada ou em uma janela regular. O número total de feições na camada e o número de feições atualmente selecionados/filtrados são mostrados no título da tabela de atributos, bem como se a camada é espacialmente limitada.

../../../_images/vectorAttributeTable.png

Fig. 16.68 Tabela de atributos para a camada de regiões

Os botões na parte superior da janela da tabela de atributos fornecem a seguinte funcionalidade:

Tabela 16.1 Ferramentas Disponíveis

Ícone

Etiqueta

Finalidade

Atalho Padrão

toggleEditing

Alternar modo de edição

Habilitar funcionalidades de edição

Ctrl+E

multiEdit

Alternar modo multi edição

Atualize vários campos de várias feições

saveEdits

Salvar Edições

Salvar modificações atuais

refresh

Recarregar a tabela

newTableRow

Adicionar feição

Adicionar nova feição sem geometria

deleteSelectedFeatures

Excluir feições selecionadas

Remover feições selecionadas para a camada

editCut

Cortar feições selecionadas para área de transferência

Ctrl+X

copySelected

Copiar feições selecionadas para a área de transferência

Ctrl+C

editPaste

Colar feições da área de transferência

Inserir novas feições das copiadas

Ctrl+V

expressionSelect

Selecionar feições usando uma expressão

selectAll

Selecionar Todas

Selecionar todas feições em uma camada

Ctrl+A

invertSelection

Seleção invertida

Inverter a seleção atual na camada

Ctrl+R

deselectActiveLayer

Desselecionar todas

Desselecionar todas as feições na camada atual

Ctrl+Shift+A

filterMap

Filtrar/Selecionar feições usando formulário

Ctrl+F

selectedToTop

Mover selecionadas para o topo

Mover linhas selecionadas para o todo da tabela

panToSelected

Mapa panorâmico para selecionar linhas

Ctrl+P

zoomToSelected

Aproximar mapa para selecionar linhas

Ctrl+J

newAttribute

Novo campo

Adicionar um novo campo para uma fonte de dados

Ctrl+W

deleteAttribute

Excluir campo

Remover um campo a partir da fonte de dados

editTable

Organizar colunas

Mostrar/ocultar campos da tabela de atributos

calculateField

Abrir calculadora de campo

Atualização de campo para muitas feições em uma linha

Ctrl+I

conditionalFormatting

Formatação condicional

Ativar formatação de tabela

dock

Tabela de Atributos do Dock

Permite encaixar/desencaixar a tabela de atributos

actionRun

Ações

Listas de ações relatadas para uma camada

Nota

Depending on the format of the data and the GDAL library built with your QGIS version, some tools may not be available.

Abaixo desses botões está a barra Cálculo de campo rápido (ativada apenas em modo de edição), que permite aplicar rapidamente cálculos a todos ou parte das feições da camada. Esta barra usa o mesmo: ref:expressões<vector_expressions>`como o |calcula campo| :sup:`Calculadora de campo (consulte: ref:` calcule_campos_valores`).

16.2.2.1. Visualização da tabela versus visualização do formulário

O QGIS fornece dois modos de exibição para manipular facilmente os dados na tabela de atributos:

  • The openTable Table view, displays values of multiple features in a tabular mode, each row representing a feature and each column a field. A right-click on the column header allows you to configure the table display while a right-click on a cell provides interaction with the feature.

    The attribute table supports Shift+Mouse Wheel scrolling in table view mode to switch between vertical and horizontal scrolling movements. This can also be achieved replacing the mouse with the trackpad on macOS.

  • The formView Form view shows feature identifiers in a first panel and displays only the attributes of the clicked identifier in the second one. There is a pull-down menu at the top of the first panel where the “identifier” can be specified using an attribute (Column preview) or an Expression. The pull-down also includes the last 10 expressions for re-use. Form view uses the layer fields configuration (see Propriedades do formulário de atributos).

    Você pode navegar pelos identificadores de feições com as setas na parte inferior do primeiro painel. Os atributos de feições são atualizados no segundo painel conforme você avança. Também é possível identificar ou mover para a feição ativa o na tela do mapa pressionando qualquer botão na parte inferior:

    • highlightFeature Highlight current feature if visible in the map canvas

    • panTo Automatically pan to current feature

    • zoomTo Zoom para a feição atual

Você pode alternar de um modo para outro clicando no ícone correspondente no canto inferior direito da caixa de diálogo.

Você também pode especificar o modo :guilabel: Visualização padrão na abertura da tabela de atributos em :menuselection: menu Configurações -> Opções -> Fonte de Dados. Pode ser ‘Lembrar última visualização’, ‘Tabela’ ou ‘Formulário’.

../../../_images/attribute_table_views.png

Fig. 16.69 Tabela de atributos na exibição de tabela (superior) vs exibição de formulário (inferior)

16.2.2.2. Configurando as colunas

Right-click in a column header when in table view to have access to tools that help you control:

Redimensionando larguras de colunas

A largura das colunas pode ser definida através de um clique com o botão direito do mouse no cabeçalho da coluna e selecione:

  • Defina a largura… para inserir o valor desejado. Por padrão, o valor atual é exibido no widget

  • Definir todas as larguras de coluna… para o mesmo valor

  • Autodimensionar para redimensionar da melhor forma possível a coluna.

  • Auto dimensionar todas as colunas

O tamanho de uma coluna também pode ser alterado arrastando o limite à direita de seu título. O novo tamanho da coluna é mantido para a camada e restaurado na próxima abertura da tabela de atributos.

Ocultando e organizando colunas e permitindo ações

By right-clicking in a column header, you can choose to Hide column from the attribute table (in “table view” mode). For more advanced controls, press the editTable Organize columns… button from the dialog toolbar or choose Organize columns… in a column header contextual menu. In the new dialog, you can:

  • marcar/desmarcar as colunas que deseja mostrar ou ocultar: uma coluna oculta desaparecerá de todas as instâncias da caixa de diálogo da tabela de atributos até que seja restaurada ativamente.

  • arraste e solte itens para reordenar as colunas na tabela de atributos. Observe que essa alteração é para a renderização da tabela e não altera a ordem dos campos na fonte de dados da camada

  • add a new virtual Actions column that displays in each row a drop-down box or a button list of enabled actions. See Propriedades de Ações for more information about actions.

Sorting rows

The rows can be sorted by any column, by clicking on the column header. A small arrow indicates the sort order (downward pointing means descending values from the top row down, upward pointing means ascending values from the top row down). You can also choose to sort the rows with the Sort… option of the column header context menu and write an expression. E.g. to sort the rows using multiple columns you can write concat(col0, col1).

Na exibição de formulário, o identificador de feições pode ser classificado usando o sort :guilabel: opção Classificar por expressão de visualização.

Note that sorting the rows only affects the table rendering and does not alter the features order in the layer datasource.

Dica

Classificação com base em colunas de diferentes tipos

Trying to sort an attribute table based on columns of string and numeric types may lead to unexpected result because of the concat("USE", "ID") expression returning string values (ie, 'Borough105' < 'Borough6'). You can workaround this by using eg concat("USE", lpad("ID", 3, 0)) which returns 'Borough105' > 'Borough006'.

16.2.2.3. Formatação de células da tabela usando condições

As configurações de formatação condicional podem ser usadas para realçar nas feições da tabela de atributos nos quais você deseja enfatizar, usando condições personalizadas nas feições:

  • geometria (por exemplo, identificando características de várias partes, áreas pequenas ou em uma extensão de mapa definida …);

  • or field value (e.g., comparing values to a threshold, identifying empty cells, duplicates, …).

You can enable the conditional formatting panel clicking on conditionalFormatting Conditional formatting button at the top right of the attributes window in table view (not triggered in form view).

O novo painel permite que o usuário adicione novas regras para formatar a renderização de radioButtonOnCampo ou radioButtonOffLinha completa. Adicionar nova regra abre um formulário para definir:

  • o nome da regra;

  • uma condição usando qualquer uma das funções construtor de expressões;

  • a formatação: pode ser escolhida de uma lista de formatos predefinidos ou criada com base em propriedades como:

    • cores de fundo e texto;

    • uso de ícone;

    • negrito, itálico, sublinhado ou strikeout;

    • fonte.

../../../_images/attribute_table_conditional_formating.png

Fig. 16.70 Formatação condicional de uma tabela de atributo

16.2.3. Interagindo com feições em uma tabela de atributos

16.2.3.1. Selecionando características

Na exibição de tabela, cada linha da tabela de atributos exibe os atributos de um recurso exclusivo da camada. Selecionar uma linha seleciona o recurso e, da mesma forma, selecionar um recurso na tela do mapa (no caso de camada ativada para geometria) seleciona a linha na tabela de atributos. Se o conjunto de recursos selecionados na tela do mapa (ou tabela de atributos) for alterado, a seleção também será atualizada na tabela de atributos (ou tela do mapa) de acordo.

As linhas podem ser selecionadas clicando no número da linha no lado esquerdo da linha. Múltiplas linhas podem ser marcadas pressionando a tecla: kbd:Ctrl. Uma seleção contínua pode ser feita pressionando a tecla: kbd:Shift e clicando em vários cabeçalhos de linha no lado esquerdo das linhas. Todas as linhas entre a posição atual do cursor e a linha clicada são selecionadas. Mover a posição do cursor na tabela de atributos, clicando em uma célula na tabela, não altera a seleção de linha. Alterar a seleção na tela principal não move a posição do cursor na tabela de atributos.

Na exibição de formulário da tabela de atributos, as feições são identificados por padrão no painel esquerdo pelo valor do campo exibido (consulte: ref: maptips). Esse identificador pode ser substituído usando a lista suspensa na parte superior do painel, selecionando um campo existente ou usando uma expressão personalizada. Você também pode optar por classificar a lista de recursos no menu suspenso.

Clique em um valor no painel esquerdo para exibir os atributos da feição no caminho certo. Para selecionar uma feição, você precisa clicar dentro do símbolo quadrado à esquerda do identificador. Por padrão, o símbolo fica amarelo. Como na exibição de tabela, você pode executar várias seleções de recursos usando as combinações de teclado expostas anteriormente.

Além de selecionar feições com o mouse, você pode executar a seleção automática com base no atributo da feição, usando as ferramentas disponíveis na barra de ferramentas da tabela de atributos, como (consulte a seção: ref:automatic_selection e a seguir para obter mais informações e casos de uso):

  • expressionSelect Selecione por expressão…

  • formSelect Selecionar Feição pelo Valor…

  • deselectActiveLayer Desmarcar todas as feições da camada

  • selectAll Selecionar Todas as Feições

  • invertSelection Inverter Feições Selecionadas.

Também é possível selecionar recursos usando o :ref: filter_select_form.

16.2.3.2. Filtragem de feições

Depois de selecionar as feições na tabela de atributos, você pode exibir apenas esses registros na tabela. Isso pode ser feito facilmente usando o item Mostrar feições selecionadas na lista suspensa no canto inferior esquerdo da caixa de diálogo da tabela de atributos. Esta lista oferece os seguintes filtros:

  • openTable Mostrar Todas as Feições

  • openTableSelected Show Selected Features - same as using Open Attribute Table (Selected Features) from the Layer menu or the Attributes Toolbar or pressing Shift+F6

  • openTableVisible Show Features visible on map - same as using Open Attribute Table (Visible Features) from the Layer menu or the Attributes Toolbar or pressing Ctrl+F6

  • openTableInvalid Show Features with Failing Constraints - features will be filtered to only show the ones which have failing constraints. Depending on whether the unmet constraint is hard or soft, failing field values are displayed in respectively dark or light orange cells.

  • openTableEdited Show Edited and New Features - same as using Open Attribute Table (Edited and New Features) from the Layer menu or the Attributes Toolbar

  • Field Filter - allows the user to filter based on value of a field: choose a column from a list, type or select a value and press Enter to filter. Then, only the features matching num_field = value or string_field ilike '%value%' expression are shown in the attribute table. You can check checkbox Case sensitive to be less permissive with strings.

  • filterMap Advanced filter (Expression) - Opens the expression builder dialog. Within it, you can create complex expressions to match table rows. For example, you can filter the table using more than one field. When applied, the filter expression will show up at the bottom of the form.

  • handleStoreFilterExpressionChecked Stored filter expressions ►: a shortcut to saved expressions frequently used for filtering your attribute table.

Também é possível: ref: filtrar recursos usando formulários <filter_select_form>.

Nota

A filtragem de registros da tabela de atributos não filtra feições da camada; eles são simplesmente ocultados momentaneamente da tabela e podem ser acessados ​​na tela do mapa ou removendo o filtro. Para filtros que ocultam recursos da camada, use o Query Builder.

Dica

Atualize a filtragem da fonte de dados com Mostrar feições visíveis no mapa

Quando, por motivos de desempenho, os recursos mostrados na tabela de atributos são espacialmente limitados à extensão da tela em sua abertura (consulte: ref: Opções da fonte de dados<tip_table_filtering> para obter instruções), selecionando: guilabel: Mostrar feições visíveis no mapa em um nova extensão de tela atualiza a restrição espacial.

16.2.3.3. Armazenamento de expressões de filtro

Expressions you use for attribute table filtering can be saved for further calls. When using Field Filter or Advanced Filter (expression) entries, the expression used is displayed in a text widget in the bottom of the attribute table dialog. Press the handleStoreFilterExpressionUnchecked Save expression with text as name next to the box to save the expression in the project. Pressing the drop-down menu next to the button allows to save the expression with a custom name (Save expression as…). Once a saved expression is displayed, the handleStoreFilterExpressionChecked button is triggered and its drop-down menu allows you to Edit the expression and name if any, or Delete stored expression.

Saved filter expressions are saved in the project and available through the Stored filter expressions menu of the attribute table. They are different from the user expressions, shared by all projects of the active user profile.

16.2.3.4. Filtrando e selecionando feições usando formulários

Clicando no filterMap :sup: Filtre/selecione recursos usando o formulário ou pressione :kbd:Ctrl+F` fará com que a caixa de diálogo da tabela de atributos mude para a exibição do formulário e substitua cada widget por sua variante de pesquisa.

A partir deste ponto, a funcionalidade desta ferramenta é semelhante à descrita em: ref: select_by_value, onde é possível encontrar descrições de todos os operadores e selecionar modos.

../../../_images/tableFilteredForm.png

Fig. 16.71 Tabela de atributos filtrada pelo formulário de filtro

Ao selecionar / filtrar feições da tabela de atributos, existe um botão Filtro de feições que permite definir e refinar filtros. Seu uso aciona a opção: guilabel: Filtro avançado (Expressão) e exibe a expressão de filtro correspondente em um widget de texto editável na parte inferior do formulário.

Se já houver feições filtradas, você poderá refinar o filtro usando a lista suspensa ao lado do botão Filtro de feições. As opções são:

  • Filtrar dentro de (“AND”)

  • Estender filtro (“OR”)

Para limpar o filtro, selecione a opção Mostrar todas as feições no menu suspenso inferior esquerdo ou limpe a expressão e clique em Aplicar ou pressione Enter.

16.2.4. Usando ação em feições

Os usuários têm várias possibilidades de manipular feições com o menu contextual, como:

  • Selecionar todas (Ctrl+A) as feições;

  • Copie o conteúdo de uma célula na área de transferência com: guilabel:Copiar conteúdo da célula;

  • Aproximar na feição sem ter que selecioná-lo previamente;

  • Panorâmica da feição sem ter que selecioná-lo previamente;

  • Destacar feição, para destacá-la na tela do mapa;

  • Abrir formulário: alterna a tabela de atributos para a exibição de formulários, com foco na feição clicado.

../../../_images/copyCellContent.png

Fig. 16.72 Copiar botão de conteúdo da célula

Se você deseja usar dados de atributo em programas externos (como Excel, LibreOffice, QGIS ou um aplicativo Web personalizado), selecione uma ou mais linhas e use o copySelected Copie as linhas selecionadas para a área de transferência ou pressione: kbd:Ctrl+C.

Em: menuselection: menu Configurações -> Opções -> Fonte de Dado, você pode definir o formato no qual colar Copiar feições como lista suspensa:

  • Texto simples, sem geometria,

  • Texto simples, geometria WKT,

  • GeoJSON

Você também pode exibir uma lista de ações neste menu contextual. Isso é ativado na guia Propriedades da camada ► Ações. Veja Propriedades de Ações para mais informações sobre ações.

16.2.4.1. Salvando feições selecionadas como nova camada

The selected features can be saved as any OGR-supported vector format and also transformed into another coordinate reference system (CRS). In the contextual menu of the layer, from the Layers panel, click on Export ► Save selected features as… to define the name of the output dataset, its format and CRS (see section Criando novas camadas a partir de uma camada existente). You’ll notice that checkbox Save only selected features is checked. It is also possible to specify GDAL creation options within the dialog.

16.2.5. Editando valores de atributo

A edição dos valores dos atributos pode ser feita por:

  • digitando o novo valor diretamente na célula, esteja a tabela de atributos na visualização de tabela ou formulário. As mudanças são feitas célula por célula, feição por feição;

  • using the field calculator: update in a row a field that may already exist or to be created but for multiple features. It can be used to create virtual fields;

  • using the quick field calculation bar: same as above but for only existing field;

  • or using the multi edit mode: update in a row multiple fields for multiple features.

16.2.5.1. Utilizando a Calculadora de Campo

The calculateField Field Calculator button in the attribute table allows you to perform calculations on the basis of existing attribute values or defined functions, for instance, to calculate length or area of geometry features. The results can be used to update an existing field, or written to a new field (that can be a virtual one).

The field calculator is available on any layer that supports edit. When you click on the field calculator icon the dialog opens (see Fig. 16.73). If the layer is not in edit mode, a warning is displayed and using the field calculator will cause the layer to be put in edit mode before the calculation is made.

Based on the Expression Builder dialog, the field calculator dialog offers a complete interface to define an expression and apply it to an existing or a newly created field. To use the field calculator dialog, you must select whether you want to:

  1. aplicar o cálculo sobre toda a camada ou apenas sobre as características selecionadas

  2. criar um novo campo para o cálculo ou atualizar um já existente.

../../../_images/fieldcalculator.png

Fig. 16.73 Calculadora de campo

If you choose to add a new field, you need to enter a field name, a field type (integer, real, date or string) and if needed, the total field length and the field precision. For example, if you choose a field length of 10 and a field precision of 3, it means you have 7 digits before the dot, and 3 digits for the decimal part.

A short example illustrates how field calculator works when using the Expression tab. We want to calculate the length in km of the railroads layer from the QGIS sample dataset:

  1. Load the shapefile railroads.shp in QGIS and press openTable Open Attribute Table.

  2. Click on toggleEditing Toggle editing mode and open the calculateField Field Calculator dialog.

  3. Select the checkbox Create a new field checkbox to save the calculations into a new field.

  4. Set Output field name to length_km

  5. Selecione Número decimal (real) como Tipo de campo de saída`.

  6. Set the Output field length to 10 and the Precision to 3

  7. Double click on $length in the Geometry group to add the length of the geometry into the Field calculator expression box (you will begin to see a preview of the output, up to 60 characters, below the expression box updating in real-time as the expression is assembled).

  8. Complete the expression by typing / 1000 in the Field calculator expression box and click OK.

  9. You can now find a new length_km field in the attribute table.

16.2.5.2. Criando um campo virtual

A virtual field is a field based on an expression calculated on the fly, meaning that its value is automatically updated as soon as an underlying parameter changes. The expression is set once; you no longer need to recalculate the field each time underlying values change. For example, you may want to use a virtual field if you need area to be evaluated as you digitize features or to automatically calculate a duration between dates that may change (e.g., using now() function).

Nota

Uso de campos virtuais

  • Os campos virtuais não são permanentes nos atributos da camada, o que significa que eles são salvos e disponibilizados apenas no arquivo de projeto em que foram criados.

  • Um campo pode ser definido como virtual somente em sua criação. Os campos virtuais são marcados com um fundo roxo na guia de campos da caixa de diálogo de propriedades da camada para distingui-los dos campos físicos regulares ou unidos. Sua expressão pode ser editada posteriormente pressionando o botão de expressão na coluna Comentário. Uma janela do editor de expressão será aberta para ajustar a expressão do campo virtual.

16.2.5.3. Usando a barra de cálculo rápido de campo

While Field calculator is always available, the quick field calculation bar on top of the attribute table is only visible if the layer is in edit mode. Thanks to the expression engine, it offers a quicker access to edit an already existing field:

  1. Selecione o campo a ser atualizado na lista suspensa.

  2. Fill the textbox with a value, an expression you directly write or build using the expression expression button.

  3. Click on Update All, Update Selected or Update Filtered button according to your need.

../../../_images/fieldcalculatorbar.png

Fig. 16.74 Barra de cálculo rápido de campo

16.2.5.4. Editando vários campos

Ao contrário das ferramentas anteriores, o modo de edição múltipla permite que vários atributos de diferentes recursos sejam editados simultaneamente. Quando a camada é alternada para edição, os recursos de edição múltipla ficam acessíveis:

  • using the multiEdit Toggle multi edit mode button from the toolbar inside the attribute table dialog;

  • or selecting Edit ► multiEdit Modify attributes of selected features menu.

Nota

Unlike the tool from the attribute table, hitting the Edit ► Modify Attributes of Selected Features option provides you with a modal dialog to fill attributes changes. Hence, features selection is required before execution.

Para editar vários campos em uma linha:

  1. Selecione as feições que você deseja editar.

  2. From the attribute table toolbar, click the multiEdit button. This will toggle the dialog to its form view. Feature selection could also be made at this step.

  3. At the right side of the attribute table, fields (and values) of selected features are shown. New widgets appear next to each field allowing for display of the current multi edit state:

    • multiEditMixedValues The field contains different values for selected features. It’s shown empty and each feature will keep its original value. You can reset the value of the field from the drop-down list of the widget.

    • multiEditSameValues All selected features have the same value for this field and the value displayed in the form will be kept.

    • multiEditChangedValues The field has been edited and the entered value will be applied to all the selected features. A message appears at the top of the dialog, inviting you to either apply or reset your modification.

    Clicking any of these widgets allows you to either set the current value for the field or reset to original value, meaning that you can roll back changes on a field-by-field basis.

    ../../../_images/attribute_multiedit.png

    Fig. 16.75 Campos de edição de múltiplas feições

  4. Faça as alterações nos campos desejados.

  5. Clique em Aplicar alterações no texto da mensagem superior ou em qualquer outro recurso no painel esquerdo.

As alterações serão aplicadas a todos os recursos selecionados. Se nenhum recurso for selecionado, toda a tabela será atualizada com suas alterações. As modificações são feitas como um único comando de edição. Então, pressionando |desfazer| Desfazer reverterá as alterações de atributo para todos os recursos selecionados de uma só vez.

Nota

O modo de edição múltipla só está disponível para formulários gerados automaticamente e de arrastar e soltar (veja personalizar_formulário); ele não é suportado por formulários de interface do usuário personalizados.

16.2.6. Exploring features attributes through the Identify Tool

The identify Identify features tool can be used to display all attributes of a feature in the map canvas. It is a quick way to view and verify all data without having to search for it in the attribute table.

To use the Identify features tool for vector layers, follow these steps:

  1. Select the vector layer in the Layers panel.

  2. Click on the Identify features tool in the toolbar or press Ctrl+Shift+I.

  3. Click on a feature in the map view.

The Identify results panel will display different features information depending on the layer type. There are two columns in the panel, on the left side you can see Feature and on the right side Value. Under the Feature column, panel will display following information:

  • Derived section - those are the information calculated or derived from other information in the layer. For example, the area of a polygon or the length of a line. General information that can be found in this section:

    • Depending on the geometry type, cartesian measurements of length, perimeter, or area in the layer’s CRS units. For 3D line vectors, the cartesian line length is available.

    • Depending on the geometry type and if an ellipsoid is set in the Project Properties dialog (General –> Measurements), ellipsoidal values of length, perimeter, or area using the specified units.

    • The count of geometry parts in the feature and the number of the part clicked.

    • The count of vertices in the feature.

    Coordinate information that can be found in this section:

    • X and Y coordinate values of the clicked point.

    • The number of the closest vertex to the clicked point.

    • X and Y coordinate values of the closest vertex.

    • If you click on a curved segment, the radius of that section is also displayed.

  • Data attributes: This is the list of attribute fields and values for the feature that has been clicked.

  • information about the related child feature if you defined a relation:

    • the name of the relation

    • the entry in reference field, e.g. the name of the related child feature

    • Actions: lists actions defined in the layer’s properties dialog (see Propriedades de Ações) and the default action is View feature form.

    • Data attributes: This is the list of attributes fields and values of the related child feature.

16.2.7. Armazenamento e busca de um recurso externo

Um campo pode ter como alvo um recurso armazenado em um sistema de armazenamento externo. Os formulários de atributos podem ser configurados para que atuem como clientes de um sistema de armazenamento externo a fim de armazenar e buscar esses recursos, sob demanda dos usuários, diretamente dos formulários.

16.2.7.1. Configuração de um armazenamento externo

In order to setup an external storage, you have to first configure it from the vector attribute form properties and select the Attachment widget.

../../../_images/external_storage_configuration.png

Fig. 16.76 Editing a WebDAV external storage for a given field

From the Attachment widget, you have to first select the Storage type:

  • Select Existing File: The target URL already exists. When you select a resource, no store operation is achieved, the attribute is simply updated with the URL.

  • Simple Copy: Stores a copy of the resource on a file disk destination (which could be a local or network shared file system) and the attribute is updated with the path to the copy.

  • WebDAV Storage: The resource is pushed to a HTTP server supporting the WebDAV protocol and the attribute is updated with its URL. Nextcloud, Pydio or other file hosting software support this protocol.

  • AWS S3: The resource is pushed to a server supporting AWS Simple Storage Service protocol and the attribute is updated with its URL. Amazon Web Service and MinIO hosting software support this protocol.

Then, you have to set up the Store URL parameter, which provides the URL to be used when a new resource needs to be stored. It’s possible to set up an expression using the data defined override widget in order to have specific values according to feature attributes.

The variable @selected_file_path could be used in that expression and represent the absolute file path of the user selected file (using the file selector or drag’n drop).

Nota

Using the WebDAV or AWS S3 external storage, if the URL ends with a “/”, it is considered as a folder and the selected file name will be appended to get the final URL.

Se o sistema de armazenamento externo precisar, é possível configurar uma :ref:`autenticação <authentication>’.

Nota

To use the AWS S3 external storage, you must use an AWS S3 authentication type.

16.2.7.2. Usando um armazenamento externo

Once configured, you can select a local file using the button when editing a feature’s attribute. Depending on the configured storage type, the file will be stored on the external storage system (except if Select existing file has been selected) and the field will be updated with the new resource URL.

../../../_images/external_storage_store.png

Fig. 16.77 Storing a file to a WebDAV external storage

Nota

O usuário também pode obter o mesmo resultado se arrastar e soltar um arquivo em todo o elemento de anexo.

Use the taskCancel Cancel button to abort the storing process. It’s possible to configure a viewer using the Integrated document viewer so the resource will be automatically fetched from the external storage system and displayed directly below the URL. The above warning icon indicates that the resource cannot be fetched from the external storage system. In that case, more details might appear in the Log Messages Panel.